Search Results

Search found 1 results on 1 pages for 'andrew0085'.

Page 1/1 | 1 

  • Question about main(String[] args) [migrated]

    - by Andrew0085
    I'm new to programming, and I'm using java. Here's a program I wrote: class HelloApp { static String hi; public static void main(String[] args) { int length = args.length; if (length > 0) { hi = args[0]; sayHi(); } } static void sayHi() { if (hi == "hello") { System.out.println("Hello!"); } } } My question is: Why doesn't inputting "java HelloApp hello" make "Hello!" appear on the next line?

    Read the article

1