Question
Question 11 To declare a constant MAX_LENGTH inside a method with value 99.98, you write ________. A. final float MAX_LENGTH = 99.98; B. double MAX_LENGTH
Question 11 To declare a constant MAX_LENGTH inside a method with value 99.98, you write ________. A. final float MAX_LENGTH = 99.98; B. double MAX_LENGTH = 99.98; C. final double MAX_LENGTH = 99.98; D. final MAX_LENGTH = 99.98;
Question 12 24 % 5 is ________. A. 3 B. 0 C. 4 D. 1
Question 13 The following code displays ________. double temperature = 0; if (temperature >= 100) System.out.println("too hot"); else if (temperature <= 40) System.out.println("too cold"); else System.out.println("jusr right"); A. too hot B. too cold C. just right D. too hot too cold just right
Question 14 The main method header is written as ________. A. public void main(String[] args) B. public static void main(string[] args) C. public static void Main(String[] args) D. public static void main(String[] args)
Question 15 How many times will the following code print "Welcome to Java"? int count = 0; do { System.out.println("Welcome to Java"); count++; } while (count < 10); A. 11 B. 9 C. 10 D. 0 Question 16 Analyze the following code: int x = 0; if (x > 0); { System.out.println("x"); } A. The value of variable x is always printed. B. The symbol x is always printed. C. Nothing is printed because x > 0 is false. D. The symbol x is always printed twice
Question 17 What is the output for y? int y = 0; for (int i = 0; i < 10; ++i) y += i; System.out.println(y); A. 45 B. 11 C. 12 D. 10
Question 18 Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative? A. (1 > x > 100) || (x < 0) B. ((x < 100) && (x > 1)) && (x < 0) C. 1 < x < 100 && x < 0 D. ((x < 100) && (x > 1)) || (x < 0)
Question 19 A block is enclosed inside ________. A. braces B. brackets C. parentheses D. quotes
Question 20 Which of the following is the correct statement to return JAVA? A. "Java".toUpperCase("Java") B. "Java".toUpperCase() C. String.toUpperCase("Java") D. toUpperCase("Java")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started