The main() method has to be public because a PRIVATE method can not access thePUBLIC class and PUBLIC class members and member functions as a lower accessspecifier cannot access the one higher to it whereas vice-versa is possible.