What is the correct way to define a class in Java?

Last Updated :
Discuss
Comments

What is the correct way to define a class in Java?


public Example {}

class Example {}

void Example {}

object Example {}

Share your thoughts in the comments