From ggc
|
01 packagepackage is used to name the directory or folder a class is in intermediate;
02 //start auto-imports
03 importimport means to make the classes and/or packages available in this program java.io.*;
04 importimport means to make the classes and/or packages available in this program java.util.*;
05 //end auto-imports
06
07 importimport means to make the classes and/or packages available in this program java.net.*;
08
09 /**
10 * All about my application.
11 * @authorthis is the Javadoc tag for documenting who created the source code Jam Jenkins
12 */
13 publicpublic is used to indicate unrestricted access (any other class can have access) classclass is a group of fields and methods used for making objects URLExplore
14 {open braces start code blocks and must be matched with a close brace
15 publicpublic is used to indicate unrestricted access (any other class can have access) staticstatic means that an instance is not required for access (class level access) voidvoid means the method does not return a value mainThe main method is the place where applications begin executing.(String[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays args)
16 {open braces start code blocks and must be matched with a close brace
17 trytry is for executing a code block that may experience exceptions (errors)
18 {open braces start code blocks and must be matched with a close brace
19 String address=this assignment operator makes the left side equal to the right side"http://ggc.javawide.org/index.php/Main_Page";
20 URL url=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor URL(address);
21 InputStream in=this assignment operator makes the left side equal to the right sideurl.openStream();
22 String source=this assignment operator makes the left side equal to the right side
23 "Happy days\n"+adds two numbers together or concatenates Strings together
24 "are here to stay.";
25 Scanner scanner=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor Scanner(in);
26 scanner.useDelimiter("\\Q<ul>\\E|\\Q</ul>\\E");
27 System.out.println("Source is \n"+adds two numbers together or concatenates Strings togethersource);
28 whilewhile is a looping structure for executing code repeatedly(scanner.hasNext())
29 {open braces start code blocks and must be matched with a close brace
30 scanner.next();
31 String contents=this assignment operator makes the left side equal to the right sidescanner.next();
32 System.out.println(contents);
33
34 }close braces end code blocks and must match an earlier open brace
35 }close braces end code blocks and must match an earlier open brace
36 catchcatch means to handle an exception that may occur(IOException scoobyDo)
37 {open braces start code blocks and must be matched with a close brace }close braces end code blocks and must match an earlier open brace
38 }close braces end code blocks and must match an earlier open brace
39 }close braces end code blocks and must match an earlier open brace
|
Download/View intermediate/URLExplore.java