Exam 4: Fundamental Data Types
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
Assume the following variables have been declared and given values as shown:
Int i = 2345;
Double m = 67.8;
What will be printed by the statement below?
System.out.printf ("Values are %10d and %7.2f", i, j);
(Multiple Choice)
5.0/5
(31)
Which one of the following statements can be used to get the fifth character from a string str?
(Multiple Choice)
4.9/5
(35)
What happens to the fractional part when a division is performed on two integer variables?
(Multiple Choice)
4.7/5
(37)
Which of the methods below are static methods?
I. length
II. substring
III. pow
IV. sqrt
(Multiple Choice)
4.8/5
(36)
When you purchase donuts, they come in boxes of 12, so 24 donuts take 2 boxes. All donuts need to be in a box, so if you buy 13 donuts, you'll get 2 boxes with 12 in the first box and 1 in the second. If the integer variable numberOfDonuts contains the positive number of donuts purchased, which of the following will correctly give the number of boxes needed?
(Multiple Choice)
4.8/5
(30)
Which one of the following is a correct method for defining and initializing an integer variable with name value?
(Multiple Choice)
4.8/5
(38)
At what point in the problem-solving process should one write pseudocode?
(Multiple Choice)
4.9/5
(38)
What does the following statement sequence print if the user input is 123? public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Enter a number: ");
String str = in.next();
Str += 456;
System.out.println(str);
}
(Multiple Choice)
4.7/5
(32)
Which one of the following statements can be used to convert a string str to a double?
(Multiple Choice)
4.8/5
(34)
Which one of the following reserved words is used in Java to represent a value without a fractional part?
(Multiple Choice)
4.7/5
(44)
Which of the following options is valid with reference to the code snippet? public static void main(String[] args)
{
Double d = 45.326;
Double r = d % 9.0;
System.out.println(r);
}
(Multiple Choice)
4.8/5
(36)
What is the output of the following code snippet? public static void main(String[] args)
{
Int value = 3;
Value++;
System.out.println(value);
}
(Multiple Choice)
4.9/5
(37)
What is wrong with the following code snippet?
Int average;
Average = 78A;
(Multiple Choice)
4.9/5
(44)
Assume the following variables have been declared and given values as shown: String str = "0123456789";
String sub = str.substring(3, 4);
Which is the value of sub?
(Multiple Choice)
4.9/5
(39)
Which one of the following statements can be used to extract the last five characters from any string variable str?
(Multiple Choice)
4.9/5
(32)
Showing 41 - 60 of 125
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)