Why should I choose Java for Software Development? What are Pros and Cons of Java?

By | August 12, 2019

In this blog post we will talk about Why should I choose Java for Software Development? What are Pros and Cons of Java? This tutorial talks about all the java Pros and Cons.

Java Pros

  1. As you know Java is free, you download it and start creating your own desktop or web applications
  2. Plenty of third-party libraries, frameworks & IDE for faster development (Spring, Spring boot, Hibernate, Eclipse, intelliJ etc..)
  3. Java is platform independent that’s what it is called write once run on most modern platform (Windows, Unix, Mac, 32/64-bit Hardware)
  4. Java supports Object Oriented Programming so it is easy to model real life scenarios into object model
  5. In built support for multi-threading & concurrency, it’s easy to write scalable applications in Java that can utilize multi-core processors, clusters of machines, distributed RAM, etc. There is in built support for Threads, non-blocking algorithm using CAS, Stream API, Parallel Streams, CompletableFuture, Parallel Array Operations, Atomic Values etc.
  6. Very good support for Internationalization
  7. Memory management is automatic by use of garbage collector (G1, Concurrent Mark Sweep, parallel garbage collector, etc)
  8. Pure Java Byte code running on 32 bit JVM works perfectly fine on 64 bit platform
  9. From java 8 onwards we have functional interfaces & lambda expressions introduced that makes code writing an easy. Specifically dealing with Collections is easy in Java 8.

For example, if you want to sort a collection of people with last name, first name and e-mail then we can make use of java 8 as below

Stream<Person> people = Stream.of(new Person(), …);
people.sorted(Comparator.comparing(Person::getLastName) .
thenComparing(Person::getFirstName).thenComparing(Person::getEmail,Comparator.nullsLast(String.CASE_INSENSITIVE_ORDER))) .forEach(System.out::println);

Java Cons

  1. Java is not a good fit for desktop applications because of heavy memory footprint and huge VM startup time compared to ay C/C++ written application
  2. Normal java is not considered good for real time systems because of “stop the world garbage collector pauses”.

What is stop-the-world?

Stop-the-world means that the JVM stops working the application from running to execute a GC. When stop-the-world occurs, every thread except for the threads needed for the GC will pause their tasks. The paused tasks will resume only after the GC task has completed. The term GC tuning means reducing this stop-the-world time.

You may also like:

Can we call static method with null object?
Can we override static method in Java?
What will be the output of following java program?
What is the difference Between java.util.Date and java.sql.Date in Java ?
What is difference between using Serializable & Externalizable Interfaces in Java?
Which Java data type would you choose for storing sensitive information, like passwords, and Why?

That’s all about  Why should I choose Java for Software Development? What are Pros and Cons of Java?

If you have any feedback or suggestion please feel free to drop in below comment box. 

Leave a Reply

Your email address will not be published. Required fields are marked *