0% found this document useful (0 votes)
28 views

OOP - Lecture 3 Intro To Java

Uploaded by

learnwithdevil
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

OOP - Lecture 3 Intro To Java

Uploaded by

learnwithdevil
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Object oriented

Lecture 3

Programmin Anum Aleem

g
[email protected]
What is Java Programming Language?

• Java is a widely used programming language and is designed for


the distributed environment of internet. It is a general-purpose
programming language that is concurrent, class-based, and object-
oriented.
Features Of Java
• Simple:
Its syntax is similar to C++. This makes it easier to transition from C++ to Java.
• Object-oriented
Java follows the principles of Object-Oriented Programming (Objects, Classes, Inheritance,
Encapsulation / Data hiding, Abstraction, Polymorphism).
• Secure
• The Bytecode Verifier inspects fragments of code for illegal code that can bypass access
• Portable
• Java is portable because you can carry bytecode over to any other platform it runs on.
• Platform Independent
• Java code should run on any machine that doesn’t need any special software to be installed, yet
the JVM needs to be present in the machine.
Features Of Java

• Robust
• No explicit pointers, strong memory management, automatic garbage collection,
exception handling
• Multithreaded
• It is multithreaded as it can perform several tasks simultaneously within a program.
• Distributed
• It helps in developing applications on networks that can contribute to both data and
application functionality.
• Dynamic
• Java is a dynamic language which means it can link new Java class libraries, Java
objects, and Java methods dynamically.
Advantages Of Java
• Java is object-oriented, which helps reduce the complexity and
create reusable and efficient code.
• Security. Java provides guarantees for security such as Security-
related APIs and Byte-code verification.
• Java is considered to be a simple language.
• Java is platform-independent, which means it can be moved from
one computer system to another.
• It is multithreaded as it can perform several tasks simultaneously
within a program.
• Memory allocation.
• Java is robust as compilers can detect errors.
Applications Of Java
JVM

• Java Virtual Machine (JVM) is an execution situation for Java


applications. JVM is an abstract computing machine characterized
by a particular, it intends to decipher bytecode that assembles
from Java source code.

• JVM Architecture in Java has three main subsystems


• Java ClassLoader Subsystem
• Runtime Data Area
• Execution Engine
JVM(cont…)

JVM is a virtual machine that provides runtime environgment to execute java


bytecode. The JVM doesn’t understand Java code directly. That’s why you need to
compile your *.javafiles to obtain *.class files that contain the bytecodes
understandable by the JVM
JRE

• The Java Runtime Environment (JRE) provides the libraries, the Java
Virtual Machine and other components to run applets and applications
written in the Java Programming Language. JRE does not contain tools
and utilities such as compilers or debuggers for developing applets and
applications
JDK

• The JDK stands for Java Development Kit used for developing Java
applets and apps. It is basically a software development
environment.
• Loads code
• Verifies code
• Executes code
• Provides the runtime environment
JDK (cont…)

The JDK is a superset of the JRE, and contains everything that is in the
JRE, plus tools such as the compilers and debuggers necessary for
developing applets and applications.
Difference Between JDK, JRE, and JVM
Java compiling and interpreting process

• In Java, programs are not compiled into executable files; they are compiled
into bytecode using javac compiler.

• The JVM (Java Virtual Machine) then executes these bytcodes at runtime.

• The bytecode gets saved on the disk with the file extension .class.

• When the program is to be run, the bytecode is converted into machine code
using (JIT) compiler. The result is then fed to the memory and is executed.

• Java code needs to be compiled twice in order to be executed:

 Java programs need to be compiled to bytecode.


 When the bytecode is run, it needs to be converted to machine
code.
HOW TO INSTALL JAVA IN YOUR SYSTEMS
STEP 1 INSTALL JDK
STEP 2 INSTALL APACHE NETBEANS
JAVA DEVELOPMENT KIT INSTALLED

STEP 2

HOW TO INSTALL NETBEANS


• Input output
statements
• Variable declaration
& initialization
• Loops
• Array

You might also like