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

OOP II (Features, Compiler, Interpreter)

This document summarizes the key features of Java as an object-oriented programming language. It discusses how Java is both compiled and interpreted, with the Java compiler translating source code to bytecode and the Java interpreter then generating machine code. It also outlines how Java is platform independent, portable, object-oriented, robust and secure, distributed, simple yet familiar, multithreaded, and high performing. The document provides details on each of these features of the Java programming language.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

OOP II (Features, Compiler, Interpreter)

This document summarizes the key features of Java as an object-oriented programming language. It discusses how Java is both compiled and interpreted, with the Java compiler translating source code to bytecode and the Java interpreter then generating machine code. It also outlines how Java is platform independent, portable, object-oriented, robust and secure, distributed, simple yet familiar, multithreaded, and high performing. The document provides details on each of these features of the Java programming language.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Object Oriented Programming II

JAVA
Features of Java Applications
Sun Micro Systems officially describes Java with the
following features:
• Compiled and Interpreted
• Platform Independent and Portable
• Object Oriented
• Robust and Secure
• Distributed
• Simple, Small and Familiar
• Multithreaded
• High Performance
Compiled and Interpreted
• Usually a computer language is either compiled or
interpreted
• Java combines both these approaches, thus making
Java a two stage system
• First Java compiler translates source code into
byte code instructions
Compiled and Interpreted
• In the second stage Java interpreter generates
machine code
• That can be directly executed by the machine
Platform Independent and Portable

• The most significant feature of Java is its


Portability
• Java programs can be easily moved from one
computer system to another, anywhere and at
anytime
Platform Independent and Portable

• Changes and upgrades in


 Operating systems
 Processors
will not force any changes in Java programs
Platform Independent and Portable

Once compiled, Java class file can be run on any platform


Object Oriented
• Java is a true object oriented language
• Almost everything in Java is an object
• All programs code and data reside within
objects and classes
• Java comes with an extensive set of classes
arranged in packages
Robust and Secure
• Java is a robust language
• It provides many safeguards to ensure reliable
code
• It has strict compile time and runtime for data
types
• It is designed as a garbage collected language
• Java also provides concept of exception handling
which identifies errors and eliminates
Robust and Secure
• The absence of pointers in Java ensures that
programs cannot gain access to memory
location without proper initialization
Distributed
• Java is designed as a distributed language for
creating applications on networks
• It has the ability to share both data and
programs
• Enables multiple programmers at multiple
locations work together on a single project
Simple, Small and Familiar
• Java is small and simple language. Many
features of C and C++ are not part of Java. eg. :
Java does not provide:
 Pointers
 Preprocessors header file
 goto statements
 Multiple inheritance
Simple, Small and Familiar
• Familiarity is another feature of Java
• It is modeled on C and C++ languages
• Java is a simplified version of C++
Multithreaded
• Multithreaded means managing multiple
tasks simultaneously
• Java supports multithreaded programs
• Need not wait for the application to finish
one task before beginning another
High Performance
• Java performance is impressive for an
interpreted language (Due to the use of
intermediate byte code)
• The incorporation of multithreading enhances
the overall execution speed of Java programs
Compiler vs Interpreter
Compiler Interpreter
• Compiler takes an entire • Interpreter takes a single
program as input. It works on statement at a time as input.
the complete program at once It works line by line
• It generates Intermediate • It doesn’t generate
Object code (machine code) Intermediate code
• It executes Conditional control • It executes Conditional
statements faster than control statements much
Interpreter slower than Compiler
• More memory required (since • Memory requirement is less.
Object Code is generated) It doesn't generate
intermediate Object Code
Compiler vs Interpreter
Compiler Interpreter
• Errors are displayed after • Errors are displayed for every
entire program is checked instruction interpreted (if any)
• Programming languages that • Programming languages that
use compilers are C, C++ use interpreter are Visual
Basic Script, Ruby, Perl

You might also like