Q:

Error :: Main method not found in class

When I run my code, I receive this error message:
Error: Main method not found in class "Class name", please define the main method as:
   public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

My code:
public static void main(String[] args){
    public void printPhoto(int width,int height, boolean inColor){
        System.out.println("Width = " + width +  " cm" );
        System.out.println("Height = " + height + " cm");
        if(inColor){
            System.out.println("Print is Full color.");
        } else {
            System.out.println("Print is black and white.");
        }
        printPhoto(10,20,false);
    }
}

A:

To start a java program you need the main method which not define in your code you can make it like this :
public class Test {

    public void printPhoto(int width, int height, boolean inColor) {
        System.out.println("Width = " + width + " cm");
        System.out.println("Height = " + height + " cm");
        if (inColor) {
            System.out.println("Print is Full color.");
        } else {
            System.out.println("Print is black and white.");
        }
        // printPhoto(10, 20, false); // Avoid a Stack Overflow due the recursive call
    }

    //main class
    public static void main(String[] args) {
        Test tst = new Test();//create a new instance of your class
        tst.printPhoto(0, 0, true);//call your method with some values        
    }

}

