Detail Explanation on Characteristics of Java Programming Language

What are Characteristics of java programming language elaborate ?  

Java programming language has following characteristics which make it little exceptional is programming languages.

 1. Simple                      2. Object Oriented            3. Robust                 4. Multithreaded   
5. Architecture-Neutral              6. Interpreted and High Performance        7. Distributed 
8. Security                     9. Portability           10. The ByteCode


Simple

  • Java was designed to be easy for the professional programmer to learn and use effectively.
  • Assuming that you have some programming experience, you will not find Java hard to master.
  • If you already understand the basic concepts of object-oriented programming, learning Java will be even easier. 
  • Best of all, if you are an experienced C++  programmer, moving to Java will require very little effort. Because Java inherits the C/C++ syntax and many of the object-oriented features of C++.

Object-Oriented

  • Objected  Oriented Programming (OOP) has the following principles:
  • Encapsulation
  • Inheritance
  • Polymorphism 
  • Java implements the principles of OOP therefore, it is known as objected oriented Programming Language. 

Robust

  • Robustness means to develop programs that can be operational in diverse conditions.
  • Java enables to create robust programs for the following reasons. 
  • Java restricts to find your mistakes early in program development because it is case sensitive. 
  • Java is a strictly typed language, it checks the code at compile time and at run time. 
  • Knowing that what you have written will behave in a predictable way under diverse conditions is a key feature of Java.
  • To better understand how Java is robust, consider two of the main reasons for program failure: 
  • memory management mistakes and 
  • mishandled exceptional conditions (that is, run-time errors). 
  • Memory management can be a difficult, tedious task in traditional programming environments. For example, in C/C++, the programmer must manually allocate and free all dynamic memory.
  • Programmers may either forget to free memory that has been previously allocated or, worse, try to free some memory that another part of their code is still using
  • Java virtually eliminates these problems by managing memory allocation and reallocations. 
  • In fact, reallocation is completely automatic, because Java provides garbage collection for unused objects.
  • Exceptional conditions in traditional environments often arise in situations such as division by zero or “file not found,” and they must be managed with clumsy and hard-to-read constructs. 
  • Java helps in this area by providing object-oriented exception handling. 
  • In a well-written Java program, all run-time errors can—and should—be managed by the program.
Multithreaded
  • In multithreaded programs multiple active segments are executed simultaneously. 
  • Java supports multithreaded programming, which allows you to write programs that do many things simultaneously. 
  • The Java enables to construct smoothly running interactive systems by the implementation of its feature of Multithreaded programming. 
Architecture-Neutral 
  • A Central issue for the Java designers was that of code durability and portability. 
  • One of the main problems facing programmers is that no guarantee exists that if you write a program today, it will run tomorrow—even on the same machine. 
  • Operating system upgrades, processor upgrades, and changes in core system resources can all combine to make a program malfunction. 
  • The Java designers made several hard decisions in the Java language and the Java Virtual Machine in an attempt to alter this situation. 
  • Their goal was “write once; run anywhere, any time, forever.” To a great extent, this goal was accomplished in JAVA.

Interpreted and High Performance
  • Java uses both compiler and Interpreter.
  • Compiler translates source code of the java program into the bytecode. 
  • Byte code is a specialized compiled version of the source code.
  • Java virtual machine (JVM) provides interpreter for executing bytecode. 
  • Java enables the creation of cross-platform programs by compiling into Java bytecode. 
  • This code can be executed on any system that implements the Java Virtual Machine

Security   

  • Java enables applets to be downloaded and executed on the client computer safely, it was necessary to prevent an applet from launching attacks on local computer like virus.
  • Java achieved this protection by restricting an applet to the Java execution environment and not allowing it access to other parts of the computer. 
  • The ability to download applets with confidence that no harm will be done and that no security will be breached is considered by many to be the single most innovative aspect of Java

Portability 

  • Java enables to develop portable applications that can run on different operating system platforms and hardware architectures. 
  • Portability is a major aspect of the Internet because there are many different types of computers and operating systems connected to it. 
  • If a Java program were to be run on virtually any computer connected to the Internet, there needed to be some way to enable that program to execute on different systems.  
  • For example, in the case of an applet, the same applet must be able to be downloaded and executed by the wide variety of CPUs, operating systems, and browsers connected to the Internet
  • It is not practical to have different versions of the applet for different computers. 
  • The same code must work on all computers. Therefore, some means of generating portable executable code was needed
The Bytecode

  • The key that allows Java to solve both the security and the portability problems is that the output of a Java compiler is not executable code. Rather, it is bytecode.
  • Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called the Java Virtual Machine (JVM). 
  • In essence, the original JVM was designed as an interpreter for bytecode. 
  • Java program is executed by the JVM helps solve the major problems associated with web-based programs.
  • Translating a Java program into bytecode makes it much easier to run a program in a wide variety of environments because only the JVM needs to be implemented for each platform. 
  • Once the run-time package exists for a given system, any Java program can run on it. 
  • The details of the JVM will differ from platform to platform, all understand the same Java bytecode. 
  • If a Java program were compiled to native code, then different versions of the same program would have to exist for each type of CPU connected to the Internet. 
  • This is, of course, not a feasible solution. 
  • Thus, the execution of bytecode by the JVM is the easiest way to create truly portable programs.
  • The fact that a Java program is executed by the JVM also helps to make it secure. Because the JVM is in control, it can contain the program and prevent it from generating side effects outside of the system. 
  • When a program is compiled to an intermediate form and then interpreted by a virtual machine, it runs slower than it would run if compiled to executable code.
  • However, with Java, the differential between the two is not so great. Because bytecode has been highly optimized, the use of bytecode enables the JVM to execute programs much faster than you might expect.
  • Sun began supplying its HotSpot technology which provides a Just-In-Time (JIT) compiler for bytecode. 
  • When a JIT compiler is part of the JVM, selected portions of bytecode are compiled into executable code in real time, on a piece-by-piece, demand basis. 
  • It is important to understand that it is not practical to compile an entire Java program into executable code all at once, because Java performs various run-time checks that can be done only at run time
  • Instead, a JIT compiler compiles code as it is needed, during execution. 
  • Furthermore, not all sequences of bytecode are compiled—only those that will benefit from compilation. 
  • The remaining code is simply interpreted. However, the just-in-time approach still yields a significant performance boost.
  • Even when dynamic compilation is applied to bytecode, the portability and safety features still apply, because the JVM is still in charge of the execution environment


          Thank you for visiting this blog as our sole purpose is to help students to study 
                so do share this blog and blog posts with your fellows and help them to study
                  freenotesforstudy.blogspot.com a helping hands creating platform for students to study to build better career, understanding in academics, preparation for exam help                                                                   everyone to get success .    
                        

 

Post a Comment

2 Comments

Dipteek said…
WOW, nice post on your website. I am also teach inheritance in java. I think java is a simple language.
David Mitchell said…
Java is a versatile programming language with several key characteristics that make it exceptional. Let's explore each characteristic in detail:

Simple: Java was designed to be easy for professional programmers to learn and use effectively. If you have some programming experience, you will find it relatively easy to master. Additionally, Java's syntax and object-oriented features inherited from C++ make it even easier for experienced C++ programmers to transition to Java.

Object-Oriented: Java is known as an object-oriented programming language because it implements the principles of OOP, including encapsulation, inheritance, and polymorphism. This enables the creation of modular and reusable code.

Robust: Java enables the development of robust programs in diverse conditions. It provides early error detection at both compile time and runtime, along with strict typing. Memory management is simplified through automatic garbage collection, preventing memory leaks and errors. Java also offers object-oriented exception handling, allowing run-time errors to be properly managed within the program.

Multithreaded: Java supports multithreaded programming, allowing programs to execute multiple active segments simultaneously. This feature is particularly useful in developing smoothly running interactive systems.

Architecture-Neutral: Ensuring code durability and portability was a central concern for Java designers. They aimed for "write once, run anywhere" by making the Java language and Virtual Machine architecture-neutral. Java programs compiled into bytecode can be executed on any system that implements the Java Virtual Machine, achieving platform independence.

Interpreted and High Performance: Java combines the benefits of both a compiler and an interpreter. The source code is compiled into platform-independent bytecode, which is executed by the Java Virtual Machine. Java bytecode is highly optimized and can be dynamically compiled into executable code by Just-In-Time (JIT) compilers, providing good performance.

Distributed: Java has built-in features for developing distributed systems. It includes libraries and APIs for remote method invocation (RMI), networking, and distributed computing, making it easier to build applications that can communicate across a network.

Security: Java was designed with security in mind, enabling the execution of applets on client computers safely. Applets are restricted to the Java execution environment and do not have access to other parts of the computer, preventing malicious activities. Java's strong security measures ensure that applets can be downloaded and executed with confidence.

Portability: Java enables the development of portable applications that can run on different operating systems and hardware architectures. This is essential in the diverse world of the Internet, where different types of computers and operating systems are connected. The ability to execute the same Java code on various systems without modification greatly enhances its portability.

The Bytecode: Java compiles source code into bytecode, a highly optimized set of instructions executed by the Java Virtual Machine. This intermediate form allows for platform independence, as only the JVM needs to be implemented for each system. Bytecode execution by the JVM also enhances security, as the JVM can contain the program and prevent it from causing side effects outside the system.

These characteristics make Java a popular and widely-used programming language, offering developers flexibility, ease of use, security, and cross-platform compatibility.