Professional Documents
Culture Documents
1.history of Java
1.history of Java
1.history of Java
Java is platform of independent software language. Earlier the language was name OAK. Earlier it was made for internal
use of some OAK name of tree (coffee).Java is made of Java Bin. Java is complete object oriented programming language.
Java can be used on the internet were C++ now.
{* In 1960’s internet is developed}
{ *Applet-Applet can be used only Net}
Features of Java
1. Java is a complete OOP’s language.
2. Java provides all the features of an OOP language i.e. Encapsulation, Polymorphism & Inheritance.
3. Java provides higher level of security.
4. Java uses familiar codes.
5. Java provides the concept of reusability, one class function use more than one times.
6. Java is platform independent language.
Explanation of Java
Everything will be part of Java .Java uses same code like C++.
Embedded technology
Programming is done at cheap level. Java is used an internet embedded technology & standard form so it is a
robust language.
Byte code
After compilation in java source code converted into byte code, byte code can be represented as dot class file. Dot
class file contains byte code. The source code must be save using Java.
Compiler
javac filename .java
Run –
JRE + Interpreter =JVM
{JRE-Java runtime Environment}
{JVM-Java virtual machine}
NOTE:-
OS is also known as JVM.
Byte code also runs in JVM. It can’t run any operating system.
JVM makes, java platform independent.
Some points:-
I. After compilation only machine code obtained.
II. Source code compiled byte code.
III. Byte code runs necessary JVM.
IV. Java doesn’t have on Id usually work on DOS.
V. JIT (Just Intype compiler) which convert machine code.
VI. Java is case sensitive.
Program
public class Test
{
public static void main(String[] args)
{
System.out.print("Hellow world");
}
}Note:-
1. Name of class – (e.g.-Test) & filename must be same.
2. In C++ we use public, private & protected but Java basically used public.
3. (a)static = access without object .
(b) main existence without object.
4. Void- No return.
5. Main – Identify program.
6. Main (String arg[])- It is a member function.
7. String is a class in Java these classes used as data type to stop. String is definite not another.
8. arg[] = arg is a variable write any name.
9. System = again one class in which first letter is capital.
10. Class have not existence but object have existence feature defined under the class.
Predefined class-
It must start capital but one or more than word then first letter capital.
E.g.- ArrayIndexOutOfBoundsException.
All the predefined method or predefined class has one or more word first word small & method second word
first letter capital.
E.g.- toUpperCase()
Data type-
1. byte
2. boolean 1 byte
3. char
4. short 2 byte
5. int
6. float 4 byte
7. long
8. double 8 byte
Java represents Unicode not ASCII character like Roman, Arabic character that means different languages used in
character.
Boolean-
Boolean used two values either true or false, not but in double quotes, then convert in string or character. No any
quotes used & write in small character.
Short-
Integer value reduces half no space wastage so use short.
Long –
Integer value just doubles value change.
Double-
Integer capacity is just double.
class Reverse
{
int rev=0,rem,num;
public void display(int i)
{
num=i;
while(num!=0)
{
rem=num%10;
rev=rev*10+rem;
num=num/10;
}
System.out.println("the reverse of the number is="+rev);
}
public static void main(String arg[])
{
Reverse rr=new Reverse();
int j=Integer.parseInt(arg[0]);
rr.display(j);
}
}