How to Create Public Class in Java


In this example we will show the method to create public class in Java.

Source Code

package com.beginner.examples;

public class PublicClass { // public
  public static void main(String[] args) {
    System.out.println("OK!");
  }
}

Output:

OK!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments