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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
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: 10911
    
  12

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


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
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://aspose.com/file-tools
 
subject: program
 
Similar Threads
pass by value for static
a strange question
plz help me
simple one??
why is the System.out.println(); line displaying error when i type void method in it?