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 Plant program? class Bush extends Plant { String type="bush"; } public class Plant { } String type = "plant"; public static void main(String[] args) { Plant w1= new
Which modifier can be applied to an abstract interface method? A. finalB. interfaceC. protectedD. voidE. None of the above
Which statements can accurately fill in the blanks in this table? (Choose two.) A. Blank 1: an instance method onlyB. Blank 1: a static method onlyC. Blank 1: an instance or static
What is true of the following code? (Choose three.) A. It compiles as is.B. It does not compile as is.C. Removing line 2 would create an additional compiler error.D. Removing line 2 would not
What is the correct order of statements for a Java class file?A. import statements, package statement, class declarationB. package statement, class declaration, import statementsC. class
Which are true of the following? (Choose two.) A. The code compiles.B. One line doesn’t compile.C. Two lines don’t compile.D. If any constructors and/or methods that do not compile are
Which of the following class types cannot be marked final or abstract?A. static nested class.B. Local class.C. Anonymous class.D. Member inner class.E. All of the above can be marked final or
Which is the first line containing a compiler error? A. x1B. x2C. x3D. None of the above var title="Weather"; // line x1 var hot 100, var cold = 20; // line x2 = var f = 32, int c = 0; // line x3
Fill in the blanks: The ___________________ access modifier allows access to everything the ___________________ access modifier does and more. (Choose three.) A. package-private,
How many of the following members of Telephone interface are public? A. Zero.B. One.C. Two.D. Three.E. Four.F. The code does not compile. public interface Telephone { static int call () {
How many lines will not compile? A. Zero B. OneC. TwoD. ThreeE. FourF. Five 12: public void print Varargs (String... names) { System.out.println (Arrays.toString (names)); 13: 14: } 15:
Which best describes what the new keyword does?A. Creates a copy of an existing object and treats it as a new one.B. Creates a new primitive.C. Instantiates a new object.D. Switches an object
What is the minimum number of lines that need to be removed to make this code compile? A. 1.B. 2.C. 3.D. 4.E. The code compiles as is. @FunctionalInterface public interface Play { public static
Which of the following can include a static method in its definition? (Choose three.) A. InterfaceB. Anonymous classC. Abstract classD. Member inner classE. Local classF. static nested class
What change is needed to make Secret well encapsulated? A. Change number to use a protected access modifier.B. Change number to use a public access modifier.C. Declare a private
Fill in the blanks: A class that defines an instance variable with the same name as a variable in the parent class is referred to as ___________________ a variable, while a class that defines a
What is the output of the following application? A. TALLB. The code does not compile because of line w1.C. The code does not compile because of line w2.D. The code does not compile for another
Which of the following are the best reasons for creating a public static interface method? (Choose two.)
Which line of code, inserted at line p1, causes the application to print 5? A. this(4);B. new Jump(4);C. this(5);D. rope = 4;E. super(4);F. super(5); package games; public class Jump { }
Which of the following is not a valid order for elements within a class?A. Constructor, instance variables, method declarationsB. Instance variables, static initializer constructor, method
Which statement about the following program is correct? (Choose two.) A. The code does not compile because of line u1.B. The code does not compile because of line u2.C. The code does not compile
Which of the following is not a reason to use encapsulation when designing a class?(Choose two.)A. Improve security.B. Increase concurrency and improve performance.C. Maintain class data integrity
Which is not a true statement given this diagram? Assume all classes are public.A. Instance methods in the Blanket class can call the Flashlight class’s turnOn().B. Instance methods in the
Which of the following statements are correct? (Choose two.)A. Java allows multiple inheritance using two abstract classes.B. Java allows multiple inheritance using two interfaces.C. Java does not
Which statement about the following code is correct? A. The code contains an invalid constant.B. The method getSize() does not compile.C. The method getLength() does not compile.D. The method
What is the output of the following application? A. 2B. 5C. The first line with a compiler error is line q1.D. The first line with a compiler error is line q2.E. The first line with a compiler
What is the output of the following application? A. 2B. 3C. 5D. 7E. The code does not compile.F. None of the above. package ocean; abstract interface CanSwim { public void swim (final int
Given the following method signature, which classes can call it? void run(String government) A. Classes in other packagesB. Classes in the same packageC. Subclasses in a different packageD. All
Which is the first declaration to not compile? A. The CanBurrow interface does not compile.B. The HasHardShell interface does not compile.C. The Tortoise interface does not compile.D. The
Which of the following are not valid variable names? (Choose two.) A. _ B. _blue C. 2blue D. blue$ E. Blue
What is the value of tip after executing the following code snippet? A. 1 B. 2 C. 3 D. 7 E. None of the above int meal = 5; int tip = 2; var total. meal+ (meal>6 ? tip++: tip--);
Which is the first line to not compile? A. Line m1B. Line m2C. Line m3D. Line m4E. None of the above interface Building { default Double getHeight () { return 1.0; } // m1 } interface Office {
What is the output of the following code snippet? A. 1B. 55C. 56D. It does not compile. String tree = "pine"; int count = 0; if (tree.equals("pine")) { } int height 55; count count + 1;
Which is equivalent to var q = 4.0f;? A. float q = 4.0f; B. Float q = 4.0f; C. double q = 4.0f; D. Double q = 4.0f; E. Object q = 4.0f;
What is the output of the following? A. 12 B. 123 C. 321 D. The code does not compile. 12: var b = "12"; 13: b = "3"; 14: b.reverse(); 15 : System.out.println(b.toString());
Which of the following are valid comments in Java? (Choose three.) A. /****** TODO */ B. # Fix this bug later C. 'Error closing pod bay doors D. / Invalid record / E. * Page not found */ // IGNORE
Given the following class, what should be inserted into the two blanks to ensure the class data is properly encapsulated? A. private and getStuffB. private and isStuffC. public and
Which of the following modifiers can both be applied to a method? (Choose three.) A. private and finalB. abstract and finalC. static and privateD. private and abstractE. abstract and
Given the following Venn diagram and the boolean variables, apples, oranges, and bananas, which expression most closely represents the filled-in region of the diagram? apples oranges bananas A.
How many rows of the following table contain an error? A. ZeroB. OneC. TwoD. ThreeE. Four. Interface member Static method Private non-static method Abstract method Default method Private static
What is the output of the following? A. false 1B. false 2C. true 1D. true 2E. Does not compile 5: var line = new String("-"); 6: var anotherLine = line.concat(""); 7: System.out.print(line ==
What is the output of the Watch program? A. smart watch,watchB. watch,smart watchC. watch,watchD. The code does not compile.E. An exception is printed at runtime.F. None of the above. 1: class
Fill in the blanks: ___________________ is used to call a constructor in the parent class, while ___________________ is used to reference a member of the parent class.A. super and this()B. super
What is the output of the Movie program? A. SequelB. TrilogyC. RemakeD. AdaptationE. nullF. None of the above package theater; class Cinema { private String name = "Sequel"; public Cinema
The author of this method forgot to include the data type. Which of the following reference types can best fill in the blank to complete this method? A. String B. StringBuilder C. Both D. Neither
Where can a final instance variable be assigned a value? (Choose three.) A. Instance initializerB. static initializerC. Instance methodD. On the line it is declaredE. Class
What is the output of the following code? A. hophopB. HOPhopC. hopHOPD. HOPHOPE. The code does not compile. public class Bunny { } static interface Rabbit { } static class FlemishRabbit
Which statement about encapsulation is not true? A. Encapsulation allows putting extra logic in the getter and setter methods.B. Encapsulation can use immutable instance variables in the
What is the output of the following application? A. Play!B. Music!C. The code does not compile.D. The code compiles, but the answer cannot be determined until runtime. package radio; public
What is the output of the following? A. 333 B. 333 806 1601 C. The code compiles but outputs something else. D. The code does not compile. var teams = = new StringBuilder ("333"); teams.append("
How lines of the following code do not compile? A. None, they all compileB. OneC. TwoD. ThreeE. FourF. Five or more 10: interface Flavor { 11: 12: 13: 14: public default void happy () {
Which of the following statements about overriding a method are correct? (Choose three.)A. The return types must be covariant.B. The access modifier of the method in the child class must be the
Given the following method, what is the first line that does not compile? A. k1B. k2C. k3D. k4E. k5 public static void main(String[] args) { int Integer } 0; Integer int= 0; Integer ++; int++;
Which of the following declarations does not compile? A. double num1, int num2 B. int num1, num2; C. int num1, num2 = 0; D. E. F. = 0; int num1 = 0, num2 = 0; All of the above None of the above
Of the following four modifiers, choose the one that is not implicitly applied to all interface variables.A. finalB. abstractC. staticD. public
What is the result of compiling and executing the following class? A. The code does not compile due to line x.B. The code does not compile due to line y.C. 31D. 61 public class Tolls { private
What is the output of the following application? A. 0 FLURRYB. 1 FLURRYC. 0 SunnyD. 1 SunnyE. The code does not compile.F. None of the above. package weather; public class Forecast { public
Which of the following is not a true statement? A. The first line of every constructor is a call to the parent constructor via the super() command.B. A class is not required to have a constructor
Fill in the blank with the line of code that allows the program to compile and print 10 at
How many lines does the following code output? A. One.B. Two.C. Three.D. Four.E. Five.F. None of the above. The code does not compile. public class Cars { static { } } private static void
What can fill in the blank so the play() method can be called from all classes in the com. mammal and com.mammal.eland package, but not the com.mammal.gopher package? package com.mammal; public class
Which of the following properties of an enum can be marked abstract? A. The enum type definitionB. An enum methodC. An enum valueD. An enum constructorE. None of the above
Suppose foo is a reference to an instance of a class Foo. Which of the following is not possible about the variable reference foo.bar? A. bar is an instance variable.B. bar is a static
The following diagram shows two reference variables pointing to the same Bunny object in memory. The reference variable myBunny is of type Bunny, while unknownBunny is a valid but unknown data type.
How many of these methods compile? A. ZeroB. OneC. TwoD. ThreeE. FourF. Five public class Singing { private void sing (String key) { } public void sing_do (String key, String... harmonies) {
Given the file Magnet.java shown, which of the marked lines can you independently insert the line var color; into and still have the code compile? // line al public class Magnet { // line a2 public
Given the following code, which lines when placed independently in the blank allow the code to compile and print bounce? (Choose two.) A. var new = TennisBall;B. TennisBall();C. var var = new
Which of these are functional interfaces? A. LionB. TigerC. Both Lion and TigerD. Neither is a functional interface.E. The code does not compile. interface } Lion { public void roar(); default
Which of the following interface methods are inherited by classes that implement the interface? (Choose two.)A. private methodsB. private static methodsC. default methodsD. static
Which is one of the lines output by this code? A. [] B. [8, 10] C. [8, 9, 10] D. [10, 8] E. The code does not compile. 10: var list= new ArrayList (); 11: list.add (10); 12: list.add (9); 13:
Which of the following can fill in the blank so the code prints true? var happy :) ( "; var really happy.trim(); var question = = System.out.println(really.equals(question)); A. happy.substring(0,
How many of the following lines contain a compiler error? A. 0B. 1C. 2D. 3E. 4 double num1 = 2.718; double num2 = 2._718; double num3 = 2.7_1_8; double num4 = _2.718;
What is the output of the following application? A. 2 5 B. 8 5 C. 6 5 D. The code does not compile. E. None of the above. public class Airplane { static int start = 2; final int end; } public
What is the output of the following class? A. 2B. 3C. 4D. None of the above 1: package rocket; 2: public class Countdown { 3: 4: 5: 6: 7: 8: } public static void main(String[] args) { var builder =
What is the output of the following code snippet? A. true-2-trueB. false-2-falseC. true-2-falseD. true-3-falseE. true-3-trueF. false-3-false int height = 2, length boolean w = height > 1 | --length
What is the output of the following? A. eB. dC. edD. None of the above 1: public class Legos { 2: 3: 4: 5: 6: 7: 8: 9: } public static void main(String[] args) { var sb = new StringBuilder();
What is the output of the following application? A. 1 1 2B. 5 2 2C. 5 2 1D. 6 2 2E. 6 2 1F. The code does not compile. package world; public class Matrix { private int level = 1; class Deep {
What is the output of the Rocket program? A. 2,5B. 3,4C. 5,2D. 3,5E. The code does not compile.F. None of the above. } package transport; class Ship { } protected int weight = 3; private int
Imagine you are working with another team to build an application. You are developing code that uses a class that the other team has not finished writing yet. You want to allow easy integration once
For the diagram in the previous question, how many classes can write code that references the light variable?A. NoneB. OneC. TwoD. ThreeE. Four com.color Red . protected boolean light Blue .
Given the following method signature, which classes cannot call it? protected void run(String government)A. All classes in other packagesB. All classes in the same packageC. Subclasses in a
How many cells in the following table are incorrect? A. ZeroB. OneC. TwoD. ThreeE. Four Allows abstract methods? Type Abstract class Yes Concrete class Yes Interface Yes Allows constants? Yes
Which statements are true about a functional interface? (Choose three.)A. It may contain any number of abstract methods.B. It must contain a single abstract method.C. It may contain any number of
What is a possible output of the following application? A. Your gift: wrap.Gift@29ca2745B. Your gift: Your gift:C. It does not compile.D. It compiles but throws an exception at runtime. package
Which variables have a scope limited to a method?A. Interface variablesB. Class variablesC. Instance variablesD. Local variables
How many compiler errors does the following code contain? A. NoneB. OneC. TwoD. ThreeE. Four package animal; interface CanFly { public void fly() {} } final class Bird { public int fly(int
Which of the following are the best reasons for creating a default interface method? (Choose two.) A. Allow interface methods to be overloaded.B. Add backward compatibility to existing
What is the output of the following code? A. hophopB. HOPhopC. hopHOPD. HOPHOPE. The code does not compile. public class Bunny { static class Rabbit { void hop() { } } } } static class
Which of the following statements is not true?A. An instance of one class may access an instance of another class’s attributes if it has a reference to the instance and the attributes are declared
Which of the following are valid class declarations? (Choose three.) A. class {} B. class river {} C. class Str3@m {} D. class Pond2$ {} E. class _var_ {} F. class 50cean {}
What is the output of the InfiniteMath program? A. 2.0B. 4.0C. 8.0D. The code does not compile.E. The code compiles but prints an exception at runtime.F. None of the above. class Math { public
Given the following application, which diagram best represents the state of the mySkier, mySpeed, and myName variables in the main() method after the call to the slalom() method? package slopes;
What is the output of the following application? A. Honk(1)!B. Honk(3)!C. The code does not compile.D. The code compiles, but the output cannot be determined until runtime.E. None of the above.
Fill in the blank with the line of code that allows the program to compile and print E at
Which can implement a functional interface?A. An anonymous classB. A top-level classC. A lambda expressionD. An anonymous class or a top-level classE. A top-level class or a lambda
Given the following two classes, each in a different package, which line inserted into the code allows the second class to compile? A. static import clothes.Store.getClothes; B. import
What is the output of the ElectricCar program? A. Driving vehicleB. Driving electric carC. Driving carD. The code does not compile.E. The code compiles but produces a ClassCastException at
Given the following class declaration, which options correctly declare a local variable containing an instance of the class? A. new Sunset() extends Sky {};B. new Sky();C. new Sky() {}D. new
What is the output of the Encyclopedia program? A. Reading is fun!-papyrusB. Reading is fun!-celluloseC. null-papyrusD. null-celluloseE. The code does not compile.F. None of the above. package
What does the following print? A. false, false, falseB. false, false, trueC. false, true, trueD. true, false, trueE. true, true, falseF. true, true, true interface Vehicle {} class Bus
Showing 800 - 900
of 1045
1
2
3
4
5
6
7
8
9
10
11