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

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Dernier (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

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