This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Test Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Test Class" Watch "Test Class" New topic

Test Class

Rupinder Bains
Ranch Hand

Joined: Jul 23, 2002
Posts: 65
Hiya Everyone,
You all must know that I am useless at Java by now. :roll:
BUT... How do you test a class using a console display. BUT CANNOT inplement a GUI.
Thank You
Donald R. Cossitt
Ranch Hand

Joined: Jan 31, 2003
Posts: 401
The simplest way is from a command line in your DOS console make sure you change directory to the directory your class / java files are in then type: java whatevereFileName <enter>.
EG. C:\javaProjects\Testing> java myTestFile <enter>
Case is important.
Are you familiar with DOS 'cd' command?

subhit chauhan
Ranch Hand

Joined: Jun 20, 2002
Posts: 40
put system.out.println() where ever you want to debug you java class....
Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
hi Rupinder
Which Operating System you use?
If you use Unix system, you can choose the console to display the statement which you use the System.out.println("") to print it out.
And I agree subhit that can use it to debug in some situations.
System.out.println("") default output is in console

Francis Siu
subhit chauhan
Ranch Hand

Joined: Jun 20, 2002
Posts: 40
For application prog. its command prompt in windows... but for applets its java console..
No idea about Unix
subject: Test Class
It's not a secret anymore!