|
Java Reference Home | Smart Soft Home |
|
|
Period .
Generally, the period is used as separator.
Description 1Used to access an instance variable. The period separates an object name from a variable name.Example 1r1.length = 10; Description 2Used to access a class variable. The period separates the class name from a variable name.Example 2Room.count = 10; Description 3Used to invoke an instance method. The period separates an object name from a method name.Example 3r1.print(); Description 4Used to invoke a class method. The period separates the class name from a method name.Example 4int i = Integer.parseInt(s); Description 5Used to separate package names from each other and from class names. In the following code snippet, java and awt are package names and Frame is a class name.Example 5
java.awt.Frame f1 = new java.awt.Frame("My Frame");
|
|