SlideShare a Scribd company logo
java basic for begginers
contents 
History Of Java 
Java Versions 
What is Java 
Java Features 
Simple java program 
Understanding first java program 
How to set path of JDK in windows 
Variable 
Package
History of java 
James Gosling initiated the Java language project in June 1991. 
Firstly, it was called "Greentalk" by James Gosling and file extension was .gt. 
After that, it was called Oak and was developed as a part of the Green project. 
 Why Oak? Oak is a symbol of strength and chosen as a national tree of many countries like U.S.A., 
France, Germany, Romania etc. 
In 1995, Oak was renamed as "Java" because it was already a trademark by Oak Technologies.
Java Versions 
There are many java versions like as:: 
1. JDK Alpha and Beta (1995) 
2. JDK 1.0 (23rd Jan, 1996) 
3. JDK 1.1 (19th Feb, 1997) 
4. J2SE 1.2 (8th Dec, 1998) 
5. J2SE 1.3 (8th May, 2000) 
6. J2SE 1.4 (6th Feb, 2002) 
7. J2SE 5.0 (30th Sep, 2004) 
8. Java SE 6 (11th Dec, 2006) 
9. Java SE 7 (28th July, 2011)
What is java 
Java is a programming language and a platform independent language. 
Platform :-Any hardware or software environment in which a program runs, known 
as a platform. Since Java has its own Runtime Environment (JRE) and API, it is called 
platform 
According to Sun, 3 billion devices run java. There are many devices where java is 
currently used. Some of them are as follows: 
1. Desktop Applications such as acrobat reader, media player, antivirus etc. 
2. Web Applications such as irctc.co.in, javatpoint.com etc. 
3. Enterprise Applications such as banking applications. 
4. Mobile 
5. Embedded System 
6. Smart Card 
7. Robotics 
8. Games etc.
Features of java 
 Simple 
 Object-oriented 
 Platform indepented 
 Secured 
 Portable 
 Dynamic 
 High performance 
 Multithreaded
simple 
According to sun, Java language is simple . 
Syntax is based on C++ (so easier for programmers to learn it 
after C++). 
Removed many confusing and/or rarely-used features e.g., 
explicit pointers, operator overloading etc. 
No need to remove unreferenced objects because there is 
Automatic Garbage Collection in java.
Object-oriented 
Object-oriented programming(OOPs) is a methodology that 
simplify software development and maintenance by providing 
some rules. 
We can do program with the help of object. 
Basic concepts of OOPs are: 
1.Object 
2.Class 
3.Inheritance 
4.Polymorphism 
5.Abstraction 
6.Encapsulation
Platform indepented 
 A platform is the hardware or software environment in which a 
program runs. 
 There are two types of platforms, software-based and hardware-based. 
 Java provides software-based platform. 
.class 
jvm 
Windows os 
Linux os 
MAC os 
 JVM:- java virtual machine 
 .class:- byte code
secured 
Java is secured because: 
•No explicit pointer & operator overloading. 
•Programs run inside virtual machine sandbox. 
multithreaded 
Multithreaded means handling multiple tasks simultaneously. 
Java supports multithreaded programs. This means that we need not wait for the 
application to finish one task before beginning another.
portable 
 Java is portable because we can move the bytecode to any platform as well as 
run successfully.
Simple java program 
class Simple{ 
public static void main(String args[]){ 
System.out.println(“Amlendu kumar Dubey") 
} 
} 
save this file as Simple.java 
Run Program 
To compile: javac Simple.java 
To execute: java Simple 
Output:- Amlendu kumar Dubey
Understanding first java program 
 class is used to declare a class in java. 
 public is an access modifier which represents visibility, it means it is visible to 
all. 
 static is a keyword, if we declare any method 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. 
 void is the return type of the method, it means it doesn't return any value. 
 main represents start-up of the program. 
 String[] args is used for command line argument. 
 System.out.println() is used print statement.
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 of JDK. 
 There are two ways to set path of JDK: 
1. temporary 
2. permanent 
1)Setting temporary Path of JDK in Windows: 
For setting the temporary path of JDK, you need to follow these steps: 
•Open command prompt 
•copy the path of bin folder 
•write in command prompt: set path=copiedpath
How to set path of JDK in windows 
2.)Setting Permanent Path of JDK in Windows: 
For setting the permanent path of JDK, you need to follow these steps: 
Go to MyComputer properties -> advanced tab -> environment variables 
-> new tab of user variable -> write path in variable name -> write path 
of bin folder in variable value -> ok -> ok -> ok
Variable 
 Variable is a name of memory location. 
 There are three types of variables: 
 local, instance and static.
Variable 
local variable :- A variable that is declared inside the method is called 
local variable. 
Instance variable:-A variable that is declared inside the class but outside 
the method is called instance variable . It is not declared as static. 
Static variable:-A variable that is declared as static is called static 
variable. It cannot be local.
Example of variable 
class variable 
{ 
int x; //Instance variable 
static int y; //Static variable 
void sum() // Non Static method 
{ 
int x=5; // local variable 
} 
public static void main(String args[]) // Static 
method 
{ 
System.out.println("Example of variable"); 
} 
} 
Run Program
Package 
A package is a group of similar types of classes, interfaces and sub-packages. 
More importantly, it helps improve re-usability . 
 Package is used to categorize the classes and interfaces so that they 
can be easily maintained. 
 Package provids access protection. 
 Package removes naming collision.
Example of package:: 
package p1; 
class c1 
{ 
public void m1() 
{ 
System.out.println("method m1 of class c1"); 
} 
public static void main(String arg[]) 
{ 
c1 obj=new c1(); 
obj.m1(); 
} 
} 
Save the file as : demo.java 
To Compile: javac -d . demo.java 
To Run: java p1.c1
java basic for begginers

More Related Content

PPTX
Lecture - 1 introduction to java
PPT
java packages
PPT
Java intro
PPTX
Lecture - 2 Environment setup & JDK, JRE, JVM
PPTX
Packages in java
PPS
Packages and inbuilt classes of java
PPTX
Unit1 introduction to Java
PPT
Basics of java programming language
Lecture - 1 introduction to java
java packages
Java intro
Lecture - 2 Environment setup & JDK, JRE, JVM
Packages in java
Packages and inbuilt classes of java
Unit1 introduction to Java
Basics of java programming language

What's hot (20)

PPT
Java API, Exceptions and IO
PPTX
Packages,static,this keyword in java
PPTX
Java program structure
PDF
Introduction to Java
PDF
Packages access protection, importing packages
PPTX
Core java1
PPT
Java basic
PPT
PPTX
Core Java introduction | Basics | free course
PDF
Core Java Tutorial
PPT
Java package
PPTX
Packages
PPTX
Java packages
PPTX
Core java
PDF
Java Programming - 01 intro to java
PDF
Basic Java Programming
PPT
Fundamentals of oop lecture 2
PPS
Interface
PDF
Core Java Introduction | Basics
PPTX
1_JavIntro
Java API, Exceptions and IO
Packages,static,this keyword in java
Java program structure
Introduction to Java
Packages access protection, importing packages
Core java1
Java basic
Core Java introduction | Basics | free course
Core Java Tutorial
Java package
Packages
Java packages
Core java
Java Programming - 01 intro to java
Basic Java Programming
Fundamentals of oop lecture 2
Interface
Core Java Introduction | Basics
1_JavIntro
Ad

Viewers also liked (20)

PDF
Iui treatment
PDF
Youth view at quarry nature by Tatiana Trofimova (Russia)
PDF
BEST OF FRANCE 2015 - INSTIT - MEDIA - US
PPTX
POWERPOINT PRESENTATION
PDF
Maina_aGST in ALF_2016
PDF
Serious SEM's Reputation Amplifier
PDF
INNOVATIVE LESSON TEMPLATE
DOCX
бриф Reklamamigom
DOC
Bbc risk-assessment
PDF
"A comprehensive inventory of herpetofauna of the Limestone Quarry "Górażdże"...
PDF
Rehabilitation of topsoil in production-induced landscapes, Kazakhstan
PDF
CV .bssam khamis mohammed
PDF
INNOVATIVE LESSON PLAN
PPT
DRETS I DEURES
PPT
Museo comunale Vincenzo Passarello
PDF
ONLINE ASSIGNMENT
PDF
Designing a Geo-Ecology and Education nature trail by Florian Hopp (North Ame...
PPT
English Glossary
PDF
Script
PPTX
Smile mobile 2015
Iui treatment
Youth view at quarry nature by Tatiana Trofimova (Russia)
BEST OF FRANCE 2015 - INSTIT - MEDIA - US
POWERPOINT PRESENTATION
Maina_aGST in ALF_2016
Serious SEM's Reputation Amplifier
INNOVATIVE LESSON TEMPLATE
бриф Reklamamigom
Bbc risk-assessment
"A comprehensive inventory of herpetofauna of the Limestone Quarry "Górażdże"...
Rehabilitation of topsoil in production-induced landscapes, Kazakhstan
CV .bssam khamis mohammed
INNOVATIVE LESSON PLAN
DRETS I DEURES
Museo comunale Vincenzo Passarello
ONLINE ASSIGNMENT
Designing a Geo-Ecology and Education nature trail by Florian Hopp (North Ame...
English Glossary
Script
Smile mobile 2015
Ad

Similar to java basic for begginers (20)

PPTX
1.introduction to java
PPTX
UNIT 1.pptx
PPTX
1 .java basic
PDF
Java programming material for beginners by Nithin, VVCE, Mysuru
PPTX
Chapter 2.1
PPT
Java basic introduction
PPTX
Java Programming concept
PPTX
PPTX
OOP with Java
PPT
Introduction to Java Programming, Basic Structure, variables Data type, input...
PPT
Object Oriented Programming-JAVA
PDF
Java programming basics
PPT
Javalecture 1
PPTX
JAVA ALL 5 MODULE NOTES.pptx
PPT
Introduction
PPTX
Unit 1 – Introduction to Java- (Shilpa R).pptx
PDF
java notes.pdf
PPTX
brief introduction to core java programming.pptx
PPT
Java basics
1.introduction to java
UNIT 1.pptx
1 .java basic
Java programming material for beginners by Nithin, VVCE, Mysuru
Chapter 2.1
Java basic introduction
Java Programming concept
OOP with Java
Introduction to Java Programming, Basic Structure, variables Data type, input...
Object Oriented Programming-JAVA
Java programming basics
Javalecture 1
JAVA ALL 5 MODULE NOTES.pptx
Introduction
Unit 1 – Introduction to Java- (Shilpa R).pptx
java notes.pdf
brief introduction to core java programming.pptx
Java basics

Recently uploaded (20)

PPTX
Sustainable Sites - Green Building Construction
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
web development for engineering and engineering
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PPTX
Practice Questions on recent development part 1.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPT
Project quality management in manufacturing
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Road Safety tips for School Kids by a k maurya.pptx
PDF
Queuing formulas to evaluate throughputs and servers
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
composite construction of structures.pdf
PPT
Drone Technology Electronics components_1
Sustainable Sites - Green Building Construction
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
web development for engineering and engineering
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
Practice Questions on recent development part 1.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Embodied AI: Ushering in the Next Era of Intelligent Systems
Project quality management in manufacturing
Lesson 3_Tessellation.pptx finite Mathematics
Road Safety tips for School Kids by a k maurya.pptx
Queuing formulas to evaluate throughputs and servers
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Internet of Things (IOT) - A guide to understanding
Arduino robotics embedded978-1-4302-3184-4.pdf
composite construction of structures.pdf
Drone Technology Electronics components_1

java basic for begginers

  • 2. contents History Of Java Java Versions What is Java Java Features Simple java program Understanding first java program How to set path of JDK in windows Variable Package
  • 3. History of java James Gosling initiated the Java language project in June 1991. Firstly, it was called "Greentalk" by James Gosling and file extension was .gt. After that, it was called Oak and was developed as a part of the Green project.  Why Oak? Oak is a symbol of strength and chosen as a national tree of many countries like U.S.A., France, Germany, Romania etc. In 1995, Oak was renamed as "Java" because it was already a trademark by Oak Technologies.
  • 4. Java Versions There are many java versions like as:: 1. JDK Alpha and Beta (1995) 2. JDK 1.0 (23rd Jan, 1996) 3. JDK 1.1 (19th Feb, 1997) 4. J2SE 1.2 (8th Dec, 1998) 5. J2SE 1.3 (8th May, 2000) 6. J2SE 1.4 (6th Feb, 2002) 7. J2SE 5.0 (30th Sep, 2004) 8. Java SE 6 (11th Dec, 2006) 9. Java SE 7 (28th July, 2011)
  • 5. What is java Java is a programming language and a platform independent language. Platform :-Any hardware or software environment in which a program runs, known as a platform. Since Java has its own Runtime Environment (JRE) and API, it is called platform According to Sun, 3 billion devices run java. There are many devices where java is currently used. Some of them are as follows: 1. Desktop Applications such as acrobat reader, media player, antivirus etc. 2. Web Applications such as irctc.co.in, javatpoint.com etc. 3. Enterprise Applications such as banking applications. 4. Mobile 5. Embedded System 6. Smart Card 7. Robotics 8. Games etc.
  • 6. Features of java  Simple  Object-oriented  Platform indepented  Secured  Portable  Dynamic  High performance  Multithreaded
  • 7. simple According to sun, Java language is simple . Syntax is based on C++ (so easier for programmers to learn it after C++). Removed many confusing and/or rarely-used features e.g., explicit pointers, operator overloading etc. No need to remove unreferenced objects because there is Automatic Garbage Collection in java.
  • 8. Object-oriented Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance by providing some rules. We can do program with the help of object. Basic concepts of OOPs are: 1.Object 2.Class 3.Inheritance 4.Polymorphism 5.Abstraction 6.Encapsulation
  • 9. Platform indepented  A platform is the hardware or software environment in which a program runs.  There are two types of platforms, software-based and hardware-based.  Java provides software-based platform. .class jvm Windows os Linux os MAC os  JVM:- java virtual machine  .class:- byte code
  • 10. secured Java is secured because: •No explicit pointer & operator overloading. •Programs run inside virtual machine sandbox. multithreaded Multithreaded means handling multiple tasks simultaneously. Java supports multithreaded programs. This means that we need not wait for the application to finish one task before beginning another.
  • 11. portable  Java is portable because we can move the bytecode to any platform as well as run successfully.
  • 12. Simple java program class Simple{ public static void main(String args[]){ System.out.println(“Amlendu kumar Dubey") } } save this file as Simple.java Run Program To compile: javac Simple.java To execute: java Simple Output:- Amlendu kumar Dubey
  • 13. Understanding first java program  class is used to declare a class in java.  public is an access modifier which represents visibility, it means it is visible to all.  static is a keyword, if we declare any method 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.  void is the return type of the method, it means it doesn't return any value.  main represents start-up of the program.  String[] args is used for command line argument.  System.out.println() is used print statement.
  • 14. 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 of JDK.  There are two ways to set path of JDK: 1. temporary 2. permanent 1)Setting temporary Path of JDK in Windows: For setting the temporary path of JDK, you need to follow these steps: •Open command prompt •copy the path of bin folder •write in command prompt: set path=copiedpath
  • 15. How to set path of JDK in windows 2.)Setting Permanent Path of JDK in Windows: For setting the permanent path of JDK, you need to follow these steps: Go to MyComputer properties -> advanced tab -> environment variables -> new tab of user variable -> write path in variable name -> write path of bin folder in variable value -> ok -> ok -> ok
  • 16. Variable  Variable is a name of memory location.  There are three types of variables:  local, instance and static.
  • 17. Variable local variable :- A variable that is declared inside the method is called local variable. Instance variable:-A variable that is declared inside the class but outside the method is called instance variable . It is not declared as static. Static variable:-A variable that is declared as static is called static variable. It cannot be local.
  • 18. Example of variable class variable { int x; //Instance variable static int y; //Static variable void sum() // Non Static method { int x=5; // local variable } public static void main(String args[]) // Static method { System.out.println("Example of variable"); } } Run Program
  • 19. Package A package is a group of similar types of classes, interfaces and sub-packages. More importantly, it helps improve re-usability .  Package is used to categorize the classes and interfaces so that they can be easily maintained.  Package provids access protection.  Package removes naming collision.
  • 20. Example of package:: package p1; class c1 { public void m1() { System.out.println("method m1 of class c1"); } public static void main(String arg[]) { c1 obj=new c1(); obj.m1(); } } Save the file as : demo.java To Compile: javac -d . demo.java To Run: java p1.c1