• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

program

 
kumara swamy adurthi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
K Riaz
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assignment question! Why not compile it yourself and see?
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12100
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
boy, that took me about 8 seconds to create the java file, compile it, run it (assuming it compiled), and determine the answer.
 
Georgy Bolyuba
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've got more then one error in your code.
Start to search.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic