Exam 4: Fundamental Data Types

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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, 11); System.out.println(str2); }

(Multiple Choice)
4.8/5
(32)

What will be printed by the statements below? Int x = 20; Int y = x; X += 3; Y *= 2; System.out.print ("x = " + x + ", y = " + y);

(Multiple Choice)
4.8/5
(43)

Which one of the following refers to a number constant that appears in code without explanation?

(Multiple Choice)
4.8/5
(38)

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)
4.8/5
(32)

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.9/5
(45)

Which operator is used to concatenate two or more strings?

(Multiple Choice)
4.7/5
(34)

What will be printed by the statement below? System.out.print ("O\"my\t\\\"no!");

(Multiple Choice)
4.8/5
(35)

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
(35)

What does the following statement sequence print? final String str = "Java"; Str += " is powerful"; System.out.println(str);

(Multiple Choice)
4.8/5
(27)

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.9/5
(36)

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); }

(Multiple Choice)
4.7/5
(38)

Which is the Java equivalent of the following mathematical expression? c = (√a + √b)2

(Multiple Choice)
4.8/5
(35)

Which statement about number literals in Java is false?

(Multiple Choice)
4.9/5
(37)

What will be printed by the statements below? Int x = 20; Int y = x; X++; Y--; System.out.print ("x = " + x + ", y = " + y); X = 21, y = 19

(Multiple Choice)
4.9/5
(30)

Which one of the following is a correct representation of the given mathematical expression in Java? Which one of the following is a correct representation of the given mathematical expression in Java?

(Multiple Choice)
4.7/5
(34)

Which one of the following operators computes the remainder of an integer division?

(Multiple Choice)
4.8/5
(44)

Which of the given statements generates the following output? \\\"///

(Multiple Choice)
4.9/5
(40)

) What are the values of num1 and num2 after this snippet executes? double num1 = 4.20; Double num2 = num1 * 10 + 5.0;

(Multiple Choice)
4.7/5
(32)

What is the output of the following code snippet? public static void main(String[] args) { Int var1 = 10; Int var2 = 2; Int var3 = 20; Var3 = var3 / (var1 % var2); System.out.println(var3); }

(Multiple Choice)
4.8/5
(40)

Which of the following is the Java equivalent of the following mathematical expression? p = 2 . π\pi . (radius)3

(Multiple Choice)
4.8/5
(34)
Showing 61 - 80 of 125
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)