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
Assuming that the user inputs a value of 30 for the price and 10 for the discount rate in the following code snippet, what is the output?
Scanner in = new Scanner(System.in);
System.out.print("Enter the price: ");
Double price = in.nextDouble();
System.out.print("Enter the discount rate: ");
Double discount = in.nextDouble();
System.out.print("The new price is ");
System.out.println(price - price * (discount / 100.0));
Free
(Multiple Choice)
4.8/5
(33)
Correct Answer:
C
What is the output of the following statement sequence?
Public static void main(String[] args)
{
Int x = 100.0 % 6.0;
System.out.println(x);
}
Free
(Multiple Choice)
4.8/5
(38)
Correct Answer:
B
Which one of the following statements can be used to extract the last 10 characters from the string variable str?
Free
(Multiple Choice)
4.9/5
(32)
Correct Answer:
A
What is the value inside the value variable at the end of the given code snippet?
Public static void main(String[] args)
{
Int value = 3;
Value = value - 2 * value;
Value++;
}
(Multiple Choice)
4.9/5
(37)
Which of the following is the Java equivalent of the following mathematical expression?
P = 2 . .(radius)3
(Multiple Choice)
4.8/5
(32)
Which one of the following is a correct method for defining and initializing an integer variable with name value?
(Multiple Choice)
4.9/5
(38)
In an airline reservation system, the cost of an airline ticket is required. Which data type should be used to store this value?
(Multiple Choice)
4.7/5
(40)
What is the output of the following code snippet?
Public static void main(String[] args)
{
Double a;
A = Math.sqrt(9.0) + Math.sqrt(16.0);
System.out.println(a);
}
(Multiple Choice)
4.7/5
(33)
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.8/5
(43)
Assuming that the user inputs "Joe" at the prompt, what is the output of the following code snippet?
Public static void main(String[] args)
{
System.out.print("Enter your name ");
String name;
Scanner in = new Scanner(System.in);
Name = in.next();
Name += ", Good morning";
System.out.print(name);
}
(Multiple Choice)
4.8/5
(26)
What is the result of the following code snippet?
Public static void main(String[] args)
{
Double circleRadius;
Double circleVolume = 22 / 7 * circleRadius * circleRadius;
System.out.println(circleVolume);
}
(Multiple Choice)
4.9/5
(36)
Which one of the following statements can be used to extract the last five characters from any string variable str?
(Multiple Choice)
5.0/5
(44)
What is the output of this code snippet?
Int sum = 22;
Sum = sum + 2;
System.out.print(sum); // sum = sum + 4;
System.out.print(sum);
(Multiple Choice)
4.9/5
(44)
Assuming that the user inputs a value of 25000 for the pay and 10 for the bonus rate in the following code snippet, what is the output?
Public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Enter the pay: ");
Double pay = in.nextDouble();
System.out.print("Enter the bonus rate: ");
Double bonus = in.nextDouble();
System.out.println("The new pay is " +
(pay + pay * (bonus / 100.0)));
}
(Multiple Choice)
4.9/5
(32)
The problem solving process emphasizes a "first, do-it-by-hand" approach because
(Multiple Choice)
5.0/5
(42)
What is the result of the following statement?
String s = "You" + "had" + "me" + "at" + "hello";
(Multiple Choice)
4.7/5
(37)
Which one of the following statements can be used to get the fifth character from a string str?
(Multiple Choice)
4.8/5
(45)
Which of the following statements is correct about constants?
(Multiple Choice)
4.8/5
(32)
Showing 1 - 20 of 103
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)