Final

Once an array has been declared and created, its size can be changed by using an add method.
True
False
Static fields and static methods belong to the last created instance of a class.
True
False
The UML diagram below depicts the inheritance relationship among the classes StinkBug, SmallBug, and SlimyBug, each of type Bug. If the four classes were written in Java containing only the fields and methods shown, then there would be no syntax error.
True
False
If the method printContents has the following header: public void printContents (int[] anArray) then the below code is syntactically correct:
True
False
A StringBuilder object is mutable
True
False
Protected members of a subclass can be accesses directly by a superclass of the subclass.
True
False
The following code is syntactically correct:
True
False
Uninitialized static double variables are assigned the value of -1.0
True
False
If the class Fruit extends the class Apple, then the following java code is syntactically correct:
True
False
The output of the below code is EXACTLY: entral W
True
False
What does the below main method print to the screen
0 plus 19
0 plus -19
19 plus 19
-19 plus 0
19 plus 0
19 plus -19
Which of the following two lines of code would instantiate two Flower objects, such that daisy is a reference variable to an object that is an exact copy of tulip?
Flower tulip = new Flower(2); Flower daisy = Flower(new Flower());
Flower tulip = new Flower(12); Flower daisy = Flower(tulip);
Flower tulip = new Flower(10); Flower daisy = Flower(daisy);
Flower tulip = new Flower(2); Flower daisy = tulip;
Flower tulip = new Flower(14); Flower daisy = new Flower(tulip);
For the below Java code, list line numbers that contains a syntax error. Give a brief (one line) description of what the error is. List numbers in incrementing order.
Can a method in a superclass be overloaded and overridden in a subclass? Be sure to explain why or why not with an example?
If a method is declared as static in a class X, then can it be overridden in class Y, if Y is a subclass of X? Explain why.
Define class aggregation, provide an example:
4
1
None
3
2
1
4
None
2
3
1
2
3
4
None
For the classes above, which connector should be used to connect boxes 3 and 4: SAME IMAGE AS ABOVE
3
4
None
2
1
When an object of type PrivateJet is created, its getWingspan method can access the wingspan field in the Airplane class.
True
False
The class Airplane is a subclass of the class PrivateJet.
True
False
The constructor of the PrivateJet class must call explicitly the constructor of the Airplane class.
True
False
The setNumEngines method in the PrivateJet class is an overloaded method.
True
False
The following statement is syntactically valid: Airplane myA = new PrivateJet();
True
False
When an object of type PrivateJet is created, it inherits the field numEngines.
True
False
Is the following a syntactically correct declaration of an array? char[] iAmTiredOfArrays = new String[35];
True
False
Is the following a syntactically correct declaration of an array? Double numEntries = 6; double[] someArrayOfDoubles = new double[numEntries];
True
False
Is the following a syntactically correct declaration of an array? String[] someArrayOfStrings = new String[34];
True
False
Is the following a syntactically correct declaration of an array? double[] numArray = { 1, 2, 3, 6, 92.3, 42.5 };
True
False
Is the following a syntactically correct declaration of an array? String[] oneMoreArray = new String["a"];
True
False
Is the following a syntactically correct declaration of an array? char[][] someArray = new char[6][35];
True
False
{"name":"Final", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Once an array has been declared and created, its size can be changed by using an add method., static fields and static methods belong to the last created instance of a class., The UML diagram below depicts the inheritance relationship among the classes StinkBug, SmallBug, and SlimyBug, each of type Bug. If the four classes were written in Java containing only the fields and methods shown, then there would be no syntax error.","img":"https://www.quiz-maker.com/3012/CDN/90-4382696/image-2023-06-06-220635959.png?sz=1200"}
Make your own Survey
- it's free to start.