CS1102 Final Exam Questions and answers. 100% PROVEN PASS RATE. Grade A+
CS1102 Final Exam Questions and answers. 100% PROVEN PASS RATE. Grade A+ Document Content and Description Below Consider the following Java declaration and assignment statement. float x = y; Which one of the following types is "y" NOT allowed to be? - double Which one of the following is NOT part of the signature of a Java method? - names of formal parameters Assume "test" is a boolean variable. Which of the following expressions is equivalent to "test == true"? - test Which of the following keywords is useful for getting out of an infinite loop? - break Consider the following Java statements. int x = 3; x = x++; What is the value x is holding? - !test Which of the following can a class NOT be used for? - a primitive type Consider the following Java method. Which term best describes what this method computes? static int doSomething(int[] a) {int b = 0; for (int c : a) b += c; return b;} - sum Which one of the following values can a Java variable NOT have? - an object Consider the following Java program, which one of the following best describes "count"? - a class variable A subclass will _____ one superclass. - extend A class that implements a listener interface does which of the following? - It handles events Consider the following Java program. What is the superclass of "Clicker"? - JFrame What does a Java compiler do? - Translates source code in ".java" files into Java byte code in ".class" files Consider the following Java method, which term best describes "String[] args"? - formal parameter Consider the following first line from a Java method definition. public static boolean compute(int n, float x) { Which one of the following lines could begin a method that legally overloads the above method? - public static boolean compute(float n, int x) { Consider the following line of Java code. Sln("Hello, World!"); Which one of the following does NOT describe '"Hello, World!"'? - a declaration Which of the following is NOT a valid identifier in Java? - public Consider the following line of Java code. Sln("Hello, World!"); "System" is which of the following? - a class Consider the following Java program. Which object registers event listeners? - this Consider the following Java program. Which statement registers an object to receive events? - ActionListener(this); In a while loop, how many times does the continuation condition run? - At least once, at the beginning of each iteration. Which one of the following claims about Java is INCORRECT? - An object is a type Consider the following Java program. Which statement updates the appearance of a button? - Text(SOf(count)); Consider the following line of Java code. Sln("Hello, World!"); The full line of code is which of the following? - a statement Consider the following Java program. Which statement displays a window with a button on the screen? - setVisible(true); Which one of the following terms does NOT describe a desirable interface to a black box? - implementation public class HelloWorld { - a variable declaration a class definition Which of the following should be used to compare the contents of two String objects in Java? - equals Consider the following Java program. Which one of the following is a package? - Consider the following Java program. Which one of the following is a
Document information
- Uploaded on
- May 9, 2023
- Number of pages
- 6
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers