1

/*getting error (Expected ';') after priyanka() method Why is this Error Occuring */

public class methodsPractise {
    public static void main(String[] args) {
        void priyanka() {
            System.out.println("so practice is good"); 
      }
    }
}
mobile gaming
  • 109
  • 1
  • 1
  • 4

1 Answers1

0

try this code

public class methodsPractise {
    public static void main(String[] args) {
        priyanka();
    }
    public static void priyanka() {
        System.out.println("so practice is good"); 
    }
}

You can't declare method inside method.