SlideShare a Scribd company logo
BASIC STRUCTURE – Fundamentals to Understand
Class
Attributes
Primitive data types in Java
Arrays – How to declare them
Methods in Java
Main method - It provides the control of program flow.
Simple methods – We need object to access such methods
Static methods - We DON’T need object to access such methods
Constructors
Object – An instance of a class
How to instantiate? Calling of method/attribute.
//Creating an object of Student class with name as “ram”
Student ram = new Student();
//Accessing the method/attribute of ram
ram.course=“M.C.A”;
System.out.println(“New course of ram is: ”+ ram.course)
BASIC STRUCTURE – Fundamentals to Understand
Single line comments: These comments start with //
e.g.: // this is comment line
Multi line comments: These comments start with /* and end with */
e.g.: /* this is comment line*/
Since Java is purely an Object Oriented Programming language –
• We must have at least one class.
• We must create an object of a class, to access SIMPLE methods/attributes of
a class.
Static methods are the methods, which can be called and executed without
creating objects. e.g. main() method.
BASIC STRUCTURE – Flow of Execution
JVM contains the Java interpreter, which in turn calls the main () method using its Classname.main
() at the time of running the program.
main() method must contain String array as argument.
Since, main () method should be available to the JVM, it should be
declared as public.
Write the main method. Execution starts from main() method.
[Plz note, we do not need an object to access/execute main() method becuase it is static.]
Write the first class containing the main() method.
Name of the class and the name of the file should be EXACLTY same.
Import the required packages. By default import java.lang.*
A package is a kind of directory that contains a group of related classes and interfaces. A class or interface contains methods.
//This program prints Welcome to Java!
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
PROGRAM EXECUTION – STEP I
Enter main method.
The main method provides the control of program flow. The Java interpreter
executes the application by invoking the main method.
//This program prints Welcome to Java!
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
PROGRAM EXECUTION – STEP II
Execute Statement 1
ESCAPE SEQUENCE
Java supports all escape sequence which is supported by C/ C++.
t Insert a tab in the text at this point.
b Insert a backspace in the text at this point.
n Insert a newline in the text at this point.
r Insert a carriage return in the text at this point.
f Insert a form feed in the text at this point.
' Insert a single quote character in the text at this point.
" Insert a double quote character in the text at this point.
 Insert a backslash character in the text at this point.
USER INPUT
There are three ways to take input from a user:
1. User input as Command Line Argument
2. User input using Scanner class object
3. User input using BufferedReader class object
USER INPUT - Command Line Argument - Example
class Student{
String course;
String address;
Integer semester;
}
import java.lang.*;
class Test{
public static void main(String[] args){
Student ramesh = new Student();
//Set the values to attributes
ramesh.course="B.Tech";
ramesh.address=“Delhi";
}
}
USER INPUT - Command Line Argument - Example
class Student{
String course;
String address;
Integer semester;
}
import java.lang.*;
class Test{
public static void main(String[] args){
Student ramesh = new Student();
//Set the values to attributes
ramesh.course=args[0];
ramesh.address=args[1];
}
}
javac Test.java
java Test B.Tech Delhi
USER INPUT - Command Line Argument - Example
class Student{
String course;
String address;
Integer semester;
}
import java.lang.*;
class Test{
public static void main(String[] args){
Student ramesh = new Student();
//Set the values to attributes
ramesh.course=args[0];
ramesh.address=args[1];
int i = Integer.parseInt(args[2]);
ramesh.semester=i
}
}
javac Test.java
java Test B.Tech Delhi 5
USER INPUT - using Scanner class object
import java.util.Scanner;
class Test{
public static void main(String[] args){
Student ramesh = new Student();
Scanner ob=new Scanner(System.in);
System.out.println("Please enter the course");
String courseTemp=ob.nextLine();
System.out.println("Please enter sem no. ");
int semesterTemp=ob.nextInt();
//Set the values to attributes
ramesh.course=courseTemp;
ramesh.semester=semesterTemp;
}
}
For more: http://www.tutorialspoint.com/java/util/java_util_scanner.htm
USER INPUT - using BufferedReader class object
import java.io.BufferedReader;
import java.io.Exception;
import java.io.InputStreamReader;
public class Test{
public static void main(String[] args) throws Exception {
BufferedReader br=new BufferedReader(new
InputStreamReader(System.in));
System.out.print("Enter String");
String s = br.readLine();
System.out.print("Enter Integer:");
try{
int i = Integer.parseInt(br.readLine());
}catch(Exception e){
System.err.println("Invalid Format!");
System.out.println(e);
}
}
}
For more: http://stackoverflow.com/questions/2231369/scanner-vs-bufferedreader
BASIC STRUCTURE – Fundamentals to Understand
Class
Attributes
Primitive data types in Java
Arrays – How to declare them
Methods in Java
Main method - It provides the control of program flow.
Simple methods – We need object to access such methods
Static methods - We DON’T need object to access such methods
Constructors
Object – An instance of a class
How to instantiate? Calling of method/attribute.
CONSTRUCTOR
A class contains constructors that are invoked to create objects.
There are basically two rules defined for the constructor:
• Constructor name must be same as its class name
• Constructor must have no explicit return type
Class Bicycle{
int gear, cadence, speed;
public Bicycle(int startCadence, int startSpeed, int startGear) {
gear = startGear;
cadence = startCadence;
speed = startSpeed;
}
}
To create a new Bicycle object called myBike, a constructor is called by the new operator:
Bicycle myBike = new Bicycle(30, 0, 8);
new Bicycle(30, 0, 8) creates space in memory for the object and initializes its fields.
CONSTRUCTOR
Although Bicycle only has one constructor, it could have others, including a no-argument
constructor:
//Inside Bicycle class
public Bicycle() {
gear = 1;
cadence = 10;
speed = 0;
}
//Outside Bicycyle class – e.g. Inside main method
Bicycle yourBike = new Bicycle();
above statement invokes the no-argument constructor to create a new Bicycle
object called yourBike.
• Both (or more) constructors could have been declared in same class - Bicycle.
• Constructors are differentiated by Java Interpreter based on the SIGNATURE.
• SIGNATURE = No. of arguments + Data type of arguments + Order of arguments
CONSTRUCTOR
class Student{
String course;
String address;
int semester;
//Default Constructor – NO ARGUMENT
public Student(){
//Creates space in memory for the object and initializes its fields to defualt.
}
//Parameterized Constructor – ALL ARGUMENTS
public Student(String s1, String s2, int i1){
this.course=s1;
this.course=s2;
this.semester=i1;
}
//Parameterized Constructor – FEW ARGUMENTS
public Student(String s1){
this.course=s1;
}
}
Rule: If there is no constructor in a class, compiler automatically creates a default constructor.
CONSTRUCTOR
import java.lang.*;
class Test{
public static void main(String[] args){
//Get the values in to TEMPORARY variables
String temp1 = args[0];
String temp2 = args[1];
int temp3 = args[2];
Student ramesh = new Student(temp1,temp2,temp3);
System.out.println(ramesh.course);
System.out.println(ramesh.address);
System.out.println(ramesh.semester);
}
}
javac Test.java
java Test B.Tech Delhi 5
PRIMITIVE DATA TYPE in JAVA
Type Contains Default Size Range
byte Signed integer 0 8 bits -128 to 127
short Signed integer 0 16 bits -32768 to 32767
int Signed integer 0 32 bits -2147483648 to 2147483647
float
IEEE 754 floating
point
0.0f 32 bits ±1.4E-45 to ±3.4028235E+38
long Signed integer 0L 64 bits
-9223372036854775808 to
9223372036854775807
double
IEEE 754 floating
point
0.0d 64 bits ±4.9E-324 to ±1.7976931348623157E+308
boolean true or false FALSE 1 bit NA
char Unicode character 'u0000' 16 bits u0000 to uFFFF
FEATURES of JAVA
• Simple: Learning and practicing java is easy because of resemblance with C and C++.
• Object Oriented Programming Language: Unlike C++, Java is purely OOP.
• Distributed: Java is designed for use on network; it has an extensive library which works
in agreement with TCP/IP.
• Secure: Java is designed for use on Internet. Java enables the construction of virus-free,
tamper free systems.
• Robust (Strong enough to withstand intellectual challenge): Java programs will not
crash because of its exception handling and its memory management features.
• Interpreted: Java programs are compiled to generate the byte code. This byte code can
be downloaded and interpreted by the interpreter. .class file will have byte code
instructions and JVM which contains an interpreter will execute the byte code.
FEATURES of JAVA
• Portable: Java does not have implementation dependent aspects and it yields or gives
same result on any machine.
• Architectural Neutral Language: Java byte code is not machine dependent, it can run
on any machine with any processor and with any OS.
• High Performance: Along with interpreter there will be JIT (Just In Time) compiler which
enhances the speed of execution.
• Multithreaded: Executing different parts of program simultaneously is called
multithreading. This is an essential feature to design server side programs.
• Dynamic: We can develop programs in Java which dynamically change on Internet (e.g.:
Applets).
P l e a s e G o o g l e / Re a d m o re fo r R E D h i g h l i g h t e d c o l o r ke y w o rd s
F O R M O R E I N F O / O F F I C I A L L I N K - JAVA
h t t p : / / d o c s . o ra c l e . c o m / j a v a s e / t u t o r i a l / j a v a / j a v a O O / i n d e x . h t m l

More Related Content

PDF
C progrmming
PPT
Lecture 3 java basics
PDF
Basic Java Programming
PPTX
Java features
PPTX
Core java
PPT
Java Basics
PPTX
Basics of Java
PPTX
Core Java Tutorials by Mahika Tutorials
C progrmming
Lecture 3 java basics
Basic Java Programming
Java features
Core java
Java Basics
Basics of Java
Core Java Tutorials by Mahika Tutorials

What's hot (19)

PPTX
Java history, versions, types of errors and exception, quiz
PPTX
Core java
PPT
Java platform
PDF
Java Programming
PDF
Core Java
PDF
Core Java Tutorial
PPT
Core java
PPT
Java Tutorial
PPTX
Core Java introduction | Basics | free course
PPT
Java API, Exceptions and IO
PPTX
PPT
Java basic tutorial by sanjeevini india
PPTX
Object oriented programming-with_java
PPTX
Introduction to java 101
PDF
Java Presentation For Syntax
DOCX
Java notes
PPT
Java tutorial PPT
PPT
Unit 2 Java
PPT
Java Tutorial
Java history, versions, types of errors and exception, quiz
Core java
Java platform
Java Programming
Core Java
Core Java Tutorial
Core java
Java Tutorial
Core Java introduction | Basics | free course
Java API, Exceptions and IO
Java basic tutorial by sanjeevini india
Object oriented programming-with_java
Introduction to java 101
Java Presentation For Syntax
Java notes
Java tutorial PPT
Unit 2 Java
Java Tutorial
Ad

Viewers also liked (14)

PPT
X$Tables And Sga Scanner, DOAG2009
PDF
Pemrograman Berorientasi Objek dengan Java
PPTX
Java 8 Streams And Common Operations By Harmeet Singh(Taara)
PPTX
Buffer and scanner
PPTX
Define location of Preplaced cells(http://www.vlsisystemdesign.com/PD-Flow.php)
PPT
1 java - data type
PDF
Jnp
PPTX
Understanding java streams
PDF
PPSX
Esoft Metro Campus - Certificate in java basics
PPT
Object-Oriented Analysis and Design
PPTX
Structured Vs, Object Oriented Analysis and Design
PPTX
Class object method constructors in java
PPT
Object Oriented Analysis and Design
X$Tables And Sga Scanner, DOAG2009
Pemrograman Berorientasi Objek dengan Java
Java 8 Streams And Common Operations By Harmeet Singh(Taara)
Buffer and scanner
Define location of Preplaced cells(http://www.vlsisystemdesign.com/PD-Flow.php)
1 java - data type
Jnp
Understanding java streams
Esoft Metro Campus - Certificate in java basics
Object-Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
Class object method constructors in java
Object Oriented Analysis and Design
Ad

Similar to java: basics, user input, data type, constructor (20)

PPTX
Java For beginners and CSIT and IT students
PPT
Jacarashed-1746968053-300050282-Java.ppt
PDF
Java lab-manual
PPTX
UNIT 3- Java- Inheritance, Multithreading.pptx
PPTX
Object Oriented Programming unit 1 content for students
PDF
JAVA Object Oriented Programming (OOP)
PPT
Java findamentals1
PPT
Java findamentals1
PPT
Java findamentals1
PPT
Packages and interfaces
PDF
4CS4-25-Java-Lab-Manual.pdf
PPTX
Chapter 2.1
PPT
Introduction
PPTX
object oriented programming unit one ppt
PDF
java basic .pdf
PPTX
2. Introduction to Java for engineering stud
PPTX
JAVA PROGRAMMING presentation for engineering student.pptx
PPTX
objectorientedprogrammingCHAPTER 2 (OOP).pptx
PPTX
Java introduction
PPTX
Introduction of Object Oriented Programming Language using Java. .pptx
Java For beginners and CSIT and IT students
Jacarashed-1746968053-300050282-Java.ppt
Java lab-manual
UNIT 3- Java- Inheritance, Multithreading.pptx
Object Oriented Programming unit 1 content for students
JAVA Object Oriented Programming (OOP)
Java findamentals1
Java findamentals1
Java findamentals1
Packages and interfaces
4CS4-25-Java-Lab-Manual.pdf
Chapter 2.1
Introduction
object oriented programming unit one ppt
java basic .pdf
2. Introduction to Java for engineering stud
JAVA PROGRAMMING presentation for engineering student.pptx
objectorientedprogrammingCHAPTER 2 (OOP).pptx
Java introduction
Introduction of Object Oriented Programming Language using Java. .pptx

More from Shivam Singhal (10)

PPTX
English tenses
PPT
Chapter 1 introduction to Indian financial system
PPT
Chapter 3 capital market
PPT
Chapter 2 money market
PPT
project selection
PPT
introduction to project management
PPTX
encapsulation, inheritance, overriding, overloading
PPTX
java:characteristics, classpath, compliation
PPT
10 8086 instruction set
English tenses
Chapter 1 introduction to Indian financial system
Chapter 3 capital market
Chapter 2 money market
project selection
introduction to project management
encapsulation, inheritance, overriding, overloading
java:characteristics, classpath, compliation
10 8086 instruction set

Recently uploaded (20)

PPTX
Internship_Presentation_Final engineering.pptx
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PPTX
TE-AI-Unit VI notes using planning model
PDF
Top 10 read articles In Managing Information Technology.pdf
PDF
International Journal of Information Technology Convergence and Services (IJI...
PDF
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Introduction to Data Science: data science process
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Road Safety tips for School Kids by a k maurya.pptx
PPTX
AgentX UiPath Community Webinar series - Delhi
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Simulation of electric circuit laws using tinkercad.pptx
PPT
Drone Technology Electronics components_1
PPTX
Glazing at Facade, functions, types of glazing
PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Internship_Presentation_Final engineering.pptx
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
TE-AI-Unit VI notes using planning model
Top 10 read articles In Managing Information Technology.pdf
International Journal of Information Technology Convergence and Services (IJI...
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Introduction to Data Science: data science process
Operating System & Kernel Study Guide-1 - converted.pdf
Lesson 3_Tessellation.pptx finite Mathematics
Road Safety tips for School Kids by a k maurya.pptx
AgentX UiPath Community Webinar series - Delhi
OOP with Java - Java Introduction (Basics)
Simulation of electric circuit laws using tinkercad.pptx
Drone Technology Electronics components_1
Glazing at Facade, functions, types of glazing
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf

java: basics, user input, data type, constructor

  • 1. BASIC STRUCTURE – Fundamentals to Understand Class Attributes Primitive data types in Java Arrays – How to declare them Methods in Java Main method - It provides the control of program flow. Simple methods – We need object to access such methods Static methods - We DON’T need object to access such methods Constructors Object – An instance of a class How to instantiate? Calling of method/attribute. //Creating an object of Student class with name as “ram” Student ram = new Student(); //Accessing the method/attribute of ram ram.course=“M.C.A”; System.out.println(“New course of ram is: ”+ ram.course)
  • 2. BASIC STRUCTURE – Fundamentals to Understand Single line comments: These comments start with // e.g.: // this is comment line Multi line comments: These comments start with /* and end with */ e.g.: /* this is comment line*/ Since Java is purely an Object Oriented Programming language – • We must have at least one class. • We must create an object of a class, to access SIMPLE methods/attributes of a class. Static methods are the methods, which can be called and executed without creating objects. e.g. main() method.
  • 3. BASIC STRUCTURE – Flow of Execution JVM contains the Java interpreter, which in turn calls the main () method using its Classname.main () at the time of running the program. main() method must contain String array as argument. Since, main () method should be available to the JVM, it should be declared as public. Write the main method. Execution starts from main() method. [Plz note, we do not need an object to access/execute main() method becuase it is static.] Write the first class containing the main() method. Name of the class and the name of the file should be EXACLTY same. Import the required packages. By default import java.lang.* A package is a kind of directory that contains a group of related classes and interfaces. A class or interface contains methods.
  • 4. //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } PROGRAM EXECUTION – STEP I Enter main method. The main method provides the control of program flow. The Java interpreter executes the application by invoking the main method.
  • 5. //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } PROGRAM EXECUTION – STEP II Execute Statement 1
  • 6. ESCAPE SEQUENCE Java supports all escape sequence which is supported by C/ C++. t Insert a tab in the text at this point. b Insert a backspace in the text at this point. n Insert a newline in the text at this point. r Insert a carriage return in the text at this point. f Insert a form feed in the text at this point. ' Insert a single quote character in the text at this point. " Insert a double quote character in the text at this point. Insert a backslash character in the text at this point.
  • 7. USER INPUT There are three ways to take input from a user: 1. User input as Command Line Argument 2. User input using Scanner class object 3. User input using BufferedReader class object
  • 8. USER INPUT - Command Line Argument - Example class Student{ String course; String address; Integer semester; } import java.lang.*; class Test{ public static void main(String[] args){ Student ramesh = new Student(); //Set the values to attributes ramesh.course="B.Tech"; ramesh.address=“Delhi"; } }
  • 9. USER INPUT - Command Line Argument - Example class Student{ String course; String address; Integer semester; } import java.lang.*; class Test{ public static void main(String[] args){ Student ramesh = new Student(); //Set the values to attributes ramesh.course=args[0]; ramesh.address=args[1]; } } javac Test.java java Test B.Tech Delhi
  • 10. USER INPUT - Command Line Argument - Example class Student{ String course; String address; Integer semester; } import java.lang.*; class Test{ public static void main(String[] args){ Student ramesh = new Student(); //Set the values to attributes ramesh.course=args[0]; ramesh.address=args[1]; int i = Integer.parseInt(args[2]); ramesh.semester=i } } javac Test.java java Test B.Tech Delhi 5
  • 11. USER INPUT - using Scanner class object import java.util.Scanner; class Test{ public static void main(String[] args){ Student ramesh = new Student(); Scanner ob=new Scanner(System.in); System.out.println("Please enter the course"); String courseTemp=ob.nextLine(); System.out.println("Please enter sem no. "); int semesterTemp=ob.nextInt(); //Set the values to attributes ramesh.course=courseTemp; ramesh.semester=semesterTemp; } } For more: http://www.tutorialspoint.com/java/util/java_util_scanner.htm
  • 12. USER INPUT - using BufferedReader class object import java.io.BufferedReader; import java.io.Exception; import java.io.InputStreamReader; public class Test{ public static void main(String[] args) throws Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter String"); String s = br.readLine(); System.out.print("Enter Integer:"); try{ int i = Integer.parseInt(br.readLine()); }catch(Exception e){ System.err.println("Invalid Format!"); System.out.println(e); } } } For more: http://stackoverflow.com/questions/2231369/scanner-vs-bufferedreader
  • 13. BASIC STRUCTURE – Fundamentals to Understand Class Attributes Primitive data types in Java Arrays – How to declare them Methods in Java Main method - It provides the control of program flow. Simple methods – We need object to access such methods Static methods - We DON’T need object to access such methods Constructors Object – An instance of a class How to instantiate? Calling of method/attribute.
  • 14. CONSTRUCTOR A class contains constructors that are invoked to create objects. There are basically two rules defined for the constructor: • Constructor name must be same as its class name • Constructor must have no explicit return type Class Bicycle{ int gear, cadence, speed; public Bicycle(int startCadence, int startSpeed, int startGear) { gear = startGear; cadence = startCadence; speed = startSpeed; } } To create a new Bicycle object called myBike, a constructor is called by the new operator: Bicycle myBike = new Bicycle(30, 0, 8); new Bicycle(30, 0, 8) creates space in memory for the object and initializes its fields.
  • 15. CONSTRUCTOR Although Bicycle only has one constructor, it could have others, including a no-argument constructor: //Inside Bicycle class public Bicycle() { gear = 1; cadence = 10; speed = 0; } //Outside Bicycyle class – e.g. Inside main method Bicycle yourBike = new Bicycle(); above statement invokes the no-argument constructor to create a new Bicycle object called yourBike. • Both (or more) constructors could have been declared in same class - Bicycle. • Constructors are differentiated by Java Interpreter based on the SIGNATURE. • SIGNATURE = No. of arguments + Data type of arguments + Order of arguments
  • 16. CONSTRUCTOR class Student{ String course; String address; int semester; //Default Constructor – NO ARGUMENT public Student(){ //Creates space in memory for the object and initializes its fields to defualt. } //Parameterized Constructor – ALL ARGUMENTS public Student(String s1, String s2, int i1){ this.course=s1; this.course=s2; this.semester=i1; } //Parameterized Constructor – FEW ARGUMENTS public Student(String s1){ this.course=s1; } } Rule: If there is no constructor in a class, compiler automatically creates a default constructor.
  • 17. CONSTRUCTOR import java.lang.*; class Test{ public static void main(String[] args){ //Get the values in to TEMPORARY variables String temp1 = args[0]; String temp2 = args[1]; int temp3 = args[2]; Student ramesh = new Student(temp1,temp2,temp3); System.out.println(ramesh.course); System.out.println(ramesh.address); System.out.println(ramesh.semester); } } javac Test.java java Test B.Tech Delhi 5
  • 18. PRIMITIVE DATA TYPE in JAVA Type Contains Default Size Range byte Signed integer 0 8 bits -128 to 127 short Signed integer 0 16 bits -32768 to 32767 int Signed integer 0 32 bits -2147483648 to 2147483647 float IEEE 754 floating point 0.0f 32 bits ±1.4E-45 to ±3.4028235E+38 long Signed integer 0L 64 bits -9223372036854775808 to 9223372036854775807 double IEEE 754 floating point 0.0d 64 bits ±4.9E-324 to ±1.7976931348623157E+308 boolean true or false FALSE 1 bit NA char Unicode character 'u0000' 16 bits u0000 to uFFFF
  • 19. FEATURES of JAVA • Simple: Learning and practicing java is easy because of resemblance with C and C++. • Object Oriented Programming Language: Unlike C++, Java is purely OOP. • Distributed: Java is designed for use on network; it has an extensive library which works in agreement with TCP/IP. • Secure: Java is designed for use on Internet. Java enables the construction of virus-free, tamper free systems. • Robust (Strong enough to withstand intellectual challenge): Java programs will not crash because of its exception handling and its memory management features. • Interpreted: Java programs are compiled to generate the byte code. This byte code can be downloaded and interpreted by the interpreter. .class file will have byte code instructions and JVM which contains an interpreter will execute the byte code.
  • 20. FEATURES of JAVA • Portable: Java does not have implementation dependent aspects and it yields or gives same result on any machine. • Architectural Neutral Language: Java byte code is not machine dependent, it can run on any machine with any processor and with any OS. • High Performance: Along with interpreter there will be JIT (Just In Time) compiler which enhances the speed of execution. • Multithreaded: Executing different parts of program simultaneously is called multithreading. This is an essential feature to design server side programs. • Dynamic: We can develop programs in Java which dynamically change on Internet (e.g.: Applets). P l e a s e G o o g l e / Re a d m o re fo r R E D h i g h l i g h t e d c o l o r ke y w o rd s F O R M O R E I N F O / O F F I C I A L L I N K - JAVA h t t p : / / d o c s . o ra c l e . c o m / j a v a s e / t u t o r i a l / j a v a / j a v a O O / i n d e x . h t m l