*
The moose likes Beginning Java and the fly likes Could someone tell me why my code will not run? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Could someone tell me why my code will not run?" Watch "Could someone tell me why my code will not run?" New topic
Author

Could someone tell me why my code will not run?

kenny gill
Ranch Hand

Joined: Mar 12, 2012
Posts: 54

I have my system.out.println() filled out but I can't run the console at all and I'm not sure why. Any help is appreciated



Main class:

Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

kenny gill wrote:
I have my system.out.println() filled out but I can't run the console at all


What exactly does "can't run the console" mean? You need to TellTheDetails(←click) because ItDoesntWorkIsUseless(←click).
kenny gill
Ranch Hand

Joined: Mar 12, 2012
Posts: 54

I meant that I can not choose the option 'run application' from Run-as. Sorry about that :S I'll format my question better next time I make a thread
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4344
    
    8

kenny gill wrote:I meant that I can not choose the option 'run application' from Run-as.

So you're using a specific IDE, then? Which one?

What IDEs are usually looking for to run a class as an application is an entry point - a public static void main(String[]) method. I don't see one in your code, so that's probably the problem.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

Your posted code is(are) two Java objects.

There is nothing to "run".

WP
Kristoffer Strijdonck
Greenhorn

Joined: Nov 10, 2012
Posts: 1

You have no main class.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Welcome to the Ranch

You mean no main method. Some people think it is poor style to have a class called Main. Other people think it is good style to have a class called Main. I am staying neutral, but never create classes called Main myself.
 
wood burning stoves
 
subject: Could someone tell me why my code will not run?
 
Similar Threads
Java method to output difference between two numbers as a comparison showing the highest number
Creating Objects without the "New" Keyword
SiMpLe Program but......I still beginner
Java Methods code. Someone help please
Arrays