No Output and No Errors


I have managed to install Java and try a few programs from the net. Everything seems fine, except that the outputs are not displayed. For all the different programs that I've tried, if there is an error, the output says so. If I correct it, then there is no output.
Instead, a file is created in the same folder, having the same name as that of my program, but I don't know which software to run it with as it doesn't open.



  • Hey,
    Sounds like you got a clean compile, which produces an "executable"
    file of the form [italic]pgm_name[/italic].class but then it was not run.

    The two steps to running a java file are:
    1) compile it, ie.
    [code]javac [italic]pgm_name[/italic].java[/code]
    2) then run it, ie.
    [code]java [italic]pgm_name[/italic][/code]

  • silveredge

    thank you so much. i didnt know it was that simple!

  • Ahh, that takes me back to my Java lectures at uni, I think i've forgot nearly everything about Java tho now. lol
  • Good day!

    I was wondering if you could please help me with another thing.

    Is it possible to write a program in java, asking the user to input n elements of an array, and then print its minimum using an array itself?
    I tried with maximum, and I got that:
    { for(int i=0;ilargest) largest=a[i];
    System.out.println("Largest number is " + largest);

    The same technique obviously doesnt work with minimum,
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!