Introduction of Java_Theory
Introduction of Java_Theory
POP OOP
Emphasis on functions Emphasis on data items rather than functions
Functions shares global data It divides the program into number of objects
Data keeps on floating from one function to Objects can use bridge to flow from one function
other to other
Less secured More secured as data hiding enhance security
Compiler Interpreter
Conversion of source code to Conversion of source code to
machine(object) code all at once machine(object) code line by line
Compiler is faster but difficult to Interpreter takes time but solves it
debug the program as all errors are line by line
shown together
Eg FORTRAN Eg UNIX, WINDOWS 8, OS
1. Java uses both compiler as well as Interpreter.
Ans. Java converts source code to intermediate code called as byte code which is platform independent
which in turn converts it to machine code with a special interpreter called JVM (Java virtual machine )
Java applet is internet based application software. Needs web browser
is a standalone program to accomplish a task. Works without
browser
• Hard Coded value eg int a=5;
• Function Arguments eg void main(int a)
• Scanner Inputs eg int a=ob.nextInt();
• Java reserved word is called as keyword which carry special meaning to the
system compiler. java.lang,java.util
• System.out.print( ) - Output on same line
• System.out.println( ) - Output on next line
• A compound statement is a statement which encloses a number of
statements within a block of opening and closing curly braces.
e.g.
if(a>b)
{
}
Static Initialization Dynamic Initialization
• Initialization during coding of • Initialization during run time
program
• Direct assignment • Outcome of relational, logical or
mathematical operation.
• Eg int a=5; • Eg. int c=a+b;
• // Single line Statement
• /* */ Multiline Statement
• /** */ Document line comment