# Java Programs
➤ Introduction to Java
➤ Java Editions & Concepts
➤ JDK JRE JVM JIT in Java
➤ How to Run Java program
➤ Java Hello World program
➤ How to set the Java path
➤ Classpath Environment
➤ Tokens in Java Language
➤ List of Java Keywords
➤ Identifiers in Java
➤ Data types in Java
➤ Float & double in Java
➤ Literals in Java
➤ Escape Sequence In Java
➤ Unicode character set
➤ String data type in Java
➤ Arithmetic operators in Java
➤ Increment and Decrement
➤ Comments in Java
➤ Java Naming Conventions
➤ Static Import in Java
Pros and Cons of Java Language | Java is a simple, secure, high-level, platform-independent, multithread, Object-oriented programming language. Java was developed by SUN microsystems, Inc. (Sun for short) for developing internet-based, high-performance, distributed, dynamically extensible applications. Oracle Corporation acquired Sun microsystems on January 27, 2010; Now, Java is owned by Oracle Corporation. Java was invented by James Gosling.
Java has its own software-based platform called JVM (Java virtual machine) to execute the programs. Java is a programming language because it provides its own syntaxes and semantics for developing new programs. It is a platform because it provides its own execution environment called JVM. It’s one of the most popular and widely used programming languages.
Java is one of the most popular programming languages widely used in desktop and web application development. As Java developers, we need to consider many factors which will help us have a clear vision of Java language.
- Advantages of Java Programming Language
- Disadvantages of Java Programming Language
Advantages of Java Programming Language
Java is a very simple programming language since it is easy to learn and easy to understand. From the learning point of view, Java is simple because it has a similar syntax to C/C++ programming languages. From the development point of view, Java is simple because it provides a rich set of pre-defined libraries (API). Using these huge pre-defined libraries API we don’t need to write more code. Hence development becomes easy for us.
Java is secure from the code point of view because Java-compiled code doesn’t execute directly. Before its execution, the Bytecode verifier verifies the bytecode. If there will be any malicious code or virus then execution will be terminated.
From the data point of view, it is secure because it has accessibility modifiers and encapsulation. Using access modifiers ( private, public, default and protected ) we can hide the direct access of the data, available in one program to another program. Or, we can provide data access to another program via a method that is incapsulation.
3. Open Source
Java is open-source software. It is freely available to download. Its source code is available for programmers either for reading or modification. Any third-party company or programmer can suggest and add more functionalities to the software.
Java is an object-oriented programming language. Every program in Java develops around an object by using a concept called class. It also helps us to increase security by binding the data and functions into a single unit and not letting it be accessed by the outside world. Every class-based programming language is an object-oriented programming (OOP) language.
In Java, to convert byte code to machine language code and further execute this machine language code, inside JVM the interpreter is used. Java program is executed by an interpreter so, Java is called interpreted programming language.
Java is a robust programming language since it uses strong memory management. It is strong in type checking and terminating functions safely. Java is a strictly typed checking language, it does not allow storing high-range value in a lesser range variable. The main features that make it robust are Exception handling, garbage collection, and memory allocation.
Java terminates function safely. It guarantees fail-safe by using an exception-handling mechanism. With exception-handling mechanisms, we can stop terminating program execution and save the results. When the execution of a program failed then the program doesn’t terminate immediately and we don’t lose the value generated in the previous lines.
Java is a portable language due to its platform independence feature. One Java program written in one computer can run in a different operating system. Java program is portable because their memory size is fixed across all operating systems and processors. Hence, we get the same result on all platforms. It can run in any operating system because of its platform-independency nature.
8. High Performance
Due to the multithread nature and JIT compiler, Java programs execute fast and give high performance. Java architecture is designed to reduce overheads.
Java is a multithreaded programming language. In Java, we can execute multiple tasks concurrently. Multithreading is one of the Java features, and it allows concurrent execution of two or more parts of a program for maximum utilization of the CPU. at long last time showed up to become familiar with the ideas of Multithreading in Java.
Java is a distributed language. The Java program placed in one computer can be accessed via the network from another computer directly from a program. Objects on one Java virtual machine (JVM) can execute procedures on a remote JVM.
Java can be used to create distributed applications, the EJB (Enterprise Java Beans) and RMI (Remote Method Invocation) are used for this purpose. Moreover, Java also supports Socket Programming and CORBA technology that helps us to share objects in a distributed environment.
11. Dynamic Natural
Java is a dynamic programming language. From the memory point of view, Java can allocate multiple copies of memory for the same variable at the execution time by using a new Keyword. Also from the functionality point of view, Java is dynamic.
Once we develop the project then we can add more features and modify existing features dynamically without modifying the source code. It is possible because of the OOP concept, inheritance, and polymorphism.
12. Architectural Natural
Java is a platform-independent language. Irrespective of other computer hardware, software devices, and operating systems Java programs can run in any computer and in any operating system because of Java virtual machines (JVM).
13. Garbage Collector
Java is an automatic memory management programming language that is managed by the Java Virtual Machine(JVM). It doesn’t provide the methods like delete() and free() to free the memory. In Java we need not destroy object memory, it is automatically destroyed by a special program called a garbage collector.
Disadvantages of Java Programming Language
Java needs to be interpreted during runtime, which allows it to run on every operating system, but it also makes it perform slower than the languages like C and C++. This slow performance is due to the extra level of compilation and abstraction by the JVM. Moreover, sometimes the garbage collector leads to the poor performance of Java as it consumes more CPU time
The default look of GUI applications written in Java utilizing the Swing toolbox is very not quite the same as local applications. There are many popular frameworks such as Swing, SWT, JavaFX, and JSF for creating GUI. But they are not mature enough to develop a complex UI. And if you want to choose one, you need to perform a lot of research.
3. No Backup Facility
Java mainly works on storage and does not focus on the backup of data. This is one of the essential Java drawbacks, making it lose interest and rating amongst users.
4. Memory Space
Java requires a significant or major amount of memory space as compared to other languages like C and C++ since it runs on top of a Java virtual machine. During the execution of garbage collection, the memory efficiency and the performance of the system may be adversely affected.
5. Verbose and Complex Codes
Java codes are verbose, implying that there are numerous words in them and there are numerous long and complex sentences that are hard to peruse and comprehend. This can reduce the readability of the code. Java focuses on being more manageable but at the same time, it has to compromise it with overly complex codes and long explanations for each thing.
Java programming language is a bit costly due to its higher processing and memory requirements. Hence, it’s not suitable and affordable to work with Java because it needs a better hardware system which is very expensive.
7. Less machine interactive
This is because Java makes the machine less viable for the software, which needs to run quickly and directly with the machine, as explicit pointers are also missing in Java.