aspose file tools
The moose likes Beginning Java and the fly likes program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "program" Watch "program" New topic
Author

program

kumara swamy adurthi
Greenhorn

Joined: Mar 16, 2005
Posts: 4
class p
{
static string="main with string[]args";
Static strint="main with int[]args";
public static void main(String [] args)
{
System.out.println(string);
}
public static void main(int []args0
{
System.out.println(strint);
}
}
is this program compile ane execute successfully ? if yes wat is the answer and why . if no why.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1815
Have you tried compiling it and seeing the result?

As it is, no, it won't compile. Why? The compiler's error messages will tell you why.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
Assignment question! Why not compile it yourself and see?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9946
    
    6

boy, that took me about 8 seconds to create the java file, compile it, run it (assuming it compiled), and determine the answer.


Never ascribe to malice that which can be adequately explained by stupidity.
Georgy Bolyuba
Ranch Hand

Joined: Feb 18, 2005
Posts: 162
You've got more then one error in your code.
Start to search.


SCJP 1.4 (100%) Done.<br />SCJD (URLyBird 1.2.3 Started)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: program
 
Similar Threads
a strange question
why is the System.out.println(); line displaying error when i type void method in it?
plz help me
pass by value for static
simple one??