Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
No Output and No Errors Posted by sidrashakeel on 19 Jul 2010 at 3:08 AM
hello

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.

Thanks
Report
Re: No Output and No Errors Posted by silveredge52 on 19 Jul 2010 at 4:50 AM
Hey,
Sounds like you got a clean compile, which produces an "executable"
file of the form pgm_name.class but then it was not run.

The two steps to running a java file are:
1) compile it, ie.
javac pgm_name.java

2) then run it, ie.
java pgm_name



regards
Report
Re: No Output and No Errors Posted by sidrashakeel on 19 Jul 2010 at 5:33 AM
silveredge

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


Report
Re: No Output and No Errors Posted by SGater on 20 Jul 2010 at 3:55 AM
Ahh, that takes me back to my Java lectures at uni, I think i've forgot nearly everything about Java tho now. lol
Report
Re: Another Doubt please! Posted by sidrashakeel on 8 Aug 2010 at 8:15 AM
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;i<n;i++)
if(a[i]>largest) largest=a[i];
System.out.println("Largest number is " + largest);
System.exit(0);}

The same technique obviously doesnt work with minimum,
Thanks!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.