Object Oriented Programming CS F213: BITS Pilani
Object Oriented Programming CS F213: BITS Pilani
CS F213
J. Jennifer Ranjani
email: jennifer.ranjani@pilani.bits-pilani.ac.in
BITS Pilani
Pilani Campus
Prescribed Books
Text Books:
T1. Java: The Complete Reference, Herbert Schildt,
McGraw Hill Education, Tenth Edition, 2017.
T2. Object Oriented Design & Patterns, Cay Horstmann,
John Wiley & Sons, Second Edition, 2005.
Reference Book:
R1. JavaTM Design Patterns – A Tutorial, James W. Cooper,
Addison-Wesley, 2000.
BITS Pilani
Pilani Campus
What is Java?
Hardware and
Programmer
Operating System
javac
• Web applications
• Enterprise applications
• Mobile
• Embedded System
• Smart card
• Robotics
• Games etc.
• JavaFx
• Rich internet applications. Uses light weight user interface APIs.
Features of Java
Java Buzzwords
• Simple
• Syntax based on C++
• Removed confusing and rarely used features like pointers, operator overloading
etc.,
• Automatic garbage collection
• Object Oriented
• Object, Class, Inheritance, Polymorphism, Abstraction, Encapsulation
• Platform Independent
• Compiler converts Java code to bytecode
• Bytecode is platform independent
• Write Once and Run Anywhere
• Secured
• Robust
• Strong memory management, secure due to lack of pointers, automatic garbage
collection, exception handling and type checking
• Size of primitive types is fixed i.e., 4 bytes for both 32 and 64 bit architectures
• Porting the java system to any new platform involves writing an interpreter.
• The interpreter will figure out what the equivalent machine dependent code to run
• High Performance
• Bytecode is close to native code
• It is an interpreted language hence slower than C, C++
• Distributed
• Enables access to files by calling methods from any machine on the internet
• RMI, EJB
• Multi-threaded
• Thread is like a separate program executing concurrently
• Doesn’t occupy memory for each thread
• Multimedia, Web applications etc
• Dynamic
• Small fragments of bytecode may be dynamically updated at run time.
• Also supports functions from native languages i.e. C and C++