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

Introduction to Programming Languages(part II) (1)

The document explains the process of compilation in programming, focusing on Java's unique compilation into byte code and its execution via the Java Virtual Machine (JVM). It highlights Java's features such as simplicity, object-oriented design, platform independence, multithreading, robustness, security, distribution capabilities, and automatic garbage collection. Additionally, it lists attributes and behaviors for objects like Car, Student, and TV.

Uploaded by

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

Introduction to Programming Languages(part II) (1)

The document explains the process of compilation in programming, focusing on Java's unique compilation into byte code and its execution via the Java Virtual Machine (JVM). It highlights Java's features such as simplicity, object-oriented design, platform independence, multithreading, robustness, security, distribution capabilities, and automatic garbage collection. Additionally, it lists attributes and behaviors for objects like Car, Student, and TV.

Uploaded by

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

Introduction to Programming Languages

Part II
Explain Ordinary Compilation.
The process of converting a source code(program written in high level
language) into the machine code is called compilation. The converted
machine code is dependent on the platform it is executing on. The
resultant machine code is called native executable code. The native
executable code is directly executed on the corresponding computer for
which it has been created.
Explain java compilation.
Programs written in java are compiled into a special type of intermediate
code called byte code using the java compiler, javac. Byte code still
needs an interpreter to execute them on any given platform. Java Virtual
Machine(JVM) is an abstract machine designed on the top of the existing
processors that helps to convert the byte code to the native executable
code and executes it. It hides the underlying Operating System from
java applications. JVM is written specifically for the specific Operating
System which can interpret any byte code for the given platform.
Explain byte code.
Java byte code is a set of pseudo-machine language instructions that are
understood by the JVM and are independent of the underlying
hardware.
Java byte code is executable by JVM which reads each instruction of the
program one by one and translates it to the corresponding machine
language and executes it.
Explain the different features of java.
a) Simple
Java is easy to write and understand. It can be used to develop wide
variety of dynamic, completely secure and platform independent
applications.
b) Object Oriented
In Java, all elements are objects. Java supports the Object Oriented
Programming paradigm implementing abstraction, encapsulation,
inheritance and polymorphism. Class is the basic unit in java and objects
are entities following the prototype defined by the class.
c) Platform independent
The concept of Write Once Run Anywhere(WORA) makes it a powerful
language. Unlike other programming languages such as C & C++, it is not
compiled into platform specific machine, rather into platform
independent byte code. This byte code is distributed over the web and
interpreted by virtual machine(JVM) on whichever platform it is being
run.
d) Multithreaded
Multithreaded is the capability of machine to execute multiple
threads(process) concurrently within the same program. This feature
allows programmers to develop interactive applications.
e) Robust and Secure
Java applications are reliable in various ways. Java offers compile time
checking to detect early the cause of bugs as well as run time checking.
It eliminates the use of pointers which can cause memory corruption or
unwanted access of memory.
f) Java is distributed
Java supports network programming to communicate with remote
objects distributed over the network. It also provides libraries like
RMI(Remote Method Invocation) to develop network applications.
g) Garbage collection
Automatic garbage collection is another great feature of java with which
it prevents inadvertent corruption of memory. Java has new operator to
allocate memory for objects in the program, but it does not use any
operator for deleting memory of the object instead it is done
automatically with garbage collector.
List out any three attributes and behaviour of the following objects:-
Object Attributes Behaviour
Car Modelno drive()
colour applyBreak()
currentspeed changeGear()
slowDown()
Student Name Read()
Rollno play()
Address editData()
TV Model changeChannel()
Screensize increaseVolume()
display editSettings()

You might also like