SlideShare une entreprise Scribd logo
1  sur  19
“Java” – for a beginner

           By:
    Biswadip Goswami



       (c) Biswadip Goswami, biswadip_g@hotmail.com
What are we going to venture !
•   The Platform.
•   Java Virtual Machine.
•   The Programming Environment.
•   Some fundamentals (datatypes etc.).
•   Structure of a Java Program.
•   Mistakes we make while writing the code.



                   (c) Biswadip Goswami, biswadip_g@hotmail.com
The platform
Java is a whole platform !
Huge library
Lots of reusable code
Execution environment providing services as
• Security
• Portability
• Automatic garbage collection and more

                 (c) Biswadip Goswami, biswadip_g@hotmail.com
The Virtual Machine
JVM or Java Virtual Machine.
• Platform independent execution environment
• Convert ByteCode to machine code
• Mimics a real Java processor
• The ByteCode is executed regardless of the
  Operating System
• A ByteCode stream: 03 3b
   – The mnemonics
      • iconst_0 // 03
      • istore_0 // 3b
                  (c) Biswadip Goswami, biswadip_g@hotmail.com
JVM and Garbage Collection:
JVM stores all objects by the java applications and
Garbage Collection is a process of automatically
freeing those objects which are not referenced by
the program any more.
Garbage collector also stops heap fragmentation.



                   (c) Biswadip Goswami, biswadip_g@hotmail.com
Some IDEs Available:
• NetBeans [http://www.netbeans.org]
• Eclipse [http://www.eclipse.org]
• JBuilder 7
  [http://www.borland.com/jbuilder]
• Oracle9i JDeveloper
  [http://www.oracle.com/ip/develop/ids/]



                (c) Biswadip Goswami, biswadip_g@hotmail.com
JARGONS !
•   JDK – Java development kit
•   JRE – Java runtime environment
•   SE – Standard Edition
•   EE – Enterprise edition
•   ME – Micro edition
•   J2 – Java 2
•   SDK – Software development kit
•   Netbeans – there is no acronym sorry !
                    (c) Biswadip Goswami, biswadip_g@hotmail.com
The Programming Environment !




          (c) Biswadip Goswami, biswadip_g@hotmail.com
First Program !




   (c) Biswadip Goswami, biswadip_g@hotmail.com
(c) Biswadip Goswami, biswadip_g@hotmail.com
Using Comments




   (c) Biswadip Goswami, biswadip_g@hotmail.com
Data Types
• Java is a strongly typed language
• Eight primitive types in Java
• Integer types
  – int (4bytes)
  – Short (2bytes)
  – Long (8bytes)
  – Byte (1byte)
• Floating point type
  – Float (4bytes)
  – Double (8bytes) (c) Biswadip Goswami,   biswadip_g@hotmail.com
• Char type – used to describe individual
  characters. E.g. - b (backspace), t (tab)
• Boolean type – it has two values ‘true’ and
  ‘false’.
• After declaring a variable, it must be
  explicitly initialized. E.g. int days=30;
• In java declaration can be done anywhere in
  the code. E.g. for(int x;x<=10;x++);

                 (c) Biswadip Goswami, biswadip_g@hotmail.com
Example




(c) Biswadip Goswami, biswadip_g@hotmail.com
Input/Output
Lets check out an example for output –




                    (c) Biswadip Goswami, biswadip_g@hotmail.com
•   Console input and output in Java.
•   Standard output stream (System.out.println)
•   Standard input stream (System.in)
•   Methods of Scanner class reads inputs.
       • Scanner(System.in)
• nextLine method – input with space
• next method – input single string

                       (c) Biswadip Goswami, biswadip_g@hotmail.com
The Structure:
Any simple java program looks like
<access-specifier> class <class-name>
{
<access-specifier> static void main(varargs)
{
variables;
functions;
}
}
                     (c) Biswadip Goswami, biswadip_g@hotmail.com
Troubleshooting:
• Check for upper and lower case of class name and
  .java program name.
• Bad command or file name - check for installation
• Cannot read: xyz.java – check for the file in the
  current directory
• Error about new language construct – check for the
  latest version of JDK
• Cannot find the symbol – check for the
  name/keywork/identifier
• Using an IDE generally saves you from setting of the
  CLASSPath.
                    (c) Biswadip Goswami, biswadip_g@hotmail.com
Thank you !
For assistance with your ASP.Net or JAVA
  requirements contact:
               Biswadip Goswami
Primary e-mail: biswadip_g@hotmail.com
Alt e-mail: biswadip@cognobytes.com
Webpage:
  http://people.cognobytes.com/biswadip
Skype me at biswadip.g
                 (c) Biswadip Goswami, biswadip_g@hotmail.com

Contenu connexe

Tendances (20)

Core java
Core javaCore java
Core java
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Basic java tutorial
Basic java tutorialBasic java tutorial
Basic java tutorial
 
Java introduction
Java introductionJava introduction
Java introduction
 
Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
Java training in delhi
Java training in delhiJava training in delhi
Java training in delhi
 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
 
Presentation on java
Presentation  on  javaPresentation  on  java
Presentation on java
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Java - OOPS and Java Basics
Java - OOPS and Java BasicsJava - OOPS and Java Basics
Java - OOPS and Java Basics
 
Basics of java
Basics of javaBasics of java
Basics of java
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
 
Java basic
Java basicJava basic
Java basic
 
Core java
Core java Core java
Core java
 
Java basic introduction
Java basic introductionJava basic introduction
Java basic introduction
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
 

En vedette

En vedette (12)

Media evaluation question 5
Media evaluation question 5Media evaluation question 5
Media evaluation question 5
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?NUS Hackers Club Mar 21 - Whats New in JavaSE 8?
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
Java presentation
Java presentation Java presentation
Java presentation
 
Java seminar
Java seminarJava seminar
Java seminar
 
Intro to java
Intro to javaIntro to java
Intro to java
 
Java ppt Gandhi Ravi (gandhiri@gmail.com)
Java ppt  Gandhi Ravi  (gandhiri@gmail.com)Java ppt  Gandhi Ravi  (gandhiri@gmail.com)
Java ppt Gandhi Ravi (gandhiri@gmail.com)
 
Part3
Part3Part3
Part3
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 

Similaire à Java for the Beginners

JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesCharles Nutter
 
How the HotSpot and Graal JVMs execute Java Code
How the HotSpot and Graal JVMs execute Java CodeHow the HotSpot and Graal JVMs execute Java Code
How the HotSpot and Graal JVMs execute Java CodeJim Gough
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaCharles Nutter
 
Down the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandDown the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandCharles Nutter
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5David Voyles
 
Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Kenneth Geisshirt
 
Hacking Java @JavaLand2016
Hacking Java @JavaLand2016Hacking Java @JavaLand2016
Hacking Java @JavaLand2016Sean P. Floyd
 
Golang workshop - Mindbowser
Golang workshop - MindbowserGolang workshop - Mindbowser
Golang workshop - MindbowserMindbowser Inc
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Ryan Cuprak
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
Jinx - Malware 2.0
Jinx - Malware 2.0Jinx - Malware 2.0
Jinx - Malware 2.0Itzik Kotler
 
Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Anton Arhipov
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVMJung Kim
 
Web (dis)assembly
Web (dis)assemblyWeb (dis)assembly
Web (dis)assemblyShakacon
 
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleIstanbul Tech Talks
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Felix Geisendörfer
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsQUONTRASOLUTIONS
 

Similaire à Java for the Beginners (20)

JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
 
How the HotSpot and Graal JVMs execute Java Code
How the HotSpot and Graal JVMs execute Java CodeHow the HotSpot and Graal JVMs execute Java Code
How the HotSpot and Graal JVMs execute Java Code
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
Down the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandDown the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM Wonderland
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
 
Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++
 
Hacking Java @JavaLand2016
Hacking Java @JavaLand2016Hacking Java @JavaLand2016
Hacking Java @JavaLand2016
 
Golang workshop - Mindbowser
Golang workshop - MindbowserGolang workshop - Mindbowser
Golang workshop - Mindbowser
 
Unit 1
Unit 1Unit 1
Unit 1
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
Jinx - Malware 2.0
Jinx - Malware 2.0Jinx - Malware 2.0
Jinx - Malware 2.0
 
Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012
 
01 java intro
01 java intro01 java intro
01 java intro
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
Web (dis)assembly
Web (dis)assemblyWeb (dis)assembly
Web (dis)assembly
 
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?
 
De Java 8 ate Java 14
De Java 8 ate Java 14De Java 8 ate Java 14
De Java 8 ate Java 14
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutions
 

Plus de Biswadip Goswami

Plus de Biswadip Goswami (13)

TSHOOT Solution for CISCO DEMO
TSHOOT Solution for CISCO DEMOTSHOOT Solution for CISCO DEMO
TSHOOT Solution for CISCO DEMO
 
Random GSE Presentation
Random GSE PresentationRandom GSE Presentation
Random GSE Presentation
 
Windows Vista Tour
Windows Vista TourWindows Vista Tour
Windows Vista Tour
 
Visual Studio Toolbox Unleashed
Visual Studio Toolbox UnleashedVisual Studio Toolbox Unleashed
Visual Studio Toolbox Unleashed
 
Span and Div tags in HTML
Span and Div tags in HTMLSpan and Div tags in HTML
Span and Div tags in HTML
 
ASP_NET Features
ASP_NET FeaturesASP_NET Features
ASP_NET Features
 
Your First ASP_Net Project Part - 2
Your First ASP_Net Project Part - 2Your First ASP_Net Project Part - 2
Your First ASP_Net Project Part - 2
 
Three tier Architecture of ASP_Net
Three tier Architecture of ASP_NetThree tier Architecture of ASP_Net
Three tier Architecture of ASP_Net
 
Your First ASP_Net project part 1
Your First ASP_Net project part 1Your First ASP_Net project part 1
Your First ASP_Net project part 1
 
Html Layout
Html LayoutHtml Layout
Html Layout
 
Html Layouts
Html LayoutsHtml Layouts
Html Layouts
 
Xhtml
XhtmlXhtml
Xhtml
 
Forms
FormsForms
Forms
 

Dernier

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 

Dernier (20)

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 

Java for the Beginners

  • 1. “Java” – for a beginner By: Biswadip Goswami (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 2. What are we going to venture ! • The Platform. • Java Virtual Machine. • The Programming Environment. • Some fundamentals (datatypes etc.). • Structure of a Java Program. • Mistakes we make while writing the code. (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 3. The platform Java is a whole platform ! Huge library Lots of reusable code Execution environment providing services as • Security • Portability • Automatic garbage collection and more (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 4. The Virtual Machine JVM or Java Virtual Machine. • Platform independent execution environment • Convert ByteCode to machine code • Mimics a real Java processor • The ByteCode is executed regardless of the Operating System • A ByteCode stream: 03 3b – The mnemonics • iconst_0 // 03 • istore_0 // 3b (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 5. JVM and Garbage Collection: JVM stores all objects by the java applications and Garbage Collection is a process of automatically freeing those objects which are not referenced by the program any more. Garbage collector also stops heap fragmentation. (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 6. Some IDEs Available: • NetBeans [http://www.netbeans.org] • Eclipse [http://www.eclipse.org] • JBuilder 7 [http://www.borland.com/jbuilder] • Oracle9i JDeveloper [http://www.oracle.com/ip/develop/ids/] (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 7. JARGONS ! • JDK – Java development kit • JRE – Java runtime environment • SE – Standard Edition • EE – Enterprise edition • ME – Micro edition • J2 – Java 2 • SDK – Software development kit • Netbeans – there is no acronym sorry ! (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 8. The Programming Environment ! (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 9. First Program ! (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 10. (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 11. Using Comments (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 12. Data Types • Java is a strongly typed language • Eight primitive types in Java • Integer types – int (4bytes) – Short (2bytes) – Long (8bytes) – Byte (1byte) • Floating point type – Float (4bytes) – Double (8bytes) (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 13. • Char type – used to describe individual characters. E.g. - b (backspace), t (tab) • Boolean type – it has two values ‘true’ and ‘false’. • After declaring a variable, it must be explicitly initialized. E.g. int days=30; • In java declaration can be done anywhere in the code. E.g. for(int x;x<=10;x++); (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 14. Example (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 15. Input/Output Lets check out an example for output – (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 16. Console input and output in Java. • Standard output stream (System.out.println) • Standard input stream (System.in) • Methods of Scanner class reads inputs. • Scanner(System.in) • nextLine method – input with space • next method – input single string (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 17. The Structure: Any simple java program looks like <access-specifier> class <class-name> { <access-specifier> static void main(varargs) { variables; functions; } } (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 18. Troubleshooting: • Check for upper and lower case of class name and .java program name. • Bad command or file name - check for installation • Cannot read: xyz.java – check for the file in the current directory • Error about new language construct – check for the latest version of JDK • Cannot find the symbol – check for the name/keywork/identifier • Using an IDE generally saves you from setting of the CLASSPath. (c) Biswadip Goswami, biswadip_g@hotmail.com
  • 19. Thank you ! For assistance with your ASP.Net or JAVA requirements contact: Biswadip Goswami Primary e-mail: biswadip_g@hotmail.com Alt e-mail: biswadip@cognobytes.com Webpage: http://people.cognobytes.com/biswadip Skype me at biswadip.g (c) Biswadip Goswami, biswadip_g@hotmail.com