You are on page 1of 25

Instructions for online class

Maintain discipline
Disable your video and microphone
Be ready with your book and note book to
make notes .
In case of doubt or question, raise you
hand (using tool available in your app)
Chapter -2 Introduction to Java

Features of bytecode-
i) It is a machine code for JVM
ii) It is not a completely compiled code but it is an

intermediate code .
iii) It is stored in .class file which is created after
compiling the source code.
Chapter -2 Introduction to Java
Difference between Source code and Bytecode
Source code Bytecode

It is a collection of computer It is a intermediate code between


instructions written using a human- source code and machine code that
readable programming language is executed by java virtual machine.

The source code is in the form of The byte code has numeric codes,
plain text with syntax and constants and references that encode
comments similar to English the result of parsing and semantic
language analysis.

The source code is not directly The byte code is executable by a


executable by the machine Java virtual machine.

Semantic Analysis is the third phase of Compiler. Semantic Analysis makes


sure that declarations and statements of program are semantically correct. 
Chapter -2 Introduction to Java
Object code –Object code is a set of instruction
codes that in understood by a computer at the
lowest hardware level.

Bytecode in java- Bycode is computer object code


that is processed by a program ,a virtual
machine ,rather than by the ‘real’ computer
machine , the hardware processor.
Chapter -2 Introduction to Java
Chapter -2 Introduction to Java
Java Virtual Machine (JVM)–

Java Virtual Machine (JVM) is a engine that


provides runtime environment to drive
the Java Code or applications.

It converts Java bytecode into machines


language. JVM is a part of Java Run
Environment (JRE)
Chapter -2 Introduction to Java
Java Virtual Machine (JVM)–
Chapter -2 Introduction to Java
Java Virtual Machine (JVM)–
Chapter -2 Introduction to Java
Java Runtime Environment (JRE)–

JRE stands for Java Runtime Environment which


is used to provide an environment at runtime. It is
the cause of implementation of JVM (as discussed
earlier). It contains a set of supporting libraries in
combination with core classes and various other
files that are used by JVM at runtime.
Chapter -2 Introduction to Java
Java Runtime Environment (JRE)–
Chapter -2 Introduction to Java
Java Runtime Environment (JRE)–
Chapter -2 Introduction to Java
Java Development Kit(JDK) –

The Java Development Kit (JDK) is a software


development environment used
for developing Java applications and applets. It
includes the Java Runtime Environment (JRE), an
interpreter/loader (java), a compiler (javac), an
archiver (jar), a documentation generator
(javadoc) and other tools needed
in Java development.
Chapter -2 Introduction to Java
Java Development Kit(JDK) –
Chapter -2 Introduction to Java
Features of Java–
1. Simple :Java is designed in such a way that once we understand
the basic concepts of OOPs ,Java would be easier for us.
2. Robust : simply means strong. 
Java is robust because: It uses strong
memory management. And errors are
checked and controlled properly.

3. Secure : The property of encapsulation enables java


to develop virus-free, temper-free system.
4. Object oriented : In java all elements are an object.
Java supports OOP paradigm with oops features.
Chapter -2 Introduction to Java
Features of Java–
5. Platform independent: Through the JVM we can run
java programs on different platforms .
6. Architectural neutral: Java compiler generates an
architectural-neutral object file format which makes the
compiled code to be executable on multiple processors.
7. Portable: platform independent and Architectural neutral
8. Dynamic : Java programs can carry an extensive amount
of run-time information that can be used to verify and
resolve accesses to objects at run-time.
Chapter -2 Introduction to Java
Features of Java–
9. Platform independent:
10. Multi- threaded:-
Multithreading in Java is a process of
executing multiple threads simultaneously. A thread
is a lightweight sub-process, the smallest unit of
processing. Multi-processing and multi-threading,
both are used to achieve multitasking. ... Java
Multithreading is mostly used in games, animation,
Chapter -2 Introduction to Java
Features of Java–
11. High performance:-
Java enabled High performance by introducing
JIT- Just In Time compiler , JIT helps the compiler
to compile the code On demand basis i.e which
ever method is called only that method block will
get compiled making compilation fast and time-
efficient. This makes the java delivering high
performance
Chapter -2 Introduction to Java
Features of Java–

12. Interpreted :
An interpreted language is a type of programming
language for which most of its implementations
execute instructions directly and freely, without
previously compiling a program into machine-language
instructions. ... Java compiled into bytecode, the
virtual-machine-friendly interpreted language.
Chapter -2 Introduction to Java
BlueJ–
A free Java Development Environment designed
for beginners
BlueJ is a development environment that allows
us to develop Java programs quickly and easily.

Its main features are that it is:


Simple BlueJ provides smaller and simpler
interface. This allows beginners to get started
more quickly and easliy.
Chapter -2 Introduction to Java
BlueJ–

Interactive BlueJ allows you to interact with


objects. You can inspect their value, call methods
on them, pass them as parameters and more.
Portable BlueJ runs on Windows, Mac OS X,
Linux and other platforms which run Java. It can
also run without installation from a USB stick.
Chapter -2 Introduction to Java
BlueJ–

Mature BlueJ is over fifteen years old, but


continues to be updated and supported by a full-
time team. We aim to respond to all technical
support requests within one working day.
Innovative BlueJ has several features not seen
before in other IDEs.
Chapter -2 Introduction to Java
BlueJ– Programming using IDE

IDE stands for Integrated Development Environment.


It is an application software that makes use of JDK as base
contains its own editor.
This enable us to write , compile and execute our programs
in user friendly environment.
Chapter -2 Introduction to Java
BlueJ– Installation
write from the book…..

Start to program in BlueJ- We have already created


programs in BlueJ

* Summary …
* All slides notes you have to write in your computer copy
.

*Complete Fill in the blanks in the book


Chapter -2 Introduction to Java
* short answer type questions in computer
note book if it is not covered in notes.
Q1. What is java?
Q2. What is bytecode in java programming
language?
Q3. How does bytecode differ from source code?

Q4. Describe the compiling and execution process


of a java program with an example.
Q5. What is JVM? How does it works?
Chapter -2 Introduction to Java
Q6. What do you understand by each of the
following :-
A. Compiler B. JVM
C.JRE D.JDK

Q7. Describe any two features of JAVA.


Q8.Describe any four features of BlueJ that allows
it to used for teaching Java.

You might also like