1 / 17

Features of Java

Introduction of Java and the features of Java with simple example

virginmary
Download Presentation

Features of Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Features of Java Mrs. M. Virgin Arockia Mary Asst. Professor Department of Commerce with Computer Applications Arul Anandar College Karumathur Madurai.

  2. JAVA Java is a general purpose, object oriented programming language developed by Sun Microsystems of USA in 1991. Originally called Oak by James Goseling. Java was designed for the development of software for consumer electronic devices like TVs, VCRs and such other electronic machines. HotJava is a web browser to locate and run applet programs on internet which was developed with Java. HotJava demonstrated the power of the new language. In the year 1995 Oak was renamed as Java.

  3. Features of JAVA • Java has become a popular and useful programming language because of its excellent features, which play a very important role in contributing to the popularity of this language. The Java features are called “Java BuzzWords”. Simple, small Compiled and Interpreted Robust Features of Java High Performance Dynamic Distributed Secure Object Oriented Multithreaded Platform Independent , Portable

  4. Simple and Familiar • Compiled and Interpreted • Platform Independent • Portable • Object-Oriented • Robust • Secure • Distributed • Multi-threaded and Interactive • High Performance • Dynamic and Extensible

  5. Simple, Small and Familiar • Java is very easy to learn, and its syntax is simple, clean and easy to understand. Java syntax is based on C++ (so easier for programmers to learn it after C++). • Its coding style is very clean and easy to understand. It removes complexity because it doesn’t use complex and difficult features of other languages like C and C++. • Some of the features are: • Concept of Explicit Pointers • Storage classes • Preprocessors and header files • Multiple Inheritance • Operator Overloading • Goto Statements

  6. Compiled and Interpreted • Usually, a computer language can be either compiled or interpreted. Java integrates the power of Compiled Languages with the flexibility of Interpreted Languages. • Java compiler (javac) compiles the java source code into the bytecode. • Java Virtual Machine (JVM) then executes this bytecode and generates machine code that can be directly executed by the machine that is running the Java program.

  7. Platform Independent and Portable • The most significant feature of Java is that it provides platform independence which leads to a facility of portability, which ultimately becomes its biggest strength. A platform is the hardware or software environment in which a program runs. • Java program can be moved from one computer system to another, anywhere and anytime. Changes and upgrades in operating systems, processors and system resources will not force any changes in Java programs. • The Java compiler never converts the source code to machine code like that of the C/C++ compiler. Instead, it converts the source code into an intermediate code called the byte code and this byte code is further translated to machine-dependent form by another layer of software called JVM (Java Virtual Machine).

  8. Object oriented • Unlike C++ which is semi object-oriented, Java is a fully object-oriented programming language. Java strongly supports the concepts of Object-Oriented Programming due to which it is called a pure object-oriented language. Java supports major Object-Oriented programming features like Encapsulation, Abstraction, and Inheritance. Almost everything in Java is an object. All programs and data live within objects and classes. The object model in Java is simple and easy to extend.

  9. class IIIBcom { puplic static void main(String[ ] args) { int pages; float price; String author; DataInputStream dis=new DataInputStream(System.in); author = dis.readLine( ); Object

  10. Robust • Java is robust as it is capable of handling run-time errors, supports automatic garbage collection and exception handling, and avoids explicit pointer concept. • Java has a strong memory management system. It helps in eliminating errors as it checks the code during both compile and runtime. • Java also provides the concept of exception handling which identifies runtime errors and eliminates them. Java makes an effort to eliminate error prone codes by emphasizing mainly on compile time error checking and runtime checking.

  11. Example for Exception Handling class ArithmeticException_Demo { public static void main(Stringargs[]) throws IOException { try { int a = 30, b = 0; int c = a/b; // cannot divide by zero System.out.println ("Result = " + c); } catch(ArithmeticException e) { System.out.println ("Can't divide a number by 0"); } } }

  12. Secure • Security is an important issue for any programming language as there is a threat of malicious activities and viruses. Java supports access modifiers to check memory access and also ensures that no viruses enter an applet. • Java is a more secure language as compared to C/C++, as it does not allow a programmer to explicitly create pointers

  13. Distributed • Java is also a distributed language. Programs can be designed to run on computer networks. Java has a special class library for communicating using TCP/IP protocols. Creating network connections is very much easy in Java as compared to C/C++. • In Java, we can split a program into many parts and store these parts on different computers. A Java programmer sitting on a machine can access another program running on the other machine. • This feature in Java gives the advantage of distributed programming, which is very helpful when we develop large projects. Java helps us to achieve this by providing the concept of RMI (Remote Method Invocation) and EJB (Enterprise JavaBeans).

  14. High Performance • The performance of Java is impressive for an interpreted language because of its intermediate bytecode. • Java provides high performance with the use of “JIT – Just In Time compiler”, in which the compiler compiles the code on-demand basis, that is, it compiles only that method which is being called. This saves time and makes it more efficient. • Java architecture is also designed in such a way that it reduces overheads during runtime. The inclusion of multithreading enhances the overall execution speed of Java programs. • Bytecodes generated by the Java compiler are highly optimized, so Java Virtual Machine can execute them much faster.

  15. Multi Threading • Multithreaded means handling multiple tasks simultaneously. Java supports multithreaded programming. This means that we need not to wait for the application to finish one task before finishing another. • Java multithreading feature makes it possible to write program that can do many tasks simultaneously. Benefit of multithreading is that it utilizes same memory and other resources to execute multiple threads at the same time, like While typing, grammatical errors are checked along.

  16. Dynamic and Extensible • Java is dynamic and extensible means with the help of OOPs, we can add classes and add new methods to classes, creating new classes through subclasses. This makes it easier for us to expand our own classes and even modify them. • Java gives the facility of dynamically linking new class libraries, methods, and objects. It is highly dynamic as it can adapt to its evolving environment. • Java even supports functions written in other languages such as C and C++ to be written in Java programs. These functions are called “native methods”. These methods are dynamically linked at runtime.

More Related