All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Tutor
New
Search
Search
Sign In
Register
study help
computer science
oracle
Questions and Answers of
Oracle
What is the output of the following? A. [3, three, THREE]B. [3, THREE, three]C. [three, THREE, 3]D. [THREE, three, 3]E. None of the above var threes = Arrays.asList ("3", "three", "THREE");
How many of these allow inserting null values: ArrayList, LinkedList, HashSet, and TreeSet?A. 0B. 1C. 2D. 3E. 4
How many dimensions does the array reference moreBools allow? boolean[] [] [] bools, moreBools; A. One dimensionB. Two dimensionsC. Three dimensionsD. None of the above
Given that Integer and Long are direct subclasses of Number, what type can be used to fill in the blank in the following class to allow it to compile? A. LongB. IntegerC. Long or IntegerD. Long
Which changes made to the following class would help to properly encapsulate the data in the class? A. Add a getter method for material.B. Add a setter method for material.C. Change the access
What is output by the following?A. 3 10 B. 3 12 C. 5 10 D. 5 12 E. The code does not compile. F. None of the above. 10: int m = 0, n = 0; 11: while (m < 5) { 12: 13: 14: 15: 16: 17: 18: 19:
Which of the following rules about a default branch in a switch statement are correct? (Choose two.) A. A switch statement is required to declare a default statement. B. A default statement must be
Which are true statements comparing for-each and traditional for loops? (Choose two.) A. Both can iterate through an array starting with the first element. B. Only the for-each loop can iterate
What happens when running the following code snippet? A. It completes successfully without output. B. It outputs helium once. C. It outputs helium repeatedly. D. Line 6 does not compile. E. None
Variables declared as which of the following are never permitted in a switch statement? (Choose two.) A. var B. double C. int D. String E. char F. Object
Given the following, which can fill in the blank and allow the code to compile? (Choose three.) var quest = for (var zelda : quest) { System.out.print(zelda); }
What does the following method output? A. The code does not compile. B. The method completes with no output. C. The method prints 0 and then terminates. D. The method enters an infinite loop. E.
What is the output of the following application? A. Plan AB. Plan BC. Plan CD. The class does not compile.E. None of the above. package planning; public class ThePlan { } public static void
What is true about the following code? (Choose two.) A. It outputs x.B. It does not compile.C. It is an infinite loop.D. With lines 25 and 28 removed, it outputs x.E. With lines 25 and 28 removed,
Which of the following can replace the body of the perform() method to produce the same output on any nonempty input? (Choose two.) public void perform (String[] circus) { for (int
What does the following code snippet output? var bottles - List.of("glass", "plastic", "can"); for (int type = 1; type < bottles.size();) { System.out.print (bottles.get(type) + "-"); if (type <
What is the result of executing the following code snippet? A. 1-B. 1-2-C. 2-D. 3-E. 4-F. None of the above. final var GOOD = 100; var score = 10; switch (score) { default: 1:
What is the output of the following application? A. 2 B. 3 C. 4 D. The code does not compile. E. The code compiles but throws an exception at runtime. package dinosaur; public class Park {
What variable type of red allows the following application to compile? package tornado; public class Kansas { public static void main(String[] args) { int colorOfRainbow = 10; red = 5;
How many lines of the magic() method contain compilation errors? A. Zero B. One C. Two D. Three E. Four 10: public void magic() { 11: do { 12: 13: 14: 15: 16: 17: 18: 19: } int trick = 0; LOOP:
How many of these statements can be inserted after the println to have the code flow follow the arrow in this diagram? A. One B. Two C. Three D. Four E. Five F. None of above break; break
What is the output of the following application? A. 1B. 2C. 3D. The code does not compile because var cannot be used in a switch statement.E. The code does not compile for another reason.F. None of
Which of the following statements compile and create infinite loops at runtime? (Choose two.) A. while (! false) {} B. do {} C. for() {} D. do {} while (true); E. while {} F. for(;;) {}
Which of the following iterates a different number of times than the others? A. for (int k=0; k < 5; k++) {} B. for (int k=1; k
What is the output of the following code snippet? A. 0B. 1C. 2D. 3E. The code does not compile.F. None of the above. int count 0; var stops = new String[] { "Washington", "Monroe", "Jackson",
What is the output of the following code snippet? int hops = 0; int jumps = 0; jumps = hops++; if (jumps) System.out.print("Jump!"); else System.out.print("Hop!"); A. Jump! B. Hop! C. The code does
Which of the following best describes the flow of execution in this for loop if beta always returns false? for (alpha; beta; gamma) { delta; } A. alpha B. alpha, beta C. alpha, beta, gamma. D.
What is the output of the following code snippet? A. done B. inflate-doneC. The code does not compile. D. This is an infinite loop. E. None of the above. boolean balloonInflated = false; do {
Which of these code snippets behaves differently from the others? A. if (numChipmunks == if (numChipmunks 1) System.out.println("One chipmunk"); System.out.println("Two chipmunks"); if
Given the following enum and class, which option fills in the blank and allows the code to compile? enum Season { SPRING, SUMMER, WINTER } public class Weather { } public int getAverage Temperate
Which statements about loops are correct? (Choose three.) A. A do/while loop requires a body. B. A while loop cannot be exited early with a return statement. C. A while loop requires a conditional
Fill in the blank with the line of code that causes the application to compile and print exactly one line at runtime. package nyc; public class TourBus { public static void main(String... args) {
The code contains six pairs of curly braces. How many pairs can be removed without changing the behavior? A. One B. Two C. Three D. Four E. Five F. Six 12: public static void main(String[]
Given the diagram in the previous question, how many of the classes shown in the diagram can call the display() method? A. ZeroB. OneC. TwoD. ThreeE. Four m.light Flashlight com. private
Which of the following results is not a possible output of this program? A. WEST is printed.B. south is printed.C. An ArrayIndexOutOfBoundsException is thrown at runtime.D. An
What is the output of the RightTriangle program? package shapes; A. rtB. irtC. The code does not compile due to line g1.D. The code does not compile due to line g2.E. The code does not compile
Which of the following are advantages of using enumerated types in Java, rather than static constant values? (Choose three.) A. Improve performance.B. Provide access to fixed set of constants
How do you force garbage collection to occur at a certain point? A. Calling System.forceGc()B. Calling System.gc()C. Calling System.requireGc()D. Calling GarbageCollection.clean()E. None of the
Given the following two classes, each in a different package, which line inserted into the code allows the second class to compile? A. import static commerce.Bank.*;B. import static
Which are true statements about referencing variables from a lambda? (Choose two.)A. Instance and static variables can be used regardless of whether effectively final.B. Instance and local
Given the following structure, which snippets of code return true? (Choose three.) A. new Coral() instanceof Friendly B. null instanceof ObjectC. new Coral() instanceof ObjectD. new Fish()
What is true of the following code? A. It prints 20 20 20B. It prints 20 20 75C. It prints 20 21 75D. It prints 21 21 75E. It does not compile due to setNumDays().F. It does not compile for
What statement about the following interface is correct? A. Line 2 does not compile.B. Line 3 does not compile.C. Line 4 does not compile.D. Line 5 does not compile.E. Line 6 does not
What is the output of the following application? A. -1B. 0C. 1D. The Provider class does not compile.E. The Bank class does not compile.F. None of the above. package finance; enum Currency {
How many lines need to be removed for this code to compile? A. ZeroB. OneC. TwoD. ThreeE. FourF. Five 1: package figures; 2: public class Dolls { 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:} public
Fill in the blanks: A class may be assigned to a(n) ___________________ reference variable automatically but requires an explicit cast when assigned to a(n) ___________________ reference
What are possible outputs of the following given that the comment on line X can be replaced by code? A. 0B. 5C. Either 0 or 5D. Any int valueE. Does not compile. // Mandrill.java public class
Which statement about functional interfaces is incorrect?A. A functional interface can have any number of static methods.B. A functional interface can have any number of default methods.C. A
How many of the String objects are eligible for garbage collection right before the end of the main() method? A. NoneB. OneC. TwoD. ThreeE. None of the above public static void main(String[]
Suppose Panther and Cub are interfaces and neither contains any default methods. Which statements are true? (Choose two.) A. If Panther has a single abstract method, Cub is guaranteed to be a
What does the following output? A. blockB. constructorC. instanceD. The code does not compile.E. None of the above. 1: public class InitOrder public String first public InitOrder () { 2: 3: 4:
A local class can access which type of local variables? (Choose two.) A. finalB. privateC. effectively finalD. staticE. defaultF. const
Which statement about the following interface is correct? A. The code compiles.B. The method produceSap() does not compile.C. The method getNumberOfRings() does not compile.D. The method
Which statements about a variable with a type of var are true? (Choose two.)A. The variable can be assigned null at any point in the program.B. The variable can be assigned null only after initial
Assume there is a class Bouncer with a protected variable. Methods in which class can access this variable?A. Any subclass of Bouncer or any class in the same package as BouncerB. Any superclass of
What is the output of the following application? A. 8 B. Line p1 contains a compiler error. C. Line p2 contains a compiler error. D. Another line of code contains a compiler error. E. None of the
Which can fill in the blank to make the code compile? (Choose two.) A. class Quokka extendsB. class Quokka implementsC. Neither A norB. Only one interface can be specified.D. interface Quokka
What is true of the following method? A. It is a correctly implemented accessor method.B. It is a correctly implemented mutator method.C. It is an incorrectly implemented accessor method.D. It
What is the result of compiling and executing the following class? A. The code does not compile.B. 4C. 5D. 10E. 20 public class RollerSkates { static int wheels = 1; int tracks = 5; public
Which of the following statements about calling this() in a constructor are true? (Choose three.)A. If arguments are provided to this(), then there must be a constructor in the class able to take
Which statements about the following program are correct? (Choose two.) A. The code does not compile because of line m1.B. The code does not compile because of line m2.C. The code does not
Which statements about top-level and member inner classes are correct? (Choose three.)A. Both can be marked protected.B. Only top-level classes can be declared final.C. Both can declare
What is required to define a valid Java class file? A. A class declarationB. A package statementC. An import statementD. A class declaration and package statementE. A class declaration and at
How many objects are eligible for garbage collection right before the end of the main() method? A. None.B. One.C. Two.D. Three.E. The code does not compile. 1: public class Person { 2: public
What is the output of the following application? A. 5B. 10C. 15D. The code does not compile.E. The answer cannot be determined with the information given. package race; interface Drive { int
What is the output of the following application? (Choose two.) A. 2B. 3C. 5D. 6E. 8 1: public class ChooseWisely { 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:} public ChooseWisely () { super(); }
How many lines of the following program do not compile? A. ZeroB. OneC. TwoD. ThreeE. More than three. 1: public enum Color { 2: 3: 4: 5: 6: 7: 8: 9: } RED (1,2) { void toSpectrum () {} }, BLUE
What can fill in the blank so the play() method can be called from all classes in the com. mammal package, but not the com.mammal.gopher package? A. Leave it
What is the output of the Square program? A. 0B. 2C. 4D. The code does not compile due to line x1.E. The code does not compile due to line x2.F. The code does not compile due to line x3.
Fill in the blanks: It is possible to extend a(n) ______________ but not a(n) ______________. (Choose two.) A. interface, abstract classB. anonymous class, static nested classC. abstract class,
Which of the following can replace the body of the travel() method to produce the same output on any nonempty input? public void travel (List roads) { for (int w= 1; w 0; t--)
Which statement about the following code snippet is correct? A. One line does not compile.B. Two lines do not compile.C. Three lines do not compile.D. It compiles and prints two lines at runtime.E.
What is the output of the following application? A. 3B. 9C. 93D. The code does not compile because of line g1.E. The code does not compile because of line g2.F. None of the above. package dnd; final
Which of the following lines of code are not permitted as the first line of a Java class file? (Choose two.) A. import widget. *; B. // Widget Manager C. int facilityNumber; D. package sprockets;
What is the result of compiling and executing the following class? A. It compiles and outputs 5.B. It compiles and outputs 15.C. It does not compile.D. It compiles but throws an exception at
Which of the following modifiers can be applied to an abstract method? (Choose two.) A. finalB. privateC. publicD. defaultE. protectedF. concrete
Fill in the blanks: The ___________________ access modifier allows access to everything the ___________________ access modifier does and more. A. package-private, protectedB. private,
A. package-private, protected B. private, package-private C. private, protected D. private, public E. public, private F. None of the above A. constB. finalC. staticD. privateE. private staticF. None
Given the following application, fill in the missing values in the table starting from the top and going downward. A. 2, 0, 1B. 2, 2, 1C. 1, 0, 1D. 0, 2, 1 package competition; public class Robot {
Given the following code, what values inserted, in order, into the blank lines allow the code to compile? (Choose two.) A. package, new, intB. package, class, longC. import, class, nullD. //, class,
Which of the following are correct? (Choose two.) public class Phone { private int size; // insert constructor here public static void sendHome (Phone p, int newSize) { p = new Phone (newSize);
Given the following class structures, which lines can be inserted into the blank independently that would allow the class to compile? (Choose two.) A. dino.Pterodactyl()B. Dinosaur.new
What is the output of the Computer program? A. computer-laptopB. laptop-computerC. laptop-laptopD. The code does not compile.E. None of the above. class Laptop extends Computer { public void
How many lines does the following code output? A. One.B. Two.C. Three.D. Four.E. None of the above. The code does not compile. public class Cars { private static void drive() { static { } }
What access modifier is used to mark class members package-private? A. default B. friend C. protected D. private E. None of the above
Which statements about static interface methods are correct? (Choose three.) A. A static interface method can be final.B. A static interface method can be declared private.C. A static interface
What is the result of executing the following program? A. 15B. 25C. 35D. One line does not compile.E. Two lines do not compile.F. The program compiles but throws an exception at runtime. public
Fill in the blanks with the only option that makes this statement false: A(n) ______________can access ______________ of the enclosing class in which it is defined.A. static nested class, static
What statement best describes the notion of effectively final in Java? A. A local variable that is marked finalB. A static variable that is marked finalC. A local variable whose primitive value or
What is the output of the Turnip class? A. 3B. 5C. The code does not compile.D. The code compiles but throws an exception at runtime.E. None of the above. package animal; interface GameItem { int
What is the output of the following application? A. 1B. 2C. 12D. The code does not compile.E. The code compiles but throws an exception at runtime.F. None of the above. package holiday; enum
Which statements about instance keywords are correct? (Choose two.)A. The that keyword can be used to read public members in the direct parent class.B. The this keyword can be used to read all
Suppose you have the following code. Which of the images best represents the state of the references c1, c2, and c3, right before the end of the main() method, assuming garbage collection hasn’t
Fill in the blanks: A class ____________ an interface and ______________ an abstract class.An interface ______________ another interface.A. extends, extends, implementsB. extends, implements,
What is the output of the following application?A. 7B. 5C. The code does not compile.D. The code compiles without issue, but the output cannot be determined until runtime.E. None of the above.
What is the output of the following application? A. 5 bent!B. 5.0 bent!C. The code does not compile because Bend is not a functional interface.D. The code does not compile because of the apply(
Which statement is true about encapsulation while providing the broadest access allowed?A. Variables are private, and methods are private.B. Variables are private, and methods are
Fill in the blanks: The ___________________ access modifier allows access to everything the ___________________ access modifier does and more.A. package-private, privateB. private,
Which statement about the following interface is correct? A. The code compiles without issue.B. The code does not compile because of line k1.C. The code does not compile because of line
Which is the first line to fail to compile? A. r1B. r2C. r3D. r4E. r5F. None of the above class Tool { } private void repair() {} void use() {} } // r1 // r2 class Hammer extends Tool {
Showing 700 - 800
of 1045
1
2
3
4
5
6
7
8
9
10
11