Java Reference
In-Depth Information
a light bulb icon and a red circle with a white X appears to the left of the very first line. this is an example of
raD's syntax checking. When raD detects an error, the line raD believes has an error will be flagged with a red circle.
if raD has suggestions on how to fix the error, the light bulb icon will also appear.
Note
7.
Move the mouse cursor over the red circle to display the error message text. The text
“The declared package” does not match the expected package “myFirstPackage” will be
displayed.
8.
Click the light bulb icon to display the possible solutions. A box with a list of solutions
will be displayed. The first solution option will be selected and a yellow box with more
details regarding the selected solution will be displayed. In this case, the Add package
declaration 'myFirstPackage;' solution should be selected and the exact statement that
will be inserted and where within the code it will be placed should appear to the right.
if you double-click a solution, raD will make the changes to the code. in this case, the package statement
is there but has been commented out so we don't want raD to insert the statement. We will simply uncomment the
statement using a raD shortcut.
Note
9.
Click anywhere on the commented out package statement line to select it.
10. Press and hold the Ctrl key, then press the forward slash (/) key. (We will use Ctrl-/
to indicate this action).
Notice that the two forward slashes are removed. The package statement is now executable and the error icon
on the first line is gone. Statements can also be commented out quickly by selecting the line(s) and pressing Ctrl and
forward slash ( Ctrl-/) . Essentially Ctrl-/ acts as a toggle switch to comment and uncomment statements.
11.
Select all the lines of the class.
12.
Press Ctrl-/ to change them all to comments.
13.
Press Ctrl-/ to uncomment all the statements.
14.
On the menu bar, click File and then Save.
Tutorial: Entering and Editing Java Statements
Now let's do some editing:
1.
Click to the right of the opening brace ({) in the main method header. The insertion cursor
(a blinking vertical line) should appear at the far right of the line.
2.
Press the Enter key to insert a blank line.
3.
Enter the following statement on the blank line:
System.out.println("Howdy");
 
 
Search WWH ::




Custom Search