SlideShare une entreprise Scribd logo
1  sur  16
JECRC
FOUNDATION
INDUSTRIAL TRAINING ON
JAVA CORE PROGRAMMING LANGUAGE
PRESENTED BY :
NAME = Pranav Soni
RTU ROLL NO. = 21EJCCS172
BRANCH/SEMESTER/SECTION = Computer Science Engineering
/ Third Semester / C-2
SUBMITTED TO :
Mr. Sunil Sharma
Industrial Training Coordinator
(CSE Department)
Dr. Sanjay Gaur
(HOD CSE Department)
TOPICS :
• Brief intro to Java
• Develop and compile environment
• A simple example
• Intro to object/class
• Java basics
• Differences from C
INRO TO JAVA CORE PROGRAMMING :
• Java programming language
• The one we use to write our program
• Compiled to byte code of JVM
• Java virtual machine (JVM)
• Java interpreter – interpret the compiled byte code
• Software simulated CPU architecture
• Cross-platform: support Linux, Windows, etc.
• Java runtime environment (JRE)
• Predefined set of java classes available to use
• Core Java APIs – basic utilities, I/O, graphics, network
Java is portable :
• As long as there is a JVM compiled for that particular processor and OS
• Typical program, like C or C++, is compiled for a particular processor architecture and OS.
• “Write once, run everywhere!”
• Sun’s motto for Java
JAVA :
• java is an object-oriented language, with a syntax similar to C
• Structured around objects and methods
• A method is an action or something you do with the object
• Avoid those overly complicated features of C++:
• Operator overloading, pointer, templates, friend class, etc.
Getting and using java :
• J2SDK freely download from http://java.sun.com
• detailed instructions to help you run your first program :
• http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
• All text editors support java
• Vi/vim, emacs, notepad, word pad
• Just save to .java file
• Have IDEs that comparable to Visual Studio
• J Creator (simple)
• Eclipse (more complicated)
Compile and run an application :
• Write java class Foo containing a main() method and save in file “Foo.java”
• The file name MUST be the same as class name
• Compile with: javac Foo.java
• Creates compiled .class file: Foo.class
• Run the program: java Foo
• Notice: use the class name directly, no .class!
Hello World!
• /* Our first Java program – Hello.java */
• public class Hello {
• //main()
• public static void main ( String[] args )
• {
• System.out.println( "hello world!" );
• }
• }
File name: Hello.java
About class :
Fundamental unit of Java program =
• All java programs are classes
• Each class define a unique kind of object ( a new data type)
• Each class defines a set of fields, methods or other classes
• public: modifier. This class is publicly available and anyone can use it.
Things to notice :
• Java is case sensitive
• whitespace doesn’t matter for compilation
• File name must be the same as one of the class names, including capitalization!
• At most one public class per file
• If there is one public class in the file, the filename must be the same as it
• Generally one class per file
What is an object ?
• Object is a thing
• An object has state, behavior and identity
• Internal variable: store state
• Method: produce behavior
• Unique address in memory: identity
• An object is a manifestation of a class
What is class ?
• Class introduces a new data type
• A class describes a set of objects that have identical characteristics (data elements) and behaviors (methods).
• Existing classes provided by JRE
• User defined classes
• Once a class is established, you can make as many objects of it as you like, or none.
Simple example: class Person
• A Person has some attributes
• The class defines these properties for all people
• Each person gets his own copy of the fields
• Attributes = properties = fields
class ClassName{ /* class body goes here */ }
class: keyword
• class Person
• {
• String name;
• int height; //in inches
• int weight; //in pounds
• public void printInfo()
• {
• System.out.println(name+" with height="+height+", weight="+weight);
• }
• }
Class Person: definition
Presentation 1.pptx
Presentation 1.pptx

Contenu connexe

Similaire à Presentation 1.pptx (20)

Java01
Java01Java01
Java01
 
Java01
Java01Java01
Java01
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
Java Course — Mastering the Fundamentals
Java Course — Mastering the FundamentalsJava Course — Mastering the Fundamentals
Java Course — Mastering the Fundamentals
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
 
java-corporate-training-institute-in-mumbai
java-corporate-training-institute-in-mumbaijava-corporate-training-institute-in-mumbai
java-corporate-training-institute-in-mumbai
 
java-corporate-training-institute-in-mumbai
java-corporate-training-institute-in-mumbaijava-corporate-training-institute-in-mumbai
java-corporate-training-institute-in-mumbai
 
Java
JavaJava
Java
 
java01.pdf
java01.pdfjava01.pdf
java01.pdf
 
Java
JavaJava
Java
 
Java01
Java01Java01
Java01
 
Java01
Java01Java01
Java01
 
Java intro
Java introJava intro
Java intro
 
java01.ppt
java01.pptjava01.ppt
java01.ppt
 
java01.ppt
java01.pptjava01.ppt
java01.ppt
 
java01.ppt
java01.pptjava01.ppt
java01.ppt
 
java01.ppt
java01.pptjava01.ppt
java01.ppt
 
java01.ppt
java01.pptjava01.ppt
java01.ppt
 
mukul Dubey.pptx
mukul Dubey.pptxmukul Dubey.pptx
mukul Dubey.pptx
 

Dernier

Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 

Dernier (20)

Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 

Presentation 1.pptx

  • 1. JECRC FOUNDATION INDUSTRIAL TRAINING ON JAVA CORE PROGRAMMING LANGUAGE PRESENTED BY : NAME = Pranav Soni RTU ROLL NO. = 21EJCCS172 BRANCH/SEMESTER/SECTION = Computer Science Engineering / Third Semester / C-2 SUBMITTED TO : Mr. Sunil Sharma Industrial Training Coordinator (CSE Department) Dr. Sanjay Gaur (HOD CSE Department)
  • 2. TOPICS : • Brief intro to Java • Develop and compile environment • A simple example • Intro to object/class • Java basics • Differences from C
  • 3. INRO TO JAVA CORE PROGRAMMING : • Java programming language • The one we use to write our program • Compiled to byte code of JVM • Java virtual machine (JVM) • Java interpreter – interpret the compiled byte code • Software simulated CPU architecture • Cross-platform: support Linux, Windows, etc. • Java runtime environment (JRE) • Predefined set of java classes available to use • Core Java APIs – basic utilities, I/O, graphics, network
  • 4. Java is portable : • As long as there is a JVM compiled for that particular processor and OS • Typical program, like C or C++, is compiled for a particular processor architecture and OS. • “Write once, run everywhere!” • Sun’s motto for Java
  • 5. JAVA : • java is an object-oriented language, with a syntax similar to C • Structured around objects and methods • A method is an action or something you do with the object • Avoid those overly complicated features of C++: • Operator overloading, pointer, templates, friend class, etc.
  • 6. Getting and using java : • J2SDK freely download from http://java.sun.com • detailed instructions to help you run your first program : • http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html • All text editors support java • Vi/vim, emacs, notepad, word pad • Just save to .java file • Have IDEs that comparable to Visual Studio • J Creator (simple) • Eclipse (more complicated)
  • 7. Compile and run an application : • Write java class Foo containing a main() method and save in file “Foo.java” • The file name MUST be the same as class name • Compile with: javac Foo.java • Creates compiled .class file: Foo.class • Run the program: java Foo • Notice: use the class name directly, no .class!
  • 8. Hello World! • /* Our first Java program – Hello.java */ • public class Hello { • //main() • public static void main ( String[] args ) • { • System.out.println( "hello world!" ); • } • } File name: Hello.java
  • 9. About class : Fundamental unit of Java program = • All java programs are classes • Each class define a unique kind of object ( a new data type) • Each class defines a set of fields, methods or other classes • public: modifier. This class is publicly available and anyone can use it.
  • 10. Things to notice : • Java is case sensitive • whitespace doesn’t matter for compilation • File name must be the same as one of the class names, including capitalization! • At most one public class per file • If there is one public class in the file, the filename must be the same as it • Generally one class per file
  • 11. What is an object ? • Object is a thing • An object has state, behavior and identity • Internal variable: store state • Method: produce behavior • Unique address in memory: identity • An object is a manifestation of a class
  • 12. What is class ? • Class introduces a new data type • A class describes a set of objects that have identical characteristics (data elements) and behaviors (methods). • Existing classes provided by JRE • User defined classes • Once a class is established, you can make as many objects of it as you like, or none.
  • 13. Simple example: class Person • A Person has some attributes • The class defines these properties for all people • Each person gets his own copy of the fields • Attributes = properties = fields
  • 14. class ClassName{ /* class body goes here */ } class: keyword • class Person • { • String name; • int height; //in inches • int weight; //in pounds • public void printInfo() • { • System.out.println(name+" with height="+height+", weight="+weight); • } • } Class Person: definition