Ticker

6/recent/ticker-posts

How to write an Empty Student Class?

This is how a simple class is written in Java (We will learn more about classes in detail in later sections).


Note the spellings of publicclass and Student.
public and class are keywords in Java and hence are written in lowercase.

However the class name, which in this case is Student should always start with a capital letter.

Note: Keywords are words which have special meaning in a programming language. In Java all keywords are in lowercase.

See the code available on the left and retype the code with same case and spaces as in the original code.

Note: In line 2 the empty space (·) which is visible actually has a tab character ( ), which is automatically inserted when we open a brace and hit enter (¬). It should not be removed in the code you type.

Note: Please don't change the package name.

Package :- q10737.


package·q10737;¬
public·class·Student·{¬
————¬
}

Post a Comment

0 Comments