Today's Question:  What are you most afraid of as a programmer?        GIVE A SHOUT



  Different ways to print "Hello world" in Java

This post is not about best practice to print "Hello world" in Java, it is about exploring different capabilities offered by Java. Also there are articles about printing "Hello world" in different programming languages, but this post is not about that. Standard literal The most commonly used way is to use System.out to print"Hello world". System.out.println("Hello world"); Enumeration An enumeration can define a set of values belonging to one category. For example, an enumeration for all months ...

3,206 0 0          JAVA FEATURE

  Run executable jar on double click on Windows

Normally after installing Java, there will be an association between .jar and the javaw.exe. This enables the executable jar to be opened on double click. You can check the association by going to Control Panel -> Programs -> Default Programs -> Associate a file type or protocol with a program. The default program of a file type can be changed in this dialog. However sometimes there are cases where the file association for .jar may be altered after a third party application instal...


  How many programmers does it take to screw in a lightbulb?

There seem to be a lot of “How many programmers does it take to screw in a lightbulb?” jokes floating around the Internet, but none aimed specifically for us SQA folk.  I have decided (perhaps mistakenly) that this is no longer acceptable.  If this decision is a mistake, I'm sure that someone else in QA will report it up as a bug and assign it to me.  For better or worse, there is now an SQA set of these jokes, thanks to me.  Now, without further ado, let the pun...

1,287 0 0         

  Launch Java process programmatically in Java

In some cases while working on some automation testcase, developers would like to launch Java process programmatically so that the tests can be ran without manual intervention. Java provides such methods to achieve this. ProcessBuilder can be used to build a Java process which can be launched when everything is ready. Basically it can take a list of parameters which are similar to the command line options/arguments.  For example, if you want to launch a Java process, you can do followi...


  Different module types in Java 9

Java 9 is going to introduce a disruptive change to the Java platform -- Module System. The module system will change how Java applications work in the future. It's like changing the foundation of a house without impacting the house functionality and its top level structure. This obviously is a big challenge for the whole Java community.  To bring as little pain as possible to migrate existing applications to Java 9 without refactoring the whole application, Java 9 will introduce a few diff...


  String intern in Java

In Java, == is used to compare whether two objects have the same memory location, equals() is usually used to compare whether two objects have the same time and the same state.  When comparing two strings, normally we just want to know whether they have same content, so we can choose equals(). But since String comparison is so frequently needed, Java has worked on the String class to make == workable when comparing two String literals. The String class maintains a pool of emp...

1,168 0 0          JAVA STRING

  New features in Java 9

Java 9 is planned to be released in March 2017. It will be 3 years since Java 8 was released. Are you still excited about the new features introduced in Java 8 such as Lambda, new Date APIs etc? Now Java 9 is to be released and there are also quite a few fantastic new features to be introduced. Below is a list of major new features in Java 9. Modular system. Java 9 will introduce a brand new modular system to organize Java codes. The modular system will divide different packages into diffe...

12,823 4 0          JAVA NEW FEATURE JAVA 9

  JShell -- The command line tool to run Java code in Java 9

Java 9 is currently a work-in-progress and is planned to be GAed in March 2017. Quite a few new features will be introduced in the new release. The coolest feature is project Jigsaw which is to modularize the Java packages so that a customized JDK can be built and shipped with only the necessary modules to fulfill their project requirement. Apart from this feature, another big new feature is project Kulla -- JShell. In simple, JShell is a command line tool which can be used to run...

13,332 8 0          JAVA 9 JSHELL KULLA