Question: QUESTION 1 The first character in a String has an index of 1 . True False 4 points QUESTION 2 The Scanner class provides methods
QUESTION
The first character in a String has an index of
True
False
points
QUESTION
The Scanner class provides methods for reading various data types from a file.
True
False
points
QUESTION
If the indexOf method in the String class is unable to find an occurance of a character or String, it will return the value to signify that it was unable to find anything.
True
False
points
QUESTION
The operator is used for String concatenation, among other uses.
True
False
points
QUESTION
If a class is not in the java.lang package, you can use the import keyword to tell the compiler where to find the class definition.
True
False
points
QUESTION
To read in an entire line of input from the user, it is necessary to use the next method of the Scanner class.
True
False
points
QUESTION
Which of the following select all correct answers are identifiers for a method of the String class?
indexOf
charAt
length
substring
points
QUESTION
Which of the following select all correct Answers will allow you to use the DecimalFormat class in your own program:
import java.text.DecimalFormat;
use DecimalFormat;
import java.lang.;
import java.text.;
points
QUESTION
What will be the value of the variable letter after the following code is executed:
String name "Richard";
char letter name.toLowerCasecharAt;
r
R
r
R
points
QUESTION
What is the value of the variable position after the following code has been executed:
String name "Lola";
int position name.toLowerCaseindexOfl The argument of the indexOf method is the char literal lowecase l
points
QUESTION
What will be the output of the following Java code:
System.out.printlnThe sum of and is ;
The sum of and is
The sum of and is
The sum of and is
The sum of and is
points
QUESTION
What will be the output of the following Java code:
System.out.printlnThe sum of and is ;
The sum of and is
The sum of and is
The sum of and is
The sum of and is
points
QUESTION
Which of the following methods returns the the index of the first occrance of a specified character in a String:
substring
length
indexOf
charAt
points
QUESTION
What will be the output of the following Java code:
String s "Hello World";
System.out.printlnsindexOfh;
Hello World
points
QUESTION
What is the value of the variable result after the following code has been executed:
String name "James Joyce";
String result name.toUpperCasesubstringnameindexOftoLowerCase;
James
JAMES
JAMES JOYCE
joyce
JOYCE
james joyce
This code will not actually compile or will produce an error.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
