JAVA- Thought for the day: PUBLIC Class constructor

  • Post author:
  • Post category:Java

Ever wondered why your Java assignment runs accurately in your local environment but will not work in a different test environment when submitted ?

One of the many basic reasons is the missing keyword PUBLIC before the class Constructor.
public is a Java keyword which declares a member’s access as public. Public members are visible to all other classes used in the test environment.
Students taking Java courses must ensure that you make the class PUBLIC before submission, unless specified otherwise.