Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

Introduction of Java_Theory

The document provides an overview of Java programming, contrasting procedural programming (POP) with object-oriented programming (OOP) and explaining the roles of compilers and interpreters in Java. It highlights Java's use of both compilation and interpretation, resulting in platform-independent bytecode executed by the Java Virtual Machine (JVM). Additionally, it covers various Java concepts such as hard-coded values, function arguments, and different types of initialization.

Uploaded by

Parshveer Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Introduction of Java_Theory

The document provides an overview of Java programming, contrasting procedural programming (POP) with object-oriented programming (OOP) and explaining the roles of compilers and interpreters in Java. It highlights Java's use of both compilation and interpretation, resulting in platform-independent bytecode executed by the Java Virtual Machine (JVM). Additionally, it covers various Java concepts such as hard-coded values, function arguments, and different types of initialization.

Uploaded by

Parshveer Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

INTRODUCTION TO JAVA

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

You might also like