Ready to test your Knowledge?
Try out our new practice tests completely free!
exam preparation banner icon

Big Java Binder Early Objects

Computing

Quiz 4 :

Fundamental Data Types

Quiz 4 :

Fundamental Data Types

search
arrow
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); }
Free
Multiple Choice
Answer:

Answer:

C

Tags
Choose question tag
close menu
arrow
What will be the value stored in the variable x after the execution of the following code snippet? Int a = 10; Int b = 20; Int c = 2; Int x = b / a /*c*/;
Free
Multiple Choice
Answer:

Answer:

B

Tags
Choose question tag
close menu
arrow
Which of the following statements is correct about constants?
Free
Multiple Choice
Answer:

Answer:

C

Tags
Choose question tag
close menu
arrow
What is the result of the following expression? double d = 2.5 + 4 * -1.5 - (2.5 + 4) * -1.5;
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
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
Answer:
Tags
Choose question tag
close menu
arrow
What is wrong with the following code snippet? Int average; Average = 78A;
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
Which one of the following operators computes the remainder of an integer division?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
) What are the values of num1 and num2 after this snippet executes? double num1 = 4.20; Double num2 = num1 * 10 + 5.0;
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
What is wrong with the following code? Int count = 2000 * 3000 * 4000;
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
Which of the following guidelines will make code more explanatory for others?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
Assuming that the user inputs a value of 25 for the price and 10 for the discount 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 price: "); Double price = in.nextDouble(); System.out.print("Enter the discount rate: "); Double discount = in.nextDouble(); System.out.println("The new price is " + Price - price * (discount / 100.0)); }
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
What is the output of the following code snippet? public static void main(String[] args) { Int value = 25; Value = value * 2; Value--; System.out.println(value); }
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
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
Answer:
Tags
Choose question tag
close menu
arrow
What is wrong with the following code snippet? public class Area { Public static void main(String[] args) { Int width = 10; Height = 20.00; System.out.println("area = " + (width * height)); } }
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
What is the value of Math.pow(3, 2)?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
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
Answer:
Tags
Choose question tag
close menu
arrow
Which of the following options declares a float variable?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
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
Answer:
Tags
Choose question tag
close menu
arrow
Which one of the following variables is assigned with valid literals?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
What will be the value inside the variables a and b after the given set of assignments? Int a = 20; Int b = 10; A = (a +B) / 2; b = a; A++;
Multiple Choice
Answer:
Tags
Choose question tag
close menu
Showing 1 - 20 of 125