Difference between revisions of "Team1/Creating a Java class"

From CDOT Wiki
Jump to: navigation, search
(Creating a Java class inside a package)
Line 2: Line 2:
  
 
1.1. Go to the "src" folder in your package and right click on it, then select: ''New -> Class''<br/>
 
1.1. Go to the "src" folder in your package and right click on it, then select: ''New -> Class''<br/>
[[Image:newclass1.jpg | 600px]]
+
[[Image:newclass1.jpg |1000px]]
  
 
<br/>1.2. In the ''New Java Class'' window, write down your class name, e.g."VehicleRegistration" and check the ''public static void main(String[] args)''. Press Finish to close the window.<br />
 
<br/>1.2. In the ''New Java Class'' window, write down your class name, e.g."VehicleRegistration" and check the ''public static void main(String[] args)''. Press Finish to close the window.<br />
[[Image:newclass2.jpg | 600px ]]
+
[[Image:newclass2.jpg |1000px ]]
  
 
<br/>1.3. The following code will be the content of the ''VehicleRegistration'' class in ''cs.ecl.basics.lab'' package.<br />
 
<br/>1.3. The following code will be the content of the ''VehicleRegistration'' class in ''cs.ecl.basics.lab'' package.<br />
[[Image:newclass3.jpg | 500px ]]
+
[[Image:newclass3.jpg |1000px ]]

Revision as of 13:31, 29 January 2011

Creating a Java class inside a package

1.1. Go to the "src" folder in your package and right click on it, then select: New -> Class
Newclass1.jpg


1.2. In the New Java Class window, write down your class name, e.g."VehicleRegistration" and check the public static void main(String[] args). Press Finish to close the window.
Newclass2.jpg


1.3. The following code will be the content of the VehicleRegistration class in cs.ecl.basics.lab package.
Newclass3.jpg