SlideShare a Scribd company logo
1 of 36
Programming in Java
www.infoviaan.com
Java Introduction, Java
Features, Hello Program
1
Java Language
Java is High level, Object Oriented Programming
Language
• Object Oriented – Follows OOP methodologies
• Java developed by James Gosling and colleagues
at Sun Microsystems in the early 1990s.
• The acquisition of Sun Microsystems by Oracle
Corporation was completed on January 27,
2010
www.infoviaan.com
2
Programming Language
Programming Language -
• A programming language is a formal language,
which comprises a set of instructions used to
produce various kinds of output.
• Programming languages are used to create
programs or software that implement specific
algorithms.
• The term programming language usually refers
to high-level languages, such as C, C++, Java,
Python etc.
www.infoviaan.com
3
High Level Language
High Level Programming language –
• A high-level language that enables development
of a program in a much more user-friendly
programming context and is generally
independent of the computer's hardware
architecture.
www.infoviaan.com
4
Java Version History
1997 JAVA 1.1
2004 JAVA 5
2011 JAVA 7
No Major Changes
between 1.1 to 1.4
Major Changes in 1.5
No Major Changes in Java 6
Major Changes in Java 7
PureOOP
2014 JAVA 8
2017 JAVA 9
2018 JAVA 10
Major Changes
Major
Changes
Major Changes
OOP+Functional
5
www.infoviaan.com
OOP VS Functional Prog.
OOP
• Its based on the concept of
"objects", which may contain
data, in the form of fields,
often known as attributes.
• It’s code, in the form of
procedures, often known as
methods.
• Class, Object, Encapsulation,
Inheritance, Polymorphism,
Abstraction etc. are the
concepts of OOP.
• Ex. Java, Ruby etc.
FP
• Its try to bind everything
in pure mathematical
functions style.
• It is a declarative type
of programming style
• Its main focus is on “what
to solve” in contrast to an
imperative style where the
main focus is “how to
solve”
• Functions, recursion etc.
are concept of FP
• Ex. C, PHP etc. 6
www.infoviaan.com
Features of Java
7
www.infoviaan.com
1. Object Oriented
• Employee in IT company works on multiple Technologies,
communicates with each other, works on 2 projects parallel,
holds various responsibilities and perform actions/work as per
their assigned role.
CEO, CTO , CIO , Manager, Team Leader, Developer, Tester,
Designer etc.
• Object Oriented -
• Java follows OOP methodologies.
• Focus on the data hold/ associated by objects and methods
for manipulating the data.
IT
Company
CIO Manager Team
8
www.infoviaan.com
Object
• Object is represents any real world entity
• Object actually exists in memory
• Objects have states and behaviours.
Example: A dog has states - colour, name, breed as well as
behaviours – wagging the tail, barking, eating.
• Which have own memory
• It is Instance of the class
University Principal Classroom Computer Lab
9
www.infoviaan.com
Object has state and behavior
Object has state and behavior
State - state are stored in memory variable
- state will be changed by behavior
Behavior- behavior perform operation
- behavior are implemented by function, and
function are called method in OOP.
States/variables
Colour: white
Gear: 2nd
Speed: 40
Behaviour/method
changeColor()
changeGear()
accelerator()
break()
Object
10
www.infoviaan.com
Structure of an object
Before any object creation you have to create structure or
design.
• Structure means template or blueprint of an object.
• Class is the structure or skeleton or design of an object.
• State and behavior of an object are defined by Class.
• Object is the instance/memory of the class.
State / Member Variable/ Attribute
Function / Method / Member
method
Class
11
www.infoviaan.com
Class vs Object
Hall
WashroomBed Room
Bed Room
Wash
basin
path Gate
Kitchen
Plot – Map (blueprint)
Class
Constructed – Object 1
Constructed – Object 2
State/Attributes :
door
window
color
Behaviour/Method:
changeColor()
changeDoor()
openWindow()
…
Washroom
Washroom
12
www.infoviaan.com
2. Simple
• Java is easy to write and more readable.
• Java has a concise, cohesive set of features that
makes it easy to learn it easy to learn and use.
• No pointers
• Automatic garbage collection (memory
management).
• Java was designed to make it much easier to write
bug free code.
• Java is an excellent teaching language, and an
excellent choice with which to learn programming.
The language is small so it's easy to become fluent.
13
www.infoviaan.com
3. Secured
Java is secured because:
• No explicit pointer
• Java programs run inside virtual machine sandbox
C/C++ application
Operating System
Uses runtime
Environment of its own
Java Virtual Machine
Uses runtime environment Of OS
Java application
Operating System
Uses runtime environment Of OS
14
www.infoviaan.com
4. Platform Independent
Hardware
Software
OS: windows/Linux/Sun Solaris
CPU/Mother
Board/RAM
Platform
What is Platform?
15
www.infoviaan.com
Machine
Developer
machine
Client
machine
Develop + Run
Compiler(javac)
+Interpreter(JRE/JVM)
JDK
JDK VS JRE
Only Run
Interpreter(JRE/JVM)
JRE
16
www.infoviaan.com
Turbo C++
Compiler
A.cpp
Machine
Code
A.java
Javac
Compiler
JRE/JVM
Byte Code
C/C++ : Platform Dependent Java: Platform Independent
Platform
dependable
A.obj A.class
Platform Independent Cont.
Software
Hardware
Platform
17
www.infoviaan.com
Software
Hardware
Platform
C, C++
Windows Linux Mac OS
.C  .obj/
machine code
Windows Linux
.C  machine
code
Mac OS
Development
Machine
Run
Machine
.C 
machine code
18
www.infoviaan.com
Class File
Windows Linux Mac OS
Windows
JavaDevelopment
Machine
RunMachine
Windows
JVM/Setup
Linux
JVM/Setup
Mac/OS
JVM/Setup
19
www.infoviaan.com
JDK
JDK, JRE and JVM
.javac
JRE
JVM
.javaw
bytecode / .class
20
www.infoviaan.com
5. Robust
Robust means strong. Java program are strong
and they don’t crash easily like c and c++.
• Excellent exception handling
• Memory management
• Class loader sub system of JVM will allocate
necessary memory for java program.
• Garbage collector de allocates the memory.
21
www.infoviaan.com
6. Portable
• Java is considered as Portable because – Output of a Java
compiler is Non Executable Code i.e Bytecode. Bytecode is
executed by Java run-time system, which is called the Java
Virtual Machine (JVM).
• They can run on any platform without being re compiled.
• Being architectural-neutral and having no implementation
dependent aspect of the specification makes java portable.
Machine 1 - Window Machine 2 - Linux
Connected with LANHello.class Hello O/P
22
www.infoviaan.com
7. Architectural-neutral
• Write once, run anywhere (WORA)
• With a JVM, you can write one program that
will run on any platform.
• Java compiler generates an architectural-neutral
object file format, which makes the compiled
code executable on many processors, with the
presence of Java Runtime System.
• Means java byte code is architectural-neutral .
23
www.infoviaan.com
8. Dynamic
• Java is dynamic because, java bytecode(.class file) is
interpreted by JVM.
• Static means, java source code (.java file) is
compiled into another language(byte code) before it
is executed – it is not directly executable.
• So , we might say that java byte code is dynamic.
• Java has Dynamic and Extensible Code Means With
the Help of OOPS java Provides Inheritance and
With the Help of Inheritance we Reuse the Code
that is Pre-defined and Also uses all the built in
Functions of java and Classes
24
www.infoviaan.com
9. Compile & Interpreted
Compiler –
• Convert complete source code
at a time of a program.
• Fast Processing.
• Worked Before run of
program
Converting
source
code to byte
code
in one shot
Converting
source
code to byte
code
line by line
JAVAC JIT
Interpreter –
• Convert source code Line
by line of a program.
• Slow Processing.
• Worked after run of
program
25
www.infoviaan.com
10. High Performance
• Java performance is improved in newer “Just-in-
time(JIT)” JVM’s , which compile methods after
some number of executions, and save machine code to
give compiled-code efficiently thereafter.
• Java performance is impressive for an interpreted
language.
• Due to the use of intermediate byte code.
• Java architecture is also designed to reduce overheads
during runtime.
26
www.infoviaan.com
11. Multithreaded
• Java supports multithreaded programming, which allows
you to write programs that do many things
simultaneously.
• The Java run-time system contains tools to support
multiprocess synchronization and construct smoothly
running interactive systems.
Multitasking –
Multiple work
run
simultaneously
Multithreading –
One process contains
multiple sub
process/lightweight
processes.
27
www.infoviaan.com
12. Distributed
• Java is Distributed Language Means because the program of java
is compiled onto one machine can be easily transferred to
machine and Executes them on another machine because facility
of Bytes Codes So java is Specially designed For Internet Users
which uses the Remote Computers.
• Java provides an extensive library of classes for communicating
,using TCP/IP protocols such as HTTP and FTP.
• This makes creating network connections much easier than in
C/C++.
• You can read and write objects on the remote sites via URL
with the same ease that programmers are used to when read
and write data from and to a file.
• This helps the programmers at remote locations to work
together on the same project.
28
www.infoviaan.com
Java Installation
Step 1: Download JDK.
• Go to -
https://www.oracle.com/technetwork/java/javase/downloads/index.ht
ml
Step 2: Install JDK and JRE.
• Run - jdk-8u181-windows-i586.exe (version can be different)
Step 3: Include JDK's "bin" Directory in the PATH.
• Launch "Control Panel" ⇒ (Optional) System and Security ⇒
System ⇒ Click "Advanced system settings" on the left pane.
• Switch to "Advanced" tab ⇒ Push "Environment Variables"
button.
• Under "System Variables" (the bottom pane), scroll down to
select "Path" ⇒ Click "Edit.".
Step 4: Verify the JDK Installation.
• Go to Command prompt and check verify.
Step 5: Write a Hello-World Java Program.
Step 6: Compile and Run the Hello-World Java Program.
29
www.infoviaan.com
Hello Program Explanation
public class HelloProgram
{
public static void main(String args[])
{
String name = “Infoviaan”;
System.out.println(“Hello This is
”+name);
}
}
public, class, static, and void are
keywords,
Keywords are always written in small
letters in java.
Class Name
Keyword
Method
Variable
Object reference
30
www.infoviaan.com
Program Explanation Cont.
public – Access modifier, shows accessibility of a class or variable
or method to other java classes.
class - used to define a class.
static - is used to assigned memory once in life.
void - is null return type of main method.
String name = “Infoviaan”;
is variable that store a value.
System.out.println(“Hello This is ”+ name);
is method, which display “Hello This is Infoviaan” at console
output.
here + is used for concatenate string.
main – method is the entry point of program execution.
it means program execution start from here.
String args[] – Command line arguments 31
www.infoviaan.com
Process to run java program
javac Hello.java
java Hello
Hello World
Compile
Run .main()
32
www.infoviaan.com
A.java
Javac
(Compiler) A.class
JVM(Interpreter)
Final Output
1) Byte Code Verifier
2) Class Loader
3) JIT(Just In Time Compiler)
4) Execution Engine
5) Garbage Collector
Byte Code
Machine Code
Working Process
33
www.infoviaan.com
Java Uses
1. J2SE : - Desktop GUI Applications: Java provides GUI
development through various means like Abstract
Windowing Toolkit (AWT), Swing and JavaFX. (Used to
develop Stand Alone/Desktop based applications)
2. Mobile Applications: - Android applications can be
developed by using the Java programming language
3. Embedded Systems: - It is a combination of hardware and
software that is designed for specific tasks, providing a
function and embedded within a larger electrical system
4. J2EE : - Building and deploying Web-based enterprise
applications.
5. Scientific Applications
34
www.infoviaan.com
Questions
1. Why Java is Platform Independent?
2. JDK vs JRE
3. What name of java compiler and Interpreter?
4. Is Java compiler produce machine code?
5. Is Java produce machine code?
6. What is Byte code?
7. Is JVM is Platform Independent or not?
8. Components of JVM
9. Why it is called Virtual machine?
10. Types of Virtual Machine.
11. Types of Java applications
35
www.infoviaan.com
Get in Touch
Thank You
www.infoviaan.com
36
www.infoviaan.com

More Related Content

What's hot

Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programmingElizabeth Thomas
 
Core Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsCore Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsMahika Tutorials
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaShravan Sanidhya
 
Java string handling
Java string handlingJava string handling
Java string handlingSalman Khan
 
class and objects
class and objectsclass and objects
class and objectsPayel Guria
 
Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android DevelopmentSpeck&Tech
 
Variables in python
Variables in pythonVariables in python
Variables in pythonJaya Kumari
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.netDeep Patel
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword pptVinod Kumar
 
sSCOPE RESOLUTION OPERATOR.pptx
sSCOPE RESOLUTION OPERATOR.pptxsSCOPE RESOLUTION OPERATOR.pptx
sSCOPE RESOLUTION OPERATOR.pptxNidhi Mehra
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java ProgrammingRavi Kant Sahu
 
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...Edureka!
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
 

What's hot (20)

Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
Core Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsCore Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika Tutorials
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan Sanidhya
 
Java string handling
Java string handlingJava string handling
Java string handling
 
class and objects
class and objectsclass and objects
class and objects
 
Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android Development
 
Variables in python
Variables in pythonVariables in python
Variables in python
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
sSCOPE RESOLUTION OPERATOR.pptx
sSCOPE RESOLUTION OPERATOR.pptxsSCOPE RESOLUTION OPERATOR.pptx
sSCOPE RESOLUTION OPERATOR.pptx
 
Constructors and Destructor in C++
Constructors and Destructor in C++Constructors and Destructor in C++
Constructors and Destructor in C++
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 
Method overloading
Method overloadingMethod overloading
Method overloading
 
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
 
Core Java
Core JavaCore Java
Core Java
 
Java Fundamentals
Java FundamentalsJava Fundamentals
Java Fundamentals
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 

Similar to Java programming guide for beginners

Similar to Java programming guide for beginners (20)

JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
 
MWLUG - Universal Java
MWLUG  -  Universal JavaMWLUG  -  Universal Java
MWLUG - Universal Java
 
java full 1 (Recovered).docx
java full 1 (Recovered).docxjava full 1 (Recovered).docx
java full 1 (Recovered).docx
 
java full 1.docx
java full 1.docxjava full 1.docx
java full 1.docx
 
java full.docx
java full.docxjava full.docx
java full.docx
 
Java ms harsha
Java ms harshaJava ms harsha
Java ms harsha
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Java.pptx
Java.pptxJava.pptx
Java.pptx
 
java completed units.docx
java completed units.docxjava completed units.docx
java completed units.docx
 
Getting Started with JAVA
Getting Started with JAVAGetting Started with JAVA
Getting Started with JAVA
 
JavaClassPresentation
JavaClassPresentationJavaClassPresentation
JavaClassPresentation
 
1 java introduction
1 java introduction1 java introduction
1 java introduction
 
1 java intro
1 java intro1 java intro
1 java intro
 
java Training in Ranchi
java Training in Ranchijava Training in Ranchi
java Training in Ranchi
 
Presentación rs232 java
Presentación rs232 javaPresentación rs232 java
Presentación rs232 java
 
Java Ch 1.pptx
Java Ch 1.pptxJava Ch 1.pptx
Java Ch 1.pptx
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
 

Recently uploaded

Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
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
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Recently uploaded (20)

Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
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
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 

Java programming guide for beginners

  • 1. Programming in Java www.infoviaan.com Java Introduction, Java Features, Hello Program 1
  • 2. Java Language Java is High level, Object Oriented Programming Language • Object Oriented – Follows OOP methodologies • Java developed by James Gosling and colleagues at Sun Microsystems in the early 1990s. • The acquisition of Sun Microsystems by Oracle Corporation was completed on January 27, 2010 www.infoviaan.com 2
  • 3. Programming Language Programming Language - • A programming language is a formal language, which comprises a set of instructions used to produce various kinds of output. • Programming languages are used to create programs or software that implement specific algorithms. • The term programming language usually refers to high-level languages, such as C, C++, Java, Python etc. www.infoviaan.com 3
  • 4. High Level Language High Level Programming language – • A high-level language that enables development of a program in a much more user-friendly programming context and is generally independent of the computer's hardware architecture. www.infoviaan.com 4
  • 5. Java Version History 1997 JAVA 1.1 2004 JAVA 5 2011 JAVA 7 No Major Changes between 1.1 to 1.4 Major Changes in 1.5 No Major Changes in Java 6 Major Changes in Java 7 PureOOP 2014 JAVA 8 2017 JAVA 9 2018 JAVA 10 Major Changes Major Changes Major Changes OOP+Functional 5 www.infoviaan.com
  • 6. OOP VS Functional Prog. OOP • Its based on the concept of "objects", which may contain data, in the form of fields, often known as attributes. • It’s code, in the form of procedures, often known as methods. • Class, Object, Encapsulation, Inheritance, Polymorphism, Abstraction etc. are the concepts of OOP. • Ex. Java, Ruby etc. FP • Its try to bind everything in pure mathematical functions style. • It is a declarative type of programming style • Its main focus is on “what to solve” in contrast to an imperative style where the main focus is “how to solve” • Functions, recursion etc. are concept of FP • Ex. C, PHP etc. 6 www.infoviaan.com
  • 8. 1. Object Oriented • Employee in IT company works on multiple Technologies, communicates with each other, works on 2 projects parallel, holds various responsibilities and perform actions/work as per their assigned role. CEO, CTO , CIO , Manager, Team Leader, Developer, Tester, Designer etc. • Object Oriented - • Java follows OOP methodologies. • Focus on the data hold/ associated by objects and methods for manipulating the data. IT Company CIO Manager Team 8 www.infoviaan.com
  • 9. Object • Object is represents any real world entity • Object actually exists in memory • Objects have states and behaviours. Example: A dog has states - colour, name, breed as well as behaviours – wagging the tail, barking, eating. • Which have own memory • It is Instance of the class University Principal Classroom Computer Lab 9 www.infoviaan.com
  • 10. Object has state and behavior Object has state and behavior State - state are stored in memory variable - state will be changed by behavior Behavior- behavior perform operation - behavior are implemented by function, and function are called method in OOP. States/variables Colour: white Gear: 2nd Speed: 40 Behaviour/method changeColor() changeGear() accelerator() break() Object 10 www.infoviaan.com
  • 11. Structure of an object Before any object creation you have to create structure or design. • Structure means template or blueprint of an object. • Class is the structure or skeleton or design of an object. • State and behavior of an object are defined by Class. • Object is the instance/memory of the class. State / Member Variable/ Attribute Function / Method / Member method Class 11 www.infoviaan.com
  • 12. Class vs Object Hall WashroomBed Room Bed Room Wash basin path Gate Kitchen Plot – Map (blueprint) Class Constructed – Object 1 Constructed – Object 2 State/Attributes : door window color Behaviour/Method: changeColor() changeDoor() openWindow() … Washroom Washroom 12 www.infoviaan.com
  • 13. 2. Simple • Java is easy to write and more readable. • Java has a concise, cohesive set of features that makes it easy to learn it easy to learn and use. • No pointers • Automatic garbage collection (memory management). • Java was designed to make it much easier to write bug free code. • Java is an excellent teaching language, and an excellent choice with which to learn programming. The language is small so it's easy to become fluent. 13 www.infoviaan.com
  • 14. 3. Secured Java is secured because: • No explicit pointer • Java programs run inside virtual machine sandbox C/C++ application Operating System Uses runtime Environment of its own Java Virtual Machine Uses runtime environment Of OS Java application Operating System Uses runtime environment Of OS 14 www.infoviaan.com
  • 15. 4. Platform Independent Hardware Software OS: windows/Linux/Sun Solaris CPU/Mother Board/RAM Platform What is Platform? 15 www.infoviaan.com
  • 17. Turbo C++ Compiler A.cpp Machine Code A.java Javac Compiler JRE/JVM Byte Code C/C++ : Platform Dependent Java: Platform Independent Platform dependable A.obj A.class Platform Independent Cont. Software Hardware Platform 17 www.infoviaan.com Software Hardware Platform
  • 18. C, C++ Windows Linux Mac OS .C  .obj/ machine code Windows Linux .C  machine code Mac OS Development Machine Run Machine .C  machine code 18 www.infoviaan.com
  • 19. Class File Windows Linux Mac OS Windows JavaDevelopment Machine RunMachine Windows JVM/Setup Linux JVM/Setup Mac/OS JVM/Setup 19 www.infoviaan.com
  • 20. JDK JDK, JRE and JVM .javac JRE JVM .javaw bytecode / .class 20 www.infoviaan.com
  • 21. 5. Robust Robust means strong. Java program are strong and they don’t crash easily like c and c++. • Excellent exception handling • Memory management • Class loader sub system of JVM will allocate necessary memory for java program. • Garbage collector de allocates the memory. 21 www.infoviaan.com
  • 22. 6. Portable • Java is considered as Portable because – Output of a Java compiler is Non Executable Code i.e Bytecode. Bytecode is executed by Java run-time system, which is called the Java Virtual Machine (JVM). • They can run on any platform without being re compiled. • Being architectural-neutral and having no implementation dependent aspect of the specification makes java portable. Machine 1 - Window Machine 2 - Linux Connected with LANHello.class Hello O/P 22 www.infoviaan.com
  • 23. 7. Architectural-neutral • Write once, run anywhere (WORA) • With a JVM, you can write one program that will run on any platform. • Java compiler generates an architectural-neutral object file format, which makes the compiled code executable on many processors, with the presence of Java Runtime System. • Means java byte code is architectural-neutral . 23 www.infoviaan.com
  • 24. 8. Dynamic • Java is dynamic because, java bytecode(.class file) is interpreted by JVM. • Static means, java source code (.java file) is compiled into another language(byte code) before it is executed – it is not directly executable. • So , we might say that java byte code is dynamic. • Java has Dynamic and Extensible Code Means With the Help of OOPS java Provides Inheritance and With the Help of Inheritance we Reuse the Code that is Pre-defined and Also uses all the built in Functions of java and Classes 24 www.infoviaan.com
  • 25. 9. Compile & Interpreted Compiler – • Convert complete source code at a time of a program. • Fast Processing. • Worked Before run of program Converting source code to byte code in one shot Converting source code to byte code line by line JAVAC JIT Interpreter – • Convert source code Line by line of a program. • Slow Processing. • Worked after run of program 25 www.infoviaan.com
  • 26. 10. High Performance • Java performance is improved in newer “Just-in- time(JIT)” JVM’s , which compile methods after some number of executions, and save machine code to give compiled-code efficiently thereafter. • Java performance is impressive for an interpreted language. • Due to the use of intermediate byte code. • Java architecture is also designed to reduce overheads during runtime. 26 www.infoviaan.com
  • 27. 11. Multithreaded • Java supports multithreaded programming, which allows you to write programs that do many things simultaneously. • The Java run-time system contains tools to support multiprocess synchronization and construct smoothly running interactive systems. Multitasking – Multiple work run simultaneously Multithreading – One process contains multiple sub process/lightweight processes. 27 www.infoviaan.com
  • 28. 12. Distributed • Java is Distributed Language Means because the program of java is compiled onto one machine can be easily transferred to machine and Executes them on another machine because facility of Bytes Codes So java is Specially designed For Internet Users which uses the Remote Computers. • Java provides an extensive library of classes for communicating ,using TCP/IP protocols such as HTTP and FTP. • This makes creating network connections much easier than in C/C++. • You can read and write objects on the remote sites via URL with the same ease that programmers are used to when read and write data from and to a file. • This helps the programmers at remote locations to work together on the same project. 28 www.infoviaan.com
  • 29. Java Installation Step 1: Download JDK. • Go to - https://www.oracle.com/technetwork/java/javase/downloads/index.ht ml Step 2: Install JDK and JRE. • Run - jdk-8u181-windows-i586.exe (version can be different) Step 3: Include JDK's "bin" Directory in the PATH. • Launch "Control Panel" ⇒ (Optional) System and Security ⇒ System ⇒ Click "Advanced system settings" on the left pane. • Switch to "Advanced" tab ⇒ Push "Environment Variables" button. • Under "System Variables" (the bottom pane), scroll down to select "Path" ⇒ Click "Edit.". Step 4: Verify the JDK Installation. • Go to Command prompt and check verify. Step 5: Write a Hello-World Java Program. Step 6: Compile and Run the Hello-World Java Program. 29 www.infoviaan.com
  • 30. Hello Program Explanation public class HelloProgram { public static void main(String args[]) { String name = “Infoviaan”; System.out.println(“Hello This is ”+name); } } public, class, static, and void are keywords, Keywords are always written in small letters in java. Class Name Keyword Method Variable Object reference 30 www.infoviaan.com
  • 31. Program Explanation Cont. public – Access modifier, shows accessibility of a class or variable or method to other java classes. class - used to define a class. static - is used to assigned memory once in life. void - is null return type of main method. String name = “Infoviaan”; is variable that store a value. System.out.println(“Hello This is ”+ name); is method, which display “Hello This is Infoviaan” at console output. here + is used for concatenate string. main – method is the entry point of program execution. it means program execution start from here. String args[] – Command line arguments 31 www.infoviaan.com
  • 32. Process to run java program javac Hello.java java Hello Hello World Compile Run .main() 32 www.infoviaan.com
  • 33. A.java Javac (Compiler) A.class JVM(Interpreter) Final Output 1) Byte Code Verifier 2) Class Loader 3) JIT(Just In Time Compiler) 4) Execution Engine 5) Garbage Collector Byte Code Machine Code Working Process 33 www.infoviaan.com
  • 34. Java Uses 1. J2SE : - Desktop GUI Applications: Java provides GUI development through various means like Abstract Windowing Toolkit (AWT), Swing and JavaFX. (Used to develop Stand Alone/Desktop based applications) 2. Mobile Applications: - Android applications can be developed by using the Java programming language 3. Embedded Systems: - It is a combination of hardware and software that is designed for specific tasks, providing a function and embedded within a larger electrical system 4. J2EE : - Building and deploying Web-based enterprise applications. 5. Scientific Applications 34 www.infoviaan.com
  • 35. Questions 1. Why Java is Platform Independent? 2. JDK vs JRE 3. What name of java compiler and Interpreter? 4. Is Java compiler produce machine code? 5. Is Java produce machine code? 6. What is Byte code? 7. Is JVM is Platform Independent or not? 8. Components of JVM 9. Why it is called Virtual machine? 10. Types of Virtual Machine. 11. Types of Java applications 35 www.infoviaan.com
  • 36. Get in Touch Thank You www.infoviaan.com 36 www.infoviaan.com