Two Laptop Bag
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "program" Watch "program" New topic


kumara swamy adurthi

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)
public static void main(int []args0
is this program compile ane execute successfully ? if yes wat is the answer and why . if no why.
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

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

Joined: Oct 02, 2003
Posts: 11952

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:
subject: program
It's not a secret anymore!