Bladeren bron

Uploaded file describing "Connecting to and reading from a web page"

Trinh Tong 6 jaren geleden
bovenliggende
commit
363bdd97a9
1 gewijzigde bestanden met toevoegingen van 16 en 0 verwijderingen
  1. 16
    0
      TrinhT.md

+ 16
- 0
TrinhT.md Bestand weergeven

@@ -0,0 +1,16 @@
1
+Reading from a website code
2
+
3
+The program is using the scanner class as a reader.
4
+Up to this point, we've used it to take in inputs
5
+from the keyboard, but redirecting the input to the
6
+URL "mySite" and establishing a connection between
7
+the site and our scanner, it can read what's on the site.
8
+
9
+The while loop checks that there is something
10
+to return back by checking if "hasNext" == true.
11
+
12
+From there, the program keeps track of how many lines with the count variable and then returns it
13
+at the end.
14
+
15
+The try/catch is for handling exception errors?
16
+It will try the program and then if there is an exception it will catch it and then show Documentation what might have happened.