• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pls help with #5

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so i wrote out the simple code for a multiplication table ok. I am almost positive that its correct. Now i keep geting the following error when i try and run it:
Exception in thread "main" java.lang.NoSuchMethodError: main
I have been cing this for 2 days now. Somebody help me!!!
It is soo bad that all i have in main is the following line:
System.out.println("hello") and it still did'nt work.
I can put the code up too if u like or just e-mail me and I'll send u the code.
 
Ranch Hand
Posts: 111
jQuery Oracle C++
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not really sure but does your main look similiar to this

Amber
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You started with this page, right? Did the sample "HelloWorld" compile and run ok?


[This message has been edited by Marilyn deQueiroz (edited May 24, 2001).]
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for moving this back Marilyn. I acted too hastely by removing it. I should have checked out that #5 referred to assignment Java-5 (Times).
Again my apologies.
For those of you that wont quite understand what I'm about here.
I removed this thread, thinking it did not belong here. Sumant subsequently e-mailed me stating that he was doing the assignments without having them nitpicked. Which means off course that his thread had all right to be here.

[This message has been edited by Johannes de Jong (edited May 24, 2001).]
 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marylin
I like increasing the font size inside of the code. I'll have to remember that next time.
 
Johannes de Jong
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah good one . Never knew you could size=+0 either.
 
sumant suri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I managed to do all the programs till 5 just fine. Now 5 and 6 both give me the same error. I'm positive that my logic is fine 'cause i ran it in C++ and the logic part works just fine.

Originally posted by Marilyn deQueiroz:
[B]You started with this page, right? Did the sample "HelloWorld" compile and run ok?


[This message has been edited by Marilyn deQueiroz (edited May 24, 2001).][/B]


 
sumant suri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey
the code really looks like
public Times
{
public static void main( )
{
//code in main goes here
}
}
I took the String[] args out because i was not taking an input. LIke all i am supposed to type is : java Times
i dont know if that could be the problem but it did'nt work when i tried it with the String[] args in it.
Sumanth

Originally posted by Amber Woods:
Not really sure but does your main look similiar to this

Amber


 
Amber Woods
Ranch Hand
Posts: 111
jQuery Oracle C++
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tested to see if I could get the error you refered to and I found that I got the error when I capitalized the word main in:
This statement caused the error for me:
public static void Main( String[] args )
This statement didn't:
public static void main( String[] args )
I can't think of anything else could be. Hope that helps
Amber
 
Amber Woods
Ranch Hand
Posts: 111
jQuery Oracle C++
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just noticed your last post after I just posted.
Anyway, I tested your statement and it does need the String[] args in there otherwise you will get the error you specified.
Amber
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only main() method that the java compiler recognizes is the one that has the String[] args in the parameters. Otherwise it doesn't know where to start.

public static void main( String[] args )

(although Sun knows that you can use other access modifiers like private or protected, the compiler requires everything else in this method signature to work).
reply
    Bookmark Topic Watch Topic
  • New Topic