I was trying out the following code as a complete newcomer to Java in particular and programming in general.
As I understand it args refers to the name I have given to the public class file, in this case sgra. So if the figure to the right of '>' is 5 or greater it shouldn't print hello, however it does. If you have any light you can shed upon this dark matter it would be much appreciated.
I am afraid you have misunderstood args.
When you compile that class and run it, you can do so like this
myPrompt:> javac sgra.java
myPrompt:> java sgra This is the command-line arguments array, which you call args inside your class
. . . whatever you write after the name of the class passes on to the main method, divided into an array of Strings. In the main method you call it args.
You print "Hello" regardless, because that line is not inside the if test.
More information here, under "command-line arguments".