Check out example codes for "error: can't find main(String[]) method in class: print". It will help you in understanding the concepts better.

Code Example 1

error: can't find main(String[]) method in class: print

Code Example 2

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");
    }
}

Learn ReactJs, React Native from akashmittal.com