i have some problems with methods
see in my code i am using a simple method but the compiler is showing strange errors
ERRORS: its in the void ship () statementimport java.util.Scanner; class apple { public static void main(String args[]) { int i,j; Scanner input = new Scanner(System.in); int ship1[][]= new int[6][6],ship2[][]=new int[6][6]; public void ship() // error in this statement { for(i=0;i<6;i++) { System.out.println(""); for(j=0;j<6;j++) { System.out.print("*"); } } } } }
Multiple markers at this line
- Syntax error, insert "enum Identifier" to complete
EnumHeaderName
- Syntax error on token "void", @ expected
- Syntax error, insert "EnumBody" to complete BlockStatement
so can any1 guide me to rectify this problem