Exam 2: Fundamental Data Types
Exam 1: Introduction96 Questions
Exam 2: Fundamental Data Types103 Questions
Exam 3: Decisionseasy99 Questions
Exam 4: Loops100 Questions
Exam 5: Methods94 Questions
Exam 6: Arrays and Arraylists100 Questions
Exam 7: Inputoutput and Exception Handling100 Questions
Exam 8: Objects and Classes101 Questions
Exam 9: Inheritance and Interfaces99 Questions
Exam 10: Graphical User Interfaces54 Questions
Exam 11: Advanced User Interfaces91 Questions
Exam 12: Object-Oriented Design100 Questions
Exam 13: Recursion100 Questions
Exam 14: Sorting and Searching99 Questions
Exam 15: The Java Collections Framework100 Questions
Exam 16: Basic Data Structures94 Questions
Exam 17: Tree Structures100 Questions
Exam 18: Generic Classes78 Questions
Exam 19: Streams and Binary Inputoutput82 Questions
Exam 20: Multithreading82 Questions
Exam 21: Internet Networking74 Questions
Exam 22: Relational Databases75 Questions
Exam 23: XML74 Questions
Exam 24: Web Applications74 Questions
Select questions type
What is the output of the following code snippet?
Public static void main(String[] args){
{
String str1;
Str1 = "I LOVE MY COUNTRY";
String str2 = str1.substring(4, 9);
System.out.println(str2);
}
(Multiple Choice)
4.8/5
(29)
What does the following statement sequence print?
String str = "Harry";
Int n = str.length();
String mystery = str.substring(0, 1) + str.substring(n - 2, n);
System.out.println(mystery);
(Multiple Choice)
4.8/5
(33)
Which of the following statements is correct about constants?
(Multiple Choice)
4.8/5
(51)
What is the output of the following code snippet?
String firstname = "William";
String lastname;
System.out.println("First: " + first);
System.out.println("Last: " + lastname);
(Multiple Choice)
4.9/5
(31)
How do you extract the first 5 characters from the string str?
(Multiple Choice)
4.8/5
(32)
What does the following statement sequence print?
String str = "Hello";
Int n = str.length();
String mystery = str.substring(0, 1)
+ str.substring(n - 2, n + 1);
System.out.println(mystery);
(Multiple Choice)
4.9/5
(32)
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 ");
Int myInt = in.nextInt();
MyInt += 456;
System.out.println(myInt);
}
(Multiple Choice)
4.8/5
(42)
Which of the following statements with comments is(are) valid?
I. int cnt = 0; /* Set count to 0
II. int cnt = 0; /* Set count to 0 */
III. int cnt = 0; // Set count to 0
(Multiple Choice)
4.8/5
(41)
Which one of the following statements displays the output as 54321.00?
(Multiple Choice)
4.8/5
(40)
What is the output of the following code snippet?
Public static void main(String[] args)
{
Int num1 = 10;
Int num2 = 5;
Int num3 = 200;
Num3 = num3 % (num1 * num2);
System.out.println(num3);
}
(Multiple Choice)
4.8/5
(37)
What is the output of this code snippet?
Double average;
Int grade1 = 87;
Int grade2 = 94;
// System.out.print("The average is " + (grade1 + grade2) / 2.0);
System.out.print("The average is " + average);
(Multiple Choice)
4.8/5
(35)
Which one of the following is a correct representation of the given mathematical expression in Java? 

(Multiple Choice)
5.0/5
(37)
What happens to the fractional part when a division is performed on two integer variables?
(Multiple Choice)
4.8/5
(37)
What is the correct way to invoke methods on variables in Java that are strings?
(Multiple Choice)
4.9/5
(47)
Which one of the following statements displays the output as +00321.00?
(Multiple Choice)
4.9/5
(34)
What is the output of the following code snippet?
Public static void main(String[] args)
{
Int s;
Double f = 365.25;
S = f / 10;
System.out.println(s);
}
(Multiple Choice)
4.8/5
(43)
Suppose a phone number, stored as a ten-character string (of digits only) called phoneNumber, must be converted into a string that has parentheses around the area code. Which statement below will do that?
(Multiple Choice)
4.9/5
(37)
Showing 41 - 60 of 103
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)