×
Stop thinking about WHAT WILL HAPPEN and start thinking about WHAT YOU CAN DO.
--Your friends at LectureNotes
Close

Object Oriented Programming Using JAVA

by Ktu Topper
Type: NoteInstitute: ABDUL KALAM TECHNICAL UNIVERSITY Downloads: 196Views: 3602Uploaded: 7 months agoAdd to Favourite

Touch here to read
Page-1

Object Oriented Programming Using JAVA by Ktu Topper

Topic:
Ktu Topper
Ktu Topper

/ 194

Share it with your friends

Suggested Materials

Leave your Comments

Contributors

A Java virtual machine (JVM) is an abstract computing machine that enables a computer to run a Javaprogram. There are three notions of the JVM: specification, implementation, and instance. The specification is a document that formally describes what is required of a JVM implementation. Having a single specification ensures all implementations are interoperable. A JVM implementation is a computer program that meets the requirements of the JVM specification. An instance of a JVM is an implementation running in a process that executes a computer program compiled into Java bytecode. Java Runtime Environment (JRE) is a software package that contains what is required to run a Java program. It includes a Java Virtual Machine implementation together with an implementation of the Java Class Library. The Oracle Corporation, which owns the Java trademark, distributes a Java Runtime environment with their Java Virtual Machine called HotSpot. Java Development Kit (JDK) is a superset of a JRE and contains tools for Java programmers, e.g. a javaccompiler. The Java Development Kit is provided free of charge either by Oracle Corporation directly, or by theOpenJDK open source project, which is governed by Oracle. A Java virtual machine (JVM) is an abstract computing machine that enables a computer to run a Javaprogram. There are three notions of the JVM: specification, implementation, and instance. The specification is a document that formally describes what is required of a JVM implementation. Having a single specification ensures all implementations are interoperable. A JVM implementation is a computer program that meets the requirements of the JVM specification. An instance of a JVM is an implementation running in a process that executes a computer program compiled into Java bytecode. Java Runtime Environment (JRE) is a software package that contains what is required to run a Java program. It includes a Java Virtual Machine implementation together with an implementation of the Java Class Library. The Oracle Corporation, which owns the Java trademark, distributes a Java Runtime environment with their Java Virtual Machine called HotSpot. Java Development Kit (JDK) is a superset of a JRE and contains tools for Java programmers, e.g. a javaccompiler. The Java Development Kit is provided free of charge either by Oracle Corporation directly, or by theOpenJDK open source project, which is governed by Oracle. JVM specification The Java virtual machine is an abstract (virtual) computer defined by a specification. This specification omits implementation details that are not essential to ensure interoperability: the memory layout of run-time data areas, the garbage-collection algorithm used, and any internal optimization of the Java virtual machine instructions (their translation into machine code). The main reason for this omission is to not unnecessarily constrain implementers. Any Java application can be run only inside some concrete implementation of the abstract specification of the Java virtual machine. Starting with Java Platform, Standard Edition (J2SE) 5.0, changes to the JVM specification have been developed under the Java Community Process as JSR 924.[2] As of 2006, changes to specification to support changes proposed to the class file format (JSR 202) are being done as a maintenance release of JSR 924. The specification for the JVM was published as the blue book, The preface states: We intend that this specification should sufficiently document the Java Virtual Machine to make possible compatible clean-room implementations. Oracle provides tests that verify the proper operation of implementations of the Java Virtual Machine.
VM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. JVMs are available for many hardware and software platforms java Java is a programming language and a platform. Java is a high level, robust, secured and object-oriented programming language. Platform: Any hardware or software environment in which a program runs, is known as a platform. Since Java has its own runtime environment (JRE) and API, it is called platform. Java Example class Simple{ public static void main(String args[]){ System.out.println("Hello Java"); } } Applications of java There are many devices where java is currently used. Some of them are as follows: 1. Desktop Applications such as acrobat reader, media player, antivirus etc. 2. Web Applications such as irctc.co.in, javatpoint.com etc. 3. Enterprise Applications such as banking applications. 4. Mobile 5. Embedded System
6. Smart Card 7. Robotics 8. Games etc. Types of Java Applications There are mainly 4 type of applications that can be created using java programming: 1) Standalone Application It is also known as desktop application or window-based application. An application that we need to install on every machine such as media player, antivirus etc. AWT and Swing are used in java for creating standalone applications. 2) Web Application An application that runs on the server side and creates dynamic page, is called web application. Currently, servlet, jsp, struts, jsf etc. technologies are used for creating web applications in java. 3) Enterprise Application An application that is distributed in nature, such as banking applications etc. It has the advantage of high level security, load balancing and clustering. In java, EJB is used for creating enterprise applications. 4) Mobile Application An application that is created for mobile devices. Currently Android and Java ME are used for creating mobile applications. Features of Java           Simple Object-Oriented Platform Independent secured Robust Architecture Neutral Portable High Performance Distributed Multi-threaded There is given many features of java. They are also known as java buzzwords. Simple According to Sun, Java language is simple because: Syntax is based on C++ (so easier for programmers to learn it after C++).java removed many confusing and/or rarely-used features e.g., explicit pointers, operator overloading etc. No need to remove unreferenced objects because there is Automatic Garbage Collection in java. Object-oriented Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour.Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance by providing some rules.
Basic concepts of OOPs are:       Object Class Inheritance Polymorphism Abstraction Encapsulation Platform Independent java is platform independent.A platform is the hardware or software environment in which a program runs.There are two types of platforms software-based and hardware-based. Java provides softwarebased platform. The Java platform differs from most other platforms in the sense that it is a software-based platform that runs on the top of other hardware-based platforms. It has two components:   Runtime Environment API(Application Programming Interface) Java code can be run on multiple platforms e.g. Windows, Linux, Sun Solaris, Mac/OS etc. Java code is compiled by the compiler and converted into bytecode. This bytecode is a platform-independent code because it can be run on multiple platforms i.e. Write Once and Run Anywhere(WORA). Secured Java is secured because:   No explicit pointer Java Programs run inside virtual machine sandbox how java is secured Classloader: adds security by separating the package for the classes of the local file system from those that are imported from network sources.Bytecode Verifier: checks the code fragments for illegal code that can violate access right to objects. Security Manager: determines what resources a class can access such as reading and writing to the local disk.These security are provided by java language. Some security can also be provided by application developer through SSL, JAAS, Cryptography etc.

Lecture Notes