can not find main method java code example

Example 1: can't find main(String[]) method in class

first write main class firfirst write main class first that have public static void main with its all content  then other classesst that have public static void main with its all content  then other classes

Example 2: can't find main(String[]) method in class

class TapeDeckcTestDrive{
    public static void main(String[] args){
        TapeDeck t = new TapeDeck();
        t.canRecord = true;
        t.playTape();

        if (t.canRecord == true) {
            t.recordTape();
        }
    }
}

class TapeDeck {
    boolean canRecord = false;
    void playTape(){
        System.out.println("tape playing");
    }
    void recordTape(){
        System.out.println("tape recording");
    }
}

Tags:

Java Example