permaculture playing cards*
The moose likes Java in General and the fly likes Program execution discrepancies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Program execution discrepancies" Watch "Program execution discrepancies" New topic
Author

Program execution discrepancies

Olakunle Oladipo Oni
Greenhorn

Joined: Aug 28, 2008
Posts: 18
I'm presenting two sample java code here...I'll appreciate if someone can give me an explanation at getting the expected outcome I believe there's something i need to learn here...

code sample one


I had no problem with compiling this code. I ran it as well. It didn't give any visible error or exception but nothing was printed out which is against my explanation. I supplied the appropriate runtime arguement as indicated in the code yet it ran(as it were) and printed nothing. How can this code print the text indicated?

code sample two


Just like the first sample, this code compliled successfuly. At runtime, i supplied the appropriate arguement to show successful payroll processing but no matter the arguements i supplied i keep getting only "Error...exiting". How do i get around this?


olakunle oni
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

Never ever ever use == to compare Strings, use the equals method:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Olakunle Oladipo Oni
Greenhorn

Joined: Aug 28, 2008
Posts: 18
I appreciate your response. This is the advantage of forums like this. I just saw something i overlooked...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Program execution discrepancies