Difference between revisions of "Team1/Renaming Java elements"

From CDOT Wiki
Jump to: navigation, search
(Created page with ' '''6. Renaming Java elements ''' <br/>Go to the "src" folder in your package and right click on it, then select: New -> Class 500px <br/>In the "New …')
 
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
=== 6. Renaming Java elements ===
  
 +
6.1. While the particular class is selected, click on ''Refactor -> Rename''<br/>
 +
[[Image:rename1.jpg |400px]]
  
'''6. Renaming Java elements '''
+
<br/>6.2. In the ''Rename Compilation Unit'' window, write down the new name for the class, e.g.''VehicleRegistration'' and check the Update references" then click on Next .<br />
<br/>Go to the "src" folder in your package and right click on it, then select: New -> Class
+
[[Image:rename2.jpg |500px ]]
[[Image:eclLab1_4.jpg|500px ]]
 
  
<br/>In the "New Java Class" window, write down your class name, e.g."Lab" and check the "public static void main(String[] args)"
+
<br/>6.3. In the new window, the changes to be performed are displayed. <br />
[[Image:eclLab1_5.jpg|400px ]]
+
[[Image:rename3.jpg |500px ]]
  
<br/>The following code will be the content of the Lab1_1 class.
+
<br/>6.4. Note the new class name in the content of the class..<br />
[[Image:eclLab1_7.jpg|500px ]]
+
[[Image:rename4.jpg |500px ]]
<br/>The following code will be the content of the Lab1_1 class.
 
[[Image:eclLab1_8.jpg|500px ]]
 

Latest revision as of 12:19, 30 January 2011

6. Renaming Java elements

6.1. While the particular class is selected, click on Refactor -> Rename
Rename1.jpg


6.2. In the Rename Compilation Unit window, write down the new name for the class, e.g.VehicleRegistration and check the Update references" then click on Next .
Rename2.jpg


6.3. In the new window, the changes to be performed are displayed.
Rename3.jpg


6.4. Note the new class name in the content of the class..
Rename4.jpg