SlideShare a Scribd company logo
1 of 16
PRESENTED BY:
RISHABH GUPTA
BTECH(CSE-D)
ROLLNO:27
•www.edx.org
•Start Date:-January 16 2018
•End Date:-April 1 2018
CONTENTS
INTRODUCTION
Difference between JAVA & C
Data types in Java
Control Statements
Conclusion
 Program
Loops
What is Java?
A most popular programming language
developed by James Gosling
Object Oriented
A simple, object oriented, distributed, interpreted,
robust, secure, WORA(Write Once Run Anywhere),
portable, high performance, multithreaded, dynamic
language.
Some History
 1993 Oak project at Sun
 small, robust, architecture independent, Object-Oriented, language to
control interactive TV.
 didn’t go anywhere
 1995 Oak becomes Java
 Focus on the web
 1996 Java 1.0 available
 1997 (March) Java 1.1 - some language changes, much larger library, new
event handling model
 1997 (September) Java 1.2 beta – huge increase in libraries including
Swing, new collection classes, J2EE
 1998 (October) Java 1.2 final (Java2!)
 2000 (April) Java 1.3 final
 2001 Java 1.4 final (assert)
 2004 Java 1.5 (parameterized types, enum, …) (Java5!)
 2005 J2EE 1.5
Features of Java
Simple
Architecture-neutral
Object-Oriented
Distributed
Compiled
Interpreted
Multi-Threaded
Garbage Collected
Portable
High-Performance
Robust
Secure
Extensible
Well-Understood
Difference between JAVA & C
JAVA is Object-Oriented while C is procedural. Different Paradigms,
that is.
 Java is an Interpreted language while C is a compiled language.
 C is a low-level language while JAVA is a high-level language.
 C uses the top-down {sharp & smooth} approach while JAVA uses
the bottom-up {on the rocks} approach.
 Pointer go backstage in JAVA while C requires explicit handling of
pointers.
 JAVA supports Method Overloading while C does not support
overloading at all.
Unlike C, JAVA does not support Preprocessors, & does not really
them.
Data types
There are eight basic data types in JAVA :
 char – to store a character(1 byte).
 int – to store an integer value(4 bytes).
 float – to store a floating point number(4 bytes).
 double –to store a double precision floating point
number(8 bytes).
 Long
 Short
if
if statement:
Executes a set of commands only if a certain condition is true.
Otherwise, the commands are skipped.
Syntax:
if(condition)
{
statements
}
Example:
if(age>=18)
System.out.println(“You can vote”);
if/else
if/else statement:
Executes one set of statements if a certain condition is True, and a second
set if it is False.
Syntax:
if(condition)
statements;
else
statements;
Example:
if (a < 10)
System.out.println(“a is less than 10n”);
else if (a == 10)
System.out.println(“a is 10n”);
else
System.out.println(“a is greater than 10n”);
Switch
int c = 10;
switch (c)
{
case 0:
printf(“c is 0n”);
break;
……
default:
printf(“Unknown value of cn”);
break;
}
for loops
 It executes a particular set of statements specified number of times.
 Depending on the language mode, you may not be able to declare variable inside
a for-loop definition:
Syntax:
declaration
for(initialisation;condition;updation)
statements;
Example:
int i;
for (i = 0; i < 10; i++)
{
printf(“%d n”, i);
}
PROGRAM
# Program to print “Hello World”.
class World
{
public static void main(String[]args)
{
System.out.println(“Hello, Worldn");
}}
Java basics

More Related Content

Similar to Java basics

Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel Fomitescu
 
Knowledge of Javascript
Knowledge of JavascriptKnowledge of Javascript
Knowledge of JavascriptSamuel Abraham
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsMiles Sabin
 
DevNexus 2018: Learn Java 8, lambdas and functional programming
DevNexus 2018: Learn Java 8, lambdas and functional programmingDevNexus 2018: Learn Java 8, lambdas and functional programming
DevNexus 2018: Learn Java 8, lambdas and functional programmingHenri Tremblay
 
Future Programming Language
Future Programming LanguageFuture Programming Language
Future Programming LanguageYLTO
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongPROIDEA
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Sandeep Rawat
 
Java Intro
Java IntroJava Intro
Java Introbackdoor
 

Similar to Java basics (20)

java slides
java slidesjava slides
java slides
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016
 
Scala Introduction
Scala IntroductionScala Introduction
Scala Introduction
 
Knowledge of Javascript
Knowledge of JavascriptKnowledge of Javascript
Knowledge of Javascript
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
 
Stay fresh
Stay freshStay fresh
Stay fresh
 
DevNexus 2018: Learn Java 8, lambdas and functional programming
DevNexus 2018: Learn Java 8, lambdas and functional programmingDevNexus 2018: Learn Java 8, lambdas and functional programming
DevNexus 2018: Learn Java 8, lambdas and functional programming
 
Javascript
JavascriptJavascript
Javascript
 
Future Programming Language
Future Programming LanguageFuture Programming Language
Future Programming Language
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
 
Java
JavaJava
Java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Java basic
Java basicJava basic
Java basic
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Java Intro
Java IntroJava Intro
Java Intro
 
Java Programming - 01 intro to java
Java Programming - 01 intro to javaJava Programming - 01 intro to java
Java Programming - 01 intro to java
 
Core java
Core javaCore java
Core java
 
Java Notes .pdf
Java Notes .pdfJava Notes .pdf
Java Notes .pdf
 
Tech Days 2010
Tech  Days 2010Tech  Days 2010
Tech Days 2010
 
Java &amp; advanced java
Java &amp; advanced javaJava &amp; advanced java
Java &amp; advanced java
 

Recently uploaded

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 

Java basics

  • 2. •www.edx.org •Start Date:-January 16 2018 •End Date:-April 1 2018
  • 3. CONTENTS INTRODUCTION Difference between JAVA & C Data types in Java Control Statements Conclusion  Program Loops
  • 4. What is Java? A most popular programming language developed by James Gosling Object Oriented A simple, object oriented, distributed, interpreted, robust, secure, WORA(Write Once Run Anywhere), portable, high performance, multithreaded, dynamic language.
  • 5. Some History  1993 Oak project at Sun  small, robust, architecture independent, Object-Oriented, language to control interactive TV.  didn’t go anywhere  1995 Oak becomes Java  Focus on the web  1996 Java 1.0 available  1997 (March) Java 1.1 - some language changes, much larger library, new event handling model  1997 (September) Java 1.2 beta – huge increase in libraries including Swing, new collection classes, J2EE  1998 (October) Java 1.2 final (Java2!)  2000 (April) Java 1.3 final  2001 Java 1.4 final (assert)  2004 Java 1.5 (parameterized types, enum, …) (Java5!)  2005 J2EE 1.5
  • 6. Features of Java Simple Architecture-neutral Object-Oriented Distributed Compiled Interpreted Multi-Threaded Garbage Collected Portable High-Performance Robust Secure Extensible Well-Understood
  • 7. Difference between JAVA & C JAVA is Object-Oriented while C is procedural. Different Paradigms, that is.  Java is an Interpreted language while C is a compiled language.  C is a low-level language while JAVA is a high-level language.  C uses the top-down {sharp & smooth} approach while JAVA uses the bottom-up {on the rocks} approach.  Pointer go backstage in JAVA while C requires explicit handling of pointers.  JAVA supports Method Overloading while C does not support overloading at all. Unlike C, JAVA does not support Preprocessors, & does not really them.
  • 8. Data types There are eight basic data types in JAVA :  char – to store a character(1 byte).  int – to store an integer value(4 bytes).  float – to store a floating point number(4 bytes).  double –to store a double precision floating point number(8 bytes).  Long  Short
  • 9.
  • 10. if if statement: Executes a set of commands only if a certain condition is true. Otherwise, the commands are skipped. Syntax: if(condition) { statements } Example: if(age>=18) System.out.println(“You can vote”);
  • 11. if/else if/else statement: Executes one set of statements if a certain condition is True, and a second set if it is False. Syntax: if(condition) statements; else statements; Example: if (a < 10) System.out.println(“a is less than 10n”); else if (a == 10) System.out.println(“a is 10n”); else System.out.println(“a is greater than 10n”);
  • 12. Switch int c = 10; switch (c) { case 0: printf(“c is 0n”); break; …… default: printf(“Unknown value of cn”); break; }
  • 13.
  • 14. for loops  It executes a particular set of statements specified number of times.  Depending on the language mode, you may not be able to declare variable inside a for-loop definition: Syntax: declaration for(initialisation;condition;updation) statements; Example: int i; for (i = 0; i < 10; i++) { printf(“%d n”, i); }
  • 15. PROGRAM # Program to print “Hello World”. class World { public static void main(String[]args) { System.out.println(“Hello, Worldn"); }}