SlideShare a Scribd company logo
IDEAL EYES BUSINESS COLLEGE
A
PRESENTATION
1UPLOADED BY:- VIVEK KUMAR
2
DEVELOPER OF JAVA:- JAMES GOSLING
1991 1995 2009
1991 2010 2014 STIL..
HISTORY OF JAVA
 Java Is A Object Oriented Programming Language
Developed By James Gosling In Year 1991.
 Java, May 20, 1995, Sun World.
 Originally Language Name Oak.
 It Said To Be The Name Java Is Come From Several
Individuals Involved In This Project James Gosling ,
Arthur , Van Goff And Andy Bechto Lsheim.
 Name Changed To Java.
HISTORY OF JAVA
 Java is popular and powerful language.
 The java language was derived from c++
 Much of the syntax in java is similar to c and
c++.
 Java does not have pointer features.
 Java supports WORA concept means write once,
run anywhere.
 First Public Release In 1995.
5
HISTORY OF JAVA
 Java is high level language that looks
very similar to c and c++ but offers many
unique features of its own.
6
WHERE JAVA IS USED ?
According to sun, 3 billions devices run on
java. There are many devices where java is
currently used some of them are as :-
Desktops
Web
Mobile
7
Embedded system
Smart card
Robotics
Games
DESKTOP
8
WEB
9
MOBILE PHONES
10
EMBEDDED SYSTEM
11
SMART CARD
12
ROBOTICS
13
GAMES
14
FEATURES OF JAVA
 Java is simple
 Java is object-oriented
 Java is platform independent
 Java is distributed
 Java is interpreted
 Java is robust
15
FEATURES OF JAVA
 Java is secure
 Java is architecture-neutral
 Java is portable
 High performance
 Java is multithreaded
 Java is dynamic
16
WHY JAVA IS SIMPLE ?
1. Syntax is based upon c++.
2. Removed many confusing and lorrarely used
features (explicit pointer,operator overloding).
3. No need to remove unreferenced objects
because there is automatic grabage collection
in java.
17
WHAT IS OBJECT ORIENTED?
Object oriented means we organize our software
as a combination of different types of object that
incorporates both data and behavior.
It is methodology that simplify software
development and maintenance by providing some
rules.
We can do program with the help of object
18
iding
BASIC CONCEPT OF OPPS
Basic concept of OPPS are:-
1.Objects
2.Class
3.Inheritance
4.Abstraction
5.Encapsulation
6.Polymorphism
7.Data hiding
19
WHY JAVA IS PLATFORM
INDEPENDENT?
What is platform?
A platform is the hardware and software environment in which
programs runs.
Java is platform independent because its byte code can be run on
multiple platforms.
Like as:- windows, Linux, Unix, sun Solaris, Mac/OS etc.
That is write onces and run anywhere (WORA).
20
WHY JAVA IS MORE SECURED ?
1. Java is more secure because no explicit pointer use in java.
2. Programs run inside the virtual machine sandbox.
3. Class loader adds security by separating the package for the
classes of the local file system from those that are imported
from network sources.
4. Byte code verifier checks the code fragments for illegal code
that can violate access right to object.
5. Some security can also provided by application
developer through SSL, JAAS, cryptography etc.
21
ROBUST
Robust simply means error tolerance . java uses strong
memory management . There are lack of pointer that
avoids security problems. There is automatic garbage
collection in java . There is exception handling and type
checking mechanism in java. All these pointer makes
java robust .
22
ARCHITECTURAL NATURAL
There is no implementation dependent features its
means it is independent of any hardware
configuration.
23
PORTABLE
We may carry the java byte code to any
platform very easily.
HIGH PERFORMANCE
Java is better and faster than traditional
interpretation since byte code is “close” to
native code still some what slower than a
complied language like c++.
24
DISTRIBUTED
We can create distributed application in java.
RMI and EJB are used for creating
distributed application. We may access files
by calling the methods from any machine on
the internet.
25
MULTITHEADED
A Thread Is Like A Separate Program Executing,
Concurrently. We Can Write java program that deal
with many tasks at once by defining multiple
threads. The main advantage of multithreading is
that it shares the same memory. Threads are
important for multimedia ,web application etc.
26
CREATING “HELLO JAVA”
PROGRAMMING EXAMPLE.
Class simple{
public static void main(String args[])
{
System.out.println(“hello java”);
}
}
27
Save this file as simple.java.
To compile javac simple.java
To execution(run time) java simple
Output hello java.
28
CLASS
The classis the essential Java construct. A class is a
template or blueprint for objects. To program in Java,
you must understand classes and be able to write and
use them. The mystery of the class will continue to be
unveiled throughout this book. For now, though,
understand that a program is defined by using one or
more classes.
29
WHAT IS STATIC?
Static is a keyword, if we declare any method
(function) as static ,it is known as static method.
The core advantage of static method is that there Is
no need to create object to invoke the static method.
The main method is executed by the JVM so it
doesn’t require to create object to invoke the main
method ,so it saves memory.
30
ct to
VOID & STRING ARGS[]
Void is the return type method (function) . It
means it doesn’t return any values.
Main represent startup of the program.
String args[] is used command line argument.
System.out.println()
It is used for print the statement.
31
HOW TO SET PATH OF JDK IN WINDOWS
Path is required for using tools such as javac.java
etc. if you are saving the java file in jdk/bin folder,
path is not required but if you are having your java
file outside the JDK/bin folder. It is necessary to set
path JDK. There are two ways to set path of JDK.
1.Temporary
2.permanently
32
SETTING OF TEMPORARY PATH
For setting the temporary of JDK, you need to follow
these steps:-
1.Open command prompt
2.Copy the path of bin folder
3.Write in command prompt
4. Set path= copied path
c:programfilesjavajdk 1.7.0 25bin;.;
33
JAVA PROGRAM
public class testrrr
{
public static void main (String args[])
{
for(int i=0,j=10;i<10;i++,j++)
{
System.out.println(i+" "+j);
}
}
}
34
35
OUTPUT WOULD BE
1. 36
1. public class classA
2. {
3. public int getValue()
4. {
5. int value=0;
6. boolean setting = false;
7. String title="hello";
8. if(setting && title == "hello")
9. {
10. System.out.println("first if
condition");
11. return 1;
12. }
13. if(value == 1 &&
title.equals("hello"))
14. {
15. System.out.println("second if
condition");
16. return 2;
17. }
18. return 5;
19. }
20. public static void main(String args[])
21. {
22. classA a= new classA();
23. int y=a.getValue();
24. System.out.println("value of y is"+y);
25. }
26. }
37
OUTPUT WOULD BE
38
interface DeclareStuff
{
public static final int EASY =3;
void doStuff(int t);
}
public class TestDeclare implements DeclareStuff
{
public static void main(String args[])
{
int x = 5;
new TestDeclare().doStuff(++x);
}
public void doStuff(int s)
{
s += EASY - ++s;
System.out.println("s"+--s);
}
}
39
OUTPUT WOULD BE
40
class c
{
public static void main (String args[])
{
int x=9;
if(x == 9)
{
int x=8;
System.out.println(x);
}
41
OUTPUT WOULD BE
42
class A
{
A(){System.out.println("A class constructor");}
{System.out.println("annonymous block in class
A");}
void display(){System.out.println("display in class
A");}
}
class B extends A
{
B(){System.out.println("B class constructor");}
{System.out.println("annonymous block in class
B");}
void display(){System.out.println("display in class
B");}
}
class C extends B
{
C(){System.out.println("C class constructor");}
class D extends C
{
D(){System.out.println("D class constructor");}
{System.out.println("annonymous block in class
D");}
void display(){System.out.println("display in class
D");}
public static void main(String args[])
{
C c1=new C();
c1.display();
}
}
43
OUTPUT WOULD BE
44
class jump_statments
{
public static void main(String args[])
{
int x=2;
int y=0;
for(;y<10;++y)
{
if(y%x==0)
continue;
else if(y==8)
break;
else
45
OUTPUT WOULD BE
46
class output_test
{
public static void
main(String args[])
{
int x,y=1;
x=10;
if (x!=10 && x/0 ==0)
System.out.println(y);
else
System.out.println(++y);
47
OUTPUT WOULD BE
DON’T TRY TO LEARN
JAVA JUST TRY TO LIVE
IT..
THANK YOU
48

More Related Content

PPTX
Core Java Tutorials by Mahika Tutorials
Mahika Tutorials
 
PPTX
Introduction to java
Sandeep Rawat
 
PDF
Introduction to Java Programming
Ravi Kant Sahu
 
PPT
Introduction to Java Programming, Basic Structure, variables Data type, input...
Mr. Akaash
 
PPT
Basic of Multithreading in JAva
suraj pandey
 
PPTX
Core java complete ppt(note)
arvind pandey
 
PPTX
Java Programming
Elizabeth alexander
 
PDF
Introduction to Java Programming Language
jaimefrozr
 
Core Java Tutorials by Mahika Tutorials
Mahika Tutorials
 
Introduction to java
Sandeep Rawat
 
Introduction to Java Programming
Ravi Kant Sahu
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Mr. Akaash
 
Basic of Multithreading in JAva
suraj pandey
 
Core java complete ppt(note)
arvind pandey
 
Java Programming
Elizabeth alexander
 
Introduction to Java Programming Language
jaimefrozr
 

What's hot (20)

PPT
Java: GUI
Tareq Hasan
 
PDF
Introduction to java (revised)
Sujit Majety
 
PDF
Basic Java Programming
Math-Circle
 
PPTX
Training on Core java | PPT Presentation | Shravan Sanidhya
Shravan Sanidhya
 
PPTX
Java
Tony Nguyen
 
PPTX
core java
Roushan Sinha
 
PPT
Oop java
Minal Maniar
 
PPTX
Core java
Shubham singh
 
PPTX
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
shamnasain
 
PPT
Java multi threading
Raja Sekhar
 
PPTX
Advance Java Topics (J2EE)
slire
 
PDF
JavaScript - Chapter 15 - Debugging Techniques
WebStackAcademy
 
PPTX
Control statements in java
Madishetty Prathibha
 
PPT
Java Basics
Sunil OS
 
PDF
Java Presentation For Syntax
PravinYalameli
 
PPSX
Strings in Java
Hitesh-Java
 
PPT
Java basic
Sonam Sharma
 
PPTX
Introduction to java
Saba Ameer
 
PPTX
Presentation on Core java
mahir jain
 
Java: GUI
Tareq Hasan
 
Introduction to java (revised)
Sujit Majety
 
Basic Java Programming
Math-Circle
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Shravan Sanidhya
 
core java
Roushan Sinha
 
Oop java
Minal Maniar
 
Core java
Shubham singh
 
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
shamnasain
 
Java multi threading
Raja Sekhar
 
Advance Java Topics (J2EE)
slire
 
JavaScript - Chapter 15 - Debugging Techniques
WebStackAcademy
 
Control statements in java
Madishetty Prathibha
 
Java Basics
Sunil OS
 
Java Presentation For Syntax
PravinYalameli
 
Strings in Java
Hitesh-Java
 
Java basic
Sonam Sharma
 
Introduction to java
Saba Ameer
 
Presentation on Core java
mahir jain
 
Ad

Viewers also liked (20)

PPT
Building Web Hack Interfaces
Christian Heilmann
 
PPTX
Mkgirlsnightin2015 2
Marian Price
 
PPTX
(Open Hack Night Fall 2014) Hacking Tutorial
James Griffin
 
PPTX
Cara mendeface sebuah website
yogigreat
 
PPTX
Leadpreneur and discussion Global Top Leader Challenge
Reynaldo Rayne
 
PPTX
Why java is important in programming language?
NexSoftsys
 
PPTX
Risk assesment
samhoward2405
 
PDF
Panduan Instalasi Android Studio
Agus Haryanto
 
PDF
“Can we deface your Web in 10 mins?” - Edu 3.4
eLearning Consortium 電子學習聯盟
 
PDF
E-Gov Project Management Essentials
John Macasio
 
PDF
Let's Hack School: Learner Agency in a Time of New Technologies
budtheteacher
 
PPTX
what is security
Dedi Dwianto
 
PDF
Belajar Android Studio Material Design Penggunaan RecyclerView dan Card View
Agus Haryanto
 
PPTX
Vulnerability Assesment
Dedi Dwianto
 
PPTX
Teaching Materials & Student Progress Assesment
Azidah Abu Ziden
 
PDF
Android Sliding Menu dengan Navigation Drawer
Agus Haryanto
 
PPTX
Clinical Risk Assesment - Dr Harshavardhan Patwal
Dr Harshavardhan Patwal
 
PDF
Belajar Android Studio Memberi Efek animasi pada Button
Agus Haryanto
 
PDF
Kenalan Dengan Firebase Android
Agus Haryanto
 
Building Web Hack Interfaces
Christian Heilmann
 
Mkgirlsnightin2015 2
Marian Price
 
(Open Hack Night Fall 2014) Hacking Tutorial
James Griffin
 
Cara mendeface sebuah website
yogigreat
 
Leadpreneur and discussion Global Top Leader Challenge
Reynaldo Rayne
 
Why java is important in programming language?
NexSoftsys
 
Risk assesment
samhoward2405
 
Panduan Instalasi Android Studio
Agus Haryanto
 
“Can we deface your Web in 10 mins?” - Edu 3.4
eLearning Consortium 電子學習聯盟
 
E-Gov Project Management Essentials
John Macasio
 
Let's Hack School: Learner Agency in a Time of New Technologies
budtheteacher
 
what is security
Dedi Dwianto
 
Belajar Android Studio Material Design Penggunaan RecyclerView dan Card View
Agus Haryanto
 
Vulnerability Assesment
Dedi Dwianto
 
Teaching Materials & Student Progress Assesment
Azidah Abu Ziden
 
Android Sliding Menu dengan Navigation Drawer
Agus Haryanto
 
Clinical Risk Assesment - Dr Harshavardhan Patwal
Dr Harshavardhan Patwal
 
Belajar Android Studio Memberi Efek animasi pada Button
Agus Haryanto
 
Kenalan Dengan Firebase Android
Agus Haryanto
 
Ad

Similar to Java basic introduction (20)

PDF
Java Introduction | PDF
Geekster
 
PPTX
java basic for begginers
divaskrgupta007
 
PPTX
1 .java basic
Indu Sharma Bhardwaj
 
PPTX
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
netaji10700
 
PPTX
Basics of JAVA programming
Elizabeth Thomas
 
PDF
Java Concepts and Features-Programming in Java
jasminebeulahg
 
PPTX
Java session2
Jigarthacker
 
PDF
Introduction to Java Programming.pdf
AdiseshaK
 
PPTX
1_Introduction to Java.pptx java programming
amitraj53904
 
PPTX
Core java
sharad soni
 
PDF
Java Programming
Prof. Dr. K. Adisesha
 
PPTX
JAVAPart1_BasicIntroduction.pptx
Murugesh33
 
PPTX
JAVA_Day1_BasicIntroduction.pptx
Murugesh33
 
PDF
Java programming material for beginners by Nithin, VVCE, Mysuru
Nithin Kumar,VVCE, Mysuru
 
PPTX
OOP with Java
OmegaHub
 
DOCX
java introduction.docx
vikasbagra9887
 
PDF
Java programming Evolution-OverviewOfJava.pdf
AbhishekSingh961152
 
DOCX
Java and its features
Pydi Nikhil
 
Java Introduction | PDF
Geekster
 
java basic for begginers
divaskrgupta007
 
1 .java basic
Indu Sharma Bhardwaj
 
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
netaji10700
 
Basics of JAVA programming
Elizabeth Thomas
 
Java Concepts and Features-Programming in Java
jasminebeulahg
 
Java session2
Jigarthacker
 
Introduction to Java Programming.pdf
AdiseshaK
 
1_Introduction to Java.pptx java programming
amitraj53904
 
Core java
sharad soni
 
Java Programming
Prof. Dr. K. Adisesha
 
JAVAPart1_BasicIntroduction.pptx
Murugesh33
 
JAVA_Day1_BasicIntroduction.pptx
Murugesh33
 
Java programming material for beginners by Nithin, VVCE, Mysuru
Nithin Kumar,VVCE, Mysuru
 
OOP with Java
OmegaHub
 
java introduction.docx
vikasbagra9887
 
Java programming Evolution-OverviewOfJava.pdf
AbhishekSingh961152
 
Java and its features
Pydi Nikhil
 

Recently uploaded (20)

PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
Strengthening open access through collaboration: building connections with OP...
Jisc
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PDF
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
PDF
Landforms and landscapes data surprise preview
jpinnuck
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PDF
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PPTX
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
Congenital Hypothyroidism pptx
AneetaSharma15
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Strengthening open access through collaboration: building connections with OP...
Jisc
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
Landforms and landscapes data surprise preview
jpinnuck
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Congenital Hypothyroidism pptx
AneetaSharma15
 

Java basic introduction

  • 1. IDEAL EYES BUSINESS COLLEGE A PRESENTATION 1UPLOADED BY:- VIVEK KUMAR
  • 2. 2 DEVELOPER OF JAVA:- JAMES GOSLING
  • 3. 1991 1995 2009 1991 2010 2014 STIL..
  • 4. HISTORY OF JAVA  Java Is A Object Oriented Programming Language Developed By James Gosling In Year 1991.  Java, May 20, 1995, Sun World.  Originally Language Name Oak.  It Said To Be The Name Java Is Come From Several Individuals Involved In This Project James Gosling , Arthur , Van Goff And Andy Bechto Lsheim.  Name Changed To Java.
  • 5. HISTORY OF JAVA  Java is popular and powerful language.  The java language was derived from c++  Much of the syntax in java is similar to c and c++.  Java does not have pointer features.  Java supports WORA concept means write once, run anywhere.  First Public Release In 1995. 5
  • 6. HISTORY OF JAVA  Java is high level language that looks very similar to c and c++ but offers many unique features of its own. 6
  • 7. WHERE JAVA IS USED ? According to sun, 3 billions devices run on java. There are many devices where java is currently used some of them are as :- Desktops Web Mobile 7 Embedded system Smart card Robotics Games
  • 15. FEATURES OF JAVA  Java is simple  Java is object-oriented  Java is platform independent  Java is distributed  Java is interpreted  Java is robust 15
  • 16. FEATURES OF JAVA  Java is secure  Java is architecture-neutral  Java is portable  High performance  Java is multithreaded  Java is dynamic 16
  • 17. WHY JAVA IS SIMPLE ? 1. Syntax is based upon c++. 2. Removed many confusing and lorrarely used features (explicit pointer,operator overloding). 3. No need to remove unreferenced objects because there is automatic grabage collection in java. 17
  • 18. WHAT IS OBJECT ORIENTED? Object oriented means we organize our software as a combination of different types of object that incorporates both data and behavior. It is methodology that simplify software development and maintenance by providing some rules. We can do program with the help of object 18 iding
  • 19. BASIC CONCEPT OF OPPS Basic concept of OPPS are:- 1.Objects 2.Class 3.Inheritance 4.Abstraction 5.Encapsulation 6.Polymorphism 7.Data hiding 19
  • 20. WHY JAVA IS PLATFORM INDEPENDENT? What is platform? A platform is the hardware and software environment in which programs runs. Java is platform independent because its byte code can be run on multiple platforms. Like as:- windows, Linux, Unix, sun Solaris, Mac/OS etc. That is write onces and run anywhere (WORA). 20
  • 21. WHY JAVA IS MORE SECURED ? 1. Java is more secure because no explicit pointer use in java. 2. Programs run inside the virtual machine sandbox. 3. Class loader adds security by separating the package for the classes of the local file system from those that are imported from network sources. 4. Byte code verifier checks the code fragments for illegal code that can violate access right to object. 5. Some security can also provided by application developer through SSL, JAAS, cryptography etc. 21
  • 22. ROBUST Robust simply means error tolerance . java uses strong memory management . There are lack of pointer that avoids security problems. There is automatic garbage collection in java . There is exception handling and type checking mechanism in java. All these pointer makes java robust . 22
  • 23. ARCHITECTURAL NATURAL There is no implementation dependent features its means it is independent of any hardware configuration. 23 PORTABLE We may carry the java byte code to any platform very easily.
  • 24. HIGH PERFORMANCE Java is better and faster than traditional interpretation since byte code is “close” to native code still some what slower than a complied language like c++. 24
  • 25. DISTRIBUTED We can create distributed application in java. RMI and EJB are used for creating distributed application. We may access files by calling the methods from any machine on the internet. 25
  • 26. MULTITHEADED A Thread Is Like A Separate Program Executing, Concurrently. We Can Write java program that deal with many tasks at once by defining multiple threads. The main advantage of multithreading is that it shares the same memory. Threads are important for multimedia ,web application etc. 26
  • 27. CREATING “HELLO JAVA” PROGRAMMING EXAMPLE. Class simple{ public static void main(String args[]) { System.out.println(“hello java”); } } 27
  • 28. Save this file as simple.java. To compile javac simple.java To execution(run time) java simple Output hello java. 28
  • 29. CLASS The classis the essential Java construct. A class is a template or blueprint for objects. To program in Java, you must understand classes and be able to write and use them. The mystery of the class will continue to be unveiled throughout this book. For now, though, understand that a program is defined by using one or more classes. 29
  • 30. WHAT IS STATIC? Static is a keyword, if we declare any method (function) as static ,it is known as static method. The core advantage of static method is that there Is no need to create object to invoke the static method. The main method is executed by the JVM so it doesn’t require to create object to invoke the main method ,so it saves memory. 30 ct to
  • 31. VOID & STRING ARGS[] Void is the return type method (function) . It means it doesn’t return any values. Main represent startup of the program. String args[] is used command line argument. System.out.println() It is used for print the statement. 31
  • 32. HOW TO SET PATH OF JDK IN WINDOWS Path is required for using tools such as javac.java etc. if you are saving the java file in jdk/bin folder, path is not required but if you are having your java file outside the JDK/bin folder. It is necessary to set path JDK. There are two ways to set path of JDK. 1.Temporary 2.permanently 32
  • 33. SETTING OF TEMPORARY PATH For setting the temporary of JDK, you need to follow these steps:- 1.Open command prompt 2.Copy the path of bin folder 3.Write in command prompt 4. Set path= copied path c:programfilesjavajdk 1.7.0 25bin;.; 33
  • 34. JAVA PROGRAM public class testrrr { public static void main (String args[]) { for(int i=0,j=10;i<10;i++,j++) { System.out.println(i+" "+j); } } } 34
  • 36. 1. 36 1. public class classA 2. { 3. public int getValue() 4. { 5. int value=0; 6. boolean setting = false; 7. String title="hello"; 8. if(setting && title == "hello") 9. { 10. System.out.println("first if condition"); 11. return 1; 12. } 13. if(value == 1 && title.equals("hello")) 14. { 15. System.out.println("second if condition"); 16. return 2; 17. } 18. return 5; 19. } 20. public static void main(String args[]) 21. { 22. classA a= new classA(); 23. int y=a.getValue(); 24. System.out.println("value of y is"+y); 25. } 26. }
  • 38. 38 interface DeclareStuff { public static final int EASY =3; void doStuff(int t); } public class TestDeclare implements DeclareStuff { public static void main(String args[]) { int x = 5; new TestDeclare().doStuff(++x); } public void doStuff(int s) { s += EASY - ++s; System.out.println("s"+--s); } }
  • 40. 40 class c { public static void main (String args[]) { int x=9; if(x == 9) { int x=8; System.out.println(x); }
  • 42. 42 class A { A(){System.out.println("A class constructor");} {System.out.println("annonymous block in class A");} void display(){System.out.println("display in class A");} } class B extends A { B(){System.out.println("B class constructor");} {System.out.println("annonymous block in class B");} void display(){System.out.println("display in class B");} } class C extends B { C(){System.out.println("C class constructor");} class D extends C { D(){System.out.println("D class constructor");} {System.out.println("annonymous block in class D");} void display(){System.out.println("display in class D");} public static void main(String args[]) { C c1=new C(); c1.display(); } }
  • 44. 44 class jump_statments { public static void main(String args[]) { int x=2; int y=0; for(;y<10;++y) { if(y%x==0) continue; else if(y==8) break; else
  • 46. 46 class output_test { public static void main(String args[]) { int x,y=1; x=10; if (x!=10 && x/0 ==0) System.out.println(y); else System.out.println(++y);
  • 48. DON’T TRY TO LEARN JAVA JUST TRY TO LIVE IT.. THANK YOU 48

Editor's Notes

  • #4: First Class: Introduction, Prerequisites, Advices, Syllabus Lab 1: Create a Java Project, Compile, and Run. Show syntax errors Print program Capture screen shots, and save it in Word, and print it. Homework One: Check in the class randomly.