Why compiler says illegal start of experssion?

Hi

I want to know that why compiler gives an error that saysillegal start of expression?

class makaay{

publicstaticvoidmain(String [] args){

privatevoid privateMethod(){

System.out.println("I am private method");}

void packageMethod(){

System.out.println("I am package method");}

protectedvoid protectedMethod(){

System.out.println("I am protected method");}

publicvoid publicMethod(){

System.out.println("I am public method");

} ;}}

Message was edited by:

vanpersie

[1370 byte] By [vanpersiea] at [2007-11-27 4:03:50]
# 1
> I want to know that why compiler gives an error that says illegal start of expressionYou can't have a method - like privateMethod() - declared inside another method like main().
pbrockway2a at 2007-7-12 9:08:39 > top of Java-index,Java Essentials,New To Java...
# 2
Dude,You are Defining methods inside main() method, that is why compiler gives error for the same! You can def inethis methods in class not in mail() method!
Nikksa at 2007-7-12 9:08:39 > top of Java-index,Java Essentials,New To Java...