Eclipse IDE

What is eclipse?

  • Eclipse is an integrated development environment (IDE)
  • It is used for developing applications using the Java programming language and other programming languages such as C/C++, Python, PERL, Ruby etc.

How to saving java file in eclipse?

  1. In eclipse file name is same as class name.
  2. Folder name is same as package name.
  3. Drive name is same as project name.

e.g,

file ——-> Class

folder ——-> Package

Drive ——–> Project

Note:

.class (dot class) file is unreadable. JDK is convert to class files. (e.g #adfsr^7688888$$$2222@@@*****) <—— class file

Object Creation.

How object is creation?

Car engine = new Car( );

Mobile vivo = new Mobile( );

Car—> class name. vivo —> object name.

new —-> new keyword is allocation memory for object creation

object —> object is memory reference of the variable

variable —>variable is represents data type

object—>object is represents class

what is state?

state is a attribute. it also called charecter.

Different between variable and object ?

VARIABLE OBJECTS
It represents primitive datatypeIt represents class
It contains only values(state).Object contains values(state) and behaviour
‘new’ keyword is not needed‘new’ keyword is needed for allocating memory
Size is fixed (e.g- int name=5;)Size is not fixed dynamic one

If i choose mobile is an object. then,

state = mobile size, mobile price, camera pixel, battery color, mobile color.

behaviour = chatting, call, browsing.

CLASS OBJECT
TemplateVariable(Data members)
BlueprintMethods(Member function)

How class should creating…..

  1. Meaningful name
  2. Should not be a verb. (e.g – eat,sleep)
  3. Should start with capital letter.
  4. No special charecter allowed except underscore( _ )
  5. Should not start with numbers
  6. No space is allowed
  7. Should follow camel case. (e.g) ActivaBikeFromHonda

Data types

Datatypes in Java

  1. byte – whole numbers.
  2. short – whole numbers
  3. int – whole numbers
  4. long – whole numbers
  5. float – decimal numbers
  6. double – decimal numbers
  7. char – Charectors (It stores only one alphabet or numbers with single quotes)
  8. boolean – True or False

these are also called primitive data types. because all data types size fixed.

1.byte

size – 1 byte

Range – 128 to 127

2.short

size – 2 byte

Range – 32768 to 32767

3.int

size – 4 byte

Range – 2147483648 to 2147483647

4.long

size – 8 byte

Range – 9223372036854775808 to 9223372036854775807

5.float

size – 4 byte

Range – 3.14e+38 to 3.14e+38

6.double

size – 8 byte

Range –

7.char

size – 2 byte

Range –

8.boolean

size – 1 bit

Range –

Declaration

float height = 5.6;

int weight = 100;

char firstletter = ‘t’;

char totalweight=’9′;

boolean name=true;

another example –

int mark;

mark = 98;

Statical Programming Languages –

C, C++, C#, Java

Dynamic Programming Languages –

Python, Javascript, Php

Note

  • Data type is useless without creating variable.
  • A variable is meaningless without data type.

Class

Every class is non primitive data type

Without class there is no objects

Class is a template

It is a blueprint

Object

Object is represents the class

object is real time entity and real thing

objects has state and behaviour

Javascript

Different between C,C++ vs Java

C,C++

  • C, C++ has pointers.
  • It has destructor

Java

  • Java has no pointers
  • It has no destructor
  • It has Automatic Garbage Collection

Pointers

  • It is point out to location
  • It is easy to hacking. so it is not secured.

Garbage Collection

  • Automatically destroyed in objects.

Javascript

  • Javascript is a client side scripting language
  • It is used interpreter
  • It is used for validation purpose

Protocol

  • Set of rules

What are the java frameworks?

  • Spring
  • Spring Boot
  • Hibernate

J1SE —> Core Java

J2EE —–> Java 2 Enterprise Edition

Server Client Architecture

Full Stack Development

Java Basics

What is java?

Java is a programming language and a platform. Java is a high level, robust, object-oriented and secure programming language. It is owned by Oracle.

Java is WRITE ONCE RUN ANYWHERE (WORA)

It is used for:

  • Mobile applications (specially Android apps)
  • Desktop applications
  • Web applications
  • Web servers and application servers
  • Games
  • Database connection

Why use java?

Java works on different platforms.

  • It is easy to learn and simple to use
  • Java is object oriented programming language
  • It is a platform independent
  • It is open-source and free
  • It is secure, fast and powerful

Platform Independent

What is JDK ?

The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It is platform independent. It is a compiler.

JDK is convert to byte codes and class files. JDK is called Compile time running.

It has Compiler, Exception Handling and Garbage Collector.

what is JVM ?

JVM stands for Java Virtual Machine.

JVM is platform dependent as Operating System.

JVM is convert to Binary codes. JVM is called Run time Environment.

Open Source Code

  • Free Software
  • Can run on any system