Java Class Declaration

Developers store their program codes in a class.

Class Syntax:

[public or private] class ClassName
{
statements
}
where
public and private are the Access Modifiers
class indicates that it is a Class
ClassName indicates the Class Name
statements are the class codes

Only 1 public class can be defined in a *.java file. The ClassName name must be the same as the ClassName.java filename.

0 comments:

Post a Comment