Can you write code to sort the following string values naturally (i.e. in alphabetical order)? (JEE, Java, Servlets, JMS, JNDI, JDBC, JSP, and EJB)

Here is the sample code that makes use of the default compareTo( ) provided in the String class as it implements the Comparable interface and the Collections utility class that provides a sorting method, which internally uses the efficient “merge sort” algorithm. import java.util.Arrays; import java.util.Collections; import java.util.List;   public class Sort1 { public static … Read more

Illustrate – domain or value object class to compare different object fields in an equals method

cmd/designated folder/ jar cf name.jar *.* Create a file: META-INF/MANIFEST.MF Add a line: Main-Class: com.myco.calc.CalculatorDemo Include META-INF/MANIFEST.MF in calculator.jar Run with java -jar calculator.jar This is useful in domain or value object class to compare different object fields in an equals method public class DomainObject {   //protected because only inheriting domain classes can use … Read more

Difference between javascript and program

Difference between script and program: 1. A program has well defined structure, which must be followed even execute a single file. A script is a set of instructions (may be a single statement), which are complete in it-self. And execute independently as rest of the instructions. 2. Script is loose-type. It means variable’s data-type is not must. … Read more

Why Software Developers Choose Java

Java has been tested, refined, extended, and proven by a dedicated community. And numbering more than 6.5 million developers, it’s the largest and most active on the planet. With its versatility, efficiency, and portability, Java has become invaluable to developers by enabling them to: Write software on one platform and run it on virtually any … Read more

Learn About Java Technology

To date, the Java platform has attracted more than 6.5 million software developers. It’s used in every major industry segment and has a presence in a wide range of devices, computers, and networks. Java technology’s versatility, efficiency, platform portability, and security make it the ideal technology for network computing. From laptops to datacenters, game consoles to scientific supercomputers, cell phones … Read more