Multiple Choice
Insert the missing code in the following code fragment. This fragment is intended to read a web page. public static void main(String[] args) throws IOException
{
String address = "http://horstmann.com/index.html";
URL pageLocation = new URL(address) ;
Scanner in = _________;
) . .
}
A) new Scanner("http://horstmann.com/index.html")
B) new Scanner(pageLocation)
C) new Scanner(new File(pageLocation) )
D) new Scanner(pageLocation.openStream() )
Correct Answer:

Verified
Correct Answer:
Verified
Q27: Consider the following code snippet: System.out.printf("%-12s%8.2f",description,totalPrice);<br>Which of
Q28: Insert the missing code in the following
Q29: Which of the following statements about using
Q30: Consider the following code snippet. Scanner inputFile
Q31: Which of the following statements about exception
Q33: Consider the following code snippet: throw IllegalStateException("This
Q34: Which String class method will remove spaces
Q35: Insert the missing code in the following
Q36: Your program must read in an existing
Q37: Which of the following code snippets about