SlideShare a Scribd company logo
Java Programming
Presented By
Engr. Md. Abdul Momin
(OCJA and OCJP)
2
Programming Language
 Three levels of programming languages:
– Machine Languages
– Machine language instructions are binary coded and very
low level.
– Assembly Languages
– Assembly language allows symbolic programming.
Requires an assembler to translate assembly programs into
machine programs.
– High-level Languages
– High-level language provides a very high conceptual model
of computing. Requires a compiler to translate high-level
programs into assembly programs.
3
Java
 Java is a high-level object-oriented language
developed by Sun Microsystems.
 Java’s clean design and wide availability make it an
ideal language for teaching the fundamentals of
computer programming.
4
What Is Java?
 History
 Characteristics of Java
5
History
 James Gosling and Sun Microsystems
 Oak
 Java, May 20, 1995, Sun World
 HotJava
– The first Java-enabled Web browser
 JDK Evolutions
 J2SE, J2ME, and J2EE
6
Characteristics of Java
 Java is simple
 Java is object-oriented
 Java is distributed
 Java is interpreted
 Java is robust
 Java is secure
 Java is architecture-neutral
 Java is portable
 Java’s performance
 Java is multithreaded
 Java is dynamic
7
JDK Versions
 JDK 1.02 (1995)
 JDK 1.1 (1996)
 Java 2 SDK v 1.2 (a.k.a JDK 1.2, 1998)
 Java 2 SDK v 1.3 (a.k.a JDK 1.3, 2000)
 Java 2 SDK v 1.4 (a.k.a JDK 1.4, 2002)
8
JDK Editions
 Java Standard Edition (J2SE)
– J2SE can be used to develop client-side standalone
applications or applets.
 Java Enterprise Edition (J2EE)
– J2EE can be used to develop server-side applications
such as Java servlets and Java ServerPages.
 Java Micro Edition (J2ME).
– J2ME can be used to develop applications for mobile
devices such as cell phones.
9
IDE Tools
 Forte by Sun MicroSystems
 Borland JBuilder
 Microsoft Visual J++
 WebGain Café
 IBM Visual Age for Java
 Net Beans
 Eclipse
 Intelleji
10
Getting Started with Java
Programming
A Simple Java Application
Compiling Programs
Executing Applications
11
A Simple Application
Example 1.1
//This application program prints Welcome
//to Java!
package chapter1;
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
.
12
Creating and Compiling Programs
 On command line
– javac file.java
Source Code
Create/Modify Source Code
Compile Source Code
i.e. javac Welcome.java
Bytecode
Run Byteode
i.e. java Welcome
Result
If compilation errors
If runtime errors or incorrect result
13
Executing Applications
 On command line
– java classname
Java
Interpreter
on Windows
Java
Interpreter
on Sun Solaris
Java
Interpreter
on Linux
Bytecode
...
14
Example
javac Welcome.java
java Welcome
output:...
15
Compiling and Running a Program
Where are the files
stored in the
directory?
c:example
chapter1 Welcome.class
Welcome.java
chapter2
.
.
.
Java source files and class files for Chapter 2
chapter19 Java source files and class files for Chapter 19
Welcome.java~
16
Anatomy of a Java Program
 Comments
 Package
 Reserved words
 Modifiers
 Statements
 Blocks
 Classes
 Methods
 The main method
17
Comments
In Java, comments are
preceded by two slashes (//)
in a line, or enclosed
between /* and */ in one or
multiple lines. When the
compiler sees //, it ignores
all text after // in the
same line. When it sees /*,
18
Package
The second line in the program
(package chapter1;) specifies a
package name, chapter1, for the class
Welcome. Forte compiles the source
code in Welcome.java, generates
Welcome.class, and stores
Welcome.class in the chapter1 folder.
19
Reserved Words
Reserved words or keywords are
words that have a specific
meaning to the compiler and
cannot be used for other
purposes in the program. For
example, when the compiler sees
the word class, it understands
that the word after class is the
name for the class. Other
reserved words in Example 1.1
20
Modifiers
Java uses certain reserved words called
modifiers that specify the properties of the
data, methods, and classes and how they
can be used. Examples of modifiers are
public and static. Other modifiers are
private, final, abstract, and protected. A
public datum, method, or class can be
accessed by other programs. A private
datum or method cannot be accessed by
other programs. Modifiers are discussed in
Chapter 6, "Objects and Classes."
21
Statements
A statement represents an
action or a sequence of
actions. The statement
System.out.println("Welcome
to Java!") in the program in
Example 1.1 is a statement
to display the greeting
"Welcome to Java!" Every
statement in Java ends with
22
Blocks
A pair of braces in a program
forms a block that groups
components of a program.
public class Test {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
Class block
Method block
23
Classes
The class is the essential Java
construct. A class is a template
or blueprint for objects. To
program in Java, you must
understand classes and be able
to write and use them. The
mystery of the class will
continue to be unveiled
throughout this book. For now,
though, understand that a
24
Methods
What is System.out.println? It is a method:
a collection of statements that performs a
sequence of operations to display a
message on the console. It can be used
even without fully understanding the details
of how it works. It is used by invoking a
statement with a string argument. The
string argument is enclosed within
parentheses. In this case, the argument is
"Welcome to Java!" You can call the same
println method with a different argument to
25
main Method
The main method provides the
control of program flow. The
Java interpreter executes the
application by invoking the main
method.
The main method looks like this:
public static void main(String[]
args) {

More Related Content

Similar to Java Standard edition(Java ) programming Basics for beginner's (20)

PPT
01slide
Horesh Kumar
 
PPT
Java course-in-mumbai
vibrantuser
 
PPT
Chapter 1 java
ahmed abugharsa
 
PPTX
What is Java, JDK, JVM, Introduction to Java.pptx
kumarsuneel3997
 
PDF
Java Introduction | PDF
Geekster
 
PDF
Professional-core-java-training
Vibrant Technologies & Computers
 
PPT
INTRODUCTION TO JAVA APPLICATION
Ajit Yadav
 
PPT
Servlets and JavaServer Pages (JSP) from the B.Sc. Computer Science and Infor...
RaguV6
 
PPT
Professional-core-java-training
Vibrant Technologies & Computers
 
PPTX
Introduction to java
Lovely Professional University
 
PPTX
Introduction to java
Lovely Professional University
 
PPTX
Introduction-to-Java-Programming-Language (1).pptx
adityadhangardg984
 
PPTX
Corejava
Harshit Sachdeva
 
PPTX
objectorientedprogrammingCHAPTER 2 (OOP).pptx
tutorialclassroomhit
 
PPT
j-chap1-Basics.ppt
SmitaBorkar9
 
PPT
Java-Unit-I.ppt
RameswarGprec
 
PPTX
Programming in java ppt
MrsRLakshmiIT
 
PPTX
Programming in java ppt
MrsRBoomadeviIT
 
01slide
Horesh Kumar
 
Java course-in-mumbai
vibrantuser
 
Chapter 1 java
ahmed abugharsa
 
What is Java, JDK, JVM, Introduction to Java.pptx
kumarsuneel3997
 
Java Introduction | PDF
Geekster
 
Professional-core-java-training
Vibrant Technologies & Computers
 
INTRODUCTION TO JAVA APPLICATION
Ajit Yadav
 
Servlets and JavaServer Pages (JSP) from the B.Sc. Computer Science and Infor...
RaguV6
 
Professional-core-java-training
Vibrant Technologies & Computers
 
Introduction to java
Lovely Professional University
 
Introduction to java
Lovely Professional University
 
Introduction-to-Java-Programming-Language (1).pptx
adityadhangardg984
 
Corejava
Harshit Sachdeva
 
objectorientedprogrammingCHAPTER 2 (OOP).pptx
tutorialclassroomhit
 
j-chap1-Basics.ppt
SmitaBorkar9
 
Java-Unit-I.ppt
RameswarGprec
 
Programming in java ppt
MrsRLakshmiIT
 
Programming in java ppt
MrsRBoomadeviIT
 

Recently uploaded (20)

PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Add Background Images to Charts in IBM SPSS Statistics Version 31.pdf
Version 1 Analytics
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Add Background Images to Charts in IBM SPSS Statistics Version 31.pdf
Version 1 Analytics
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Ad

Java Standard edition(Java ) programming Basics for beginner's

  • 1. Java Programming Presented By Engr. Md. Abdul Momin (OCJA and OCJP)
  • 2. 2 Programming Language  Three levels of programming languages: – Machine Languages – Machine language instructions are binary coded and very low level. – Assembly Languages – Assembly language allows symbolic programming. Requires an assembler to translate assembly programs into machine programs. – High-level Languages – High-level language provides a very high conceptual model of computing. Requires a compiler to translate high-level programs into assembly programs.
  • 3. 3 Java  Java is a high-level object-oriented language developed by Sun Microsystems.  Java’s clean design and wide availability make it an ideal language for teaching the fundamentals of computer programming.
  • 4. 4 What Is Java?  History  Characteristics of Java
  • 5. 5 History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  HotJava – The first Java-enabled Web browser  JDK Evolutions  J2SE, J2ME, and J2EE
  • 6. 6 Characteristics of Java  Java is simple  Java is object-oriented  Java is distributed  Java is interpreted  Java is robust  Java is secure  Java is architecture-neutral  Java is portable  Java’s performance  Java is multithreaded  Java is dynamic
  • 7. 7 JDK Versions  JDK 1.02 (1995)  JDK 1.1 (1996)  Java 2 SDK v 1.2 (a.k.a JDK 1.2, 1998)  Java 2 SDK v 1.3 (a.k.a JDK 1.3, 2000)  Java 2 SDK v 1.4 (a.k.a JDK 1.4, 2002)
  • 8. 8 JDK Editions  Java Standard Edition (J2SE) – J2SE can be used to develop client-side standalone applications or applets.  Java Enterprise Edition (J2EE) – J2EE can be used to develop server-side applications such as Java servlets and Java ServerPages.  Java Micro Edition (J2ME). – J2ME can be used to develop applications for mobile devices such as cell phones.
  • 9. 9 IDE Tools  Forte by Sun MicroSystems  Borland JBuilder  Microsoft Visual J++  WebGain Café  IBM Visual Age for Java  Net Beans  Eclipse  Intelleji
  • 10. 10 Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications
  • 11. 11 A Simple Application Example 1.1 //This application program prints Welcome //to Java! package chapter1; public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } .
  • 12. 12 Creating and Compiling Programs  On command line – javac file.java Source Code Create/Modify Source Code Compile Source Code i.e. javac Welcome.java Bytecode Run Byteode i.e. java Welcome Result If compilation errors If runtime errors or incorrect result
  • 13. 13 Executing Applications  On command line – java classname Java Interpreter on Windows Java Interpreter on Sun Solaris Java Interpreter on Linux Bytecode ...
  • 15. 15 Compiling and Running a Program Where are the files stored in the directory? c:example chapter1 Welcome.class Welcome.java chapter2 . . . Java source files and class files for Chapter 2 chapter19 Java source files and class files for Chapter 19 Welcome.java~
  • 16. 16 Anatomy of a Java Program  Comments  Package  Reserved words  Modifiers  Statements  Blocks  Classes  Methods  The main method
  • 17. 17 Comments In Java, comments are preceded by two slashes (//) in a line, or enclosed between /* and */ in one or multiple lines. When the compiler sees //, it ignores all text after // in the same line. When it sees /*,
  • 18. 18 Package The second line in the program (package chapter1;) specifies a package name, chapter1, for the class Welcome. Forte compiles the source code in Welcome.java, generates Welcome.class, and stores Welcome.class in the chapter1 folder.
  • 19. 19 Reserved Words Reserved words or keywords are words that have a specific meaning to the compiler and cannot be used for other purposes in the program. For example, when the compiler sees the word class, it understands that the word after class is the name for the class. Other reserved words in Example 1.1
  • 20. 20 Modifiers Java uses certain reserved words called modifiers that specify the properties of the data, methods, and classes and how they can be used. Examples of modifiers are public and static. Other modifiers are private, final, abstract, and protected. A public datum, method, or class can be accessed by other programs. A private datum or method cannot be accessed by other programs. Modifiers are discussed in Chapter 6, "Objects and Classes."
  • 21. 21 Statements A statement represents an action or a sequence of actions. The statement System.out.println("Welcome to Java!") in the program in Example 1.1 is a statement to display the greeting "Welcome to Java!" Every statement in Java ends with
  • 22. 22 Blocks A pair of braces in a program forms a block that groups components of a program. public class Test { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } Class block Method block
  • 23. 23 Classes The class is the essential Java construct. A class is a template or blueprint for objects. To program in Java, you must understand classes and be able to write and use them. The mystery of the class will continue to be unveiled throughout this book. For now, though, understand that a
  • 24. 24 Methods What is System.out.println? It is a method: a collection of statements that performs a sequence of operations to display a message on the console. It can be used even without fully understanding the details of how it works. It is used by invoking a statement with a string argument. The string argument is enclosed within parentheses. In this case, the argument is "Welcome to Java!" You can call the same println method with a different argument to
  • 25. 25 main Method The main method provides the control of program flow. The Java interpreter executes the application by invoking the main method. The main method looks like this: public static void main(String[] args) {

Editor's Notes

  • #2: First Class: Introduction, Prerequisites, Advices, Syllabus Lab 1: Create a Java Project, Compile, and Run. Show syntax errors Print program Capture screen shots, and save it in Word, and print it. Homework One: Check in the class randomly.