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 application? A. zeroB. oneC. zero followed by a stack traceD. one followed by a stack traceE. Does not compileF. None of the above. 1: package robot; 2:
What is the output of the following code? A. 123B. 123 followed by an exception stack traceC. 1234D. 1234 followed by an exception stack traceE. Does not compileF. None of the above. } } class
Given the following class diagram, which two classes are missing in the hierarchy at positions 1 and 2? A. IOException at position 1, Exception at position 2B. Exception at position 1,
What is the output of the following application? A. 1235B. 3215C. 5123D. 5321E. The code does not compile.F. None of the above. package vortex; class TimeException extends Exception {} class
Which statement about the following application is correct? A. The code does not compile because of line w1.B. The code does not compile because of line w2.C. The code does not compile because of
Which of the following are common reasons to add a checked exception to a method signature? (Choose three.)A. To alert developers that the state of the JVM has been corruptedB. To force a caller to
Which of the following exception classes must be handled or declared in the method in which they are thrown? (Choose three.) A. HappyB. DopeyC. SleepyD. SneezyE. DocF. Grumpy public class
What is the output of the following application? A. 0B. 1C. 5D. The code does not compile.E. The code compiles but throws an exception at runtime.F. None of the above. package pond; abstract
If a try statement has catch blocks for both IllegalArgumentException and NullPointerException, then which of the following statements is correct? A. The catch blocks for these two exception types
What is the output of the following application? A. FailedB. The application compiles, but a stack trace is printed at runtime.C. The code does not compile because of line z1.D. The code does
Which statements about the following line of code are correct? (Choose three.) throw new IllegalArgumentException ();A. The method where this is called must declare a compatible exception.B. The
What is the output of the following? A. com.tps.IncidentReportExceptionB. java.lang.IOExceptionC. The code does not compile because IOException is a checked exception.D. The code does not
Which expression, when inserted into the blank in the following class, allows the code to compile? A. Error rB. IllegalStateException bC. RingException qD. SQLException pE. RuntimeException
Which statement about the following program is true? A. An exception is printed at runtime with Call in the message.B. An exception is printed at runtime with Voicemail in the message.C. An
What is the output of the following application? A. MeowB. Roar!C. Roar!!!D. MeowRoar!E. A stack trace is printed at runtime.F. None of the above. package zoo; class BigCat { void roar (int
What is the output of the following application? A. creekB. thudC. thud?D. The code does not compile.E. The code compiles, but a stack trace is printed at runtime.F. None of the above. package
What is the output of the following application? A. 12B. 21C. The code does not compile because of the MyDatabase nested class.D. The code does not compile because of the try-with-resources
What is the result of compiling and running the following application? A. java.lang.IllegalArgumentException is printed.B. The code does not compile because of line h1.C. The code does not
How many lines of text does the following program print? A. One.B. Two.C. Three.D. The code does not compile because of the DiskPlayer class.E. The code does not compile for a different
Given the following application, what is the name of the class printed at line e1? A. canyon.FallenExceptionB. java.lang.RuntimeExceptionC. The code does not compile.D. The code compiles, but
What constructors are capable of being called on a custom exception class that directly extends the Exception class? A. One that takes a single ExceptionB. One that takes a single StringC. Both
Given an application that hosts a website, which of the following would most likely result in a java.lang.Error being thrown? (Choose two.)A. A user tries to sign in too many times.B. Two users try
What is the output of the following? A. com.tps.IncidentReportExceptionB. java.lang.IOExceptionC. The code does not compile because IOException is a checked exception.D. The code does not
Given the following application, which specific type of exception will be printed in the stack trace at
What is the output of the following?A. [Natural History, Science]B. [Natural History, Art, Science]C. The code does not compile.D. The code compiles but throws an exception at runtime. List
How many of the following are legal declarations? A. NoneB. OneC. TwoD. ThreeE. Four. [] String lions = new String[]; String[] tigers = new String[1] {"tiger"}; - String bears [] = new String[]
Which of the following can fill in the blank to make the code compile?public class News< > {}A. ? onlyB. N onlyC. ? and ND. News, and ObjectE. N, News, and ObjectF. None of the above.
What is true of this code? (Choose two.) A. The code compiles as is.B. One line needs to be removed for the code to compile.C. Two lines need to be removed for the code to compile.D. One line of
Which of the following creates an empty two-dimensional array with dimensions 2×2? A. int[][] blue = new int [2, 2]; B. int[][] blue = new int[2], [2]; C. int[][] blue = new int [2] [2]; D. int[] []
What is the output of the following? A. false 0B. true 1C. 2D. The code does not compile.E. The code throws an exception at runtime. 20: List chars new ArrayList (); 21: chars.add('a'); 22:
Which fills in the blank in the method signature to allow this code to compile? A. ? extends CollectionB. ? implements CollectionC. T extends CollectionD. T implements CollectionE. None of the
What does the following output? A. 0B. 1C. 2D. The output is not defined. String[] os = new String[] { "Mac", "Linux", "Windows" }; System.out.println(Arrays.binarySearch (os, "Linux"));
What happens when calling the following method with a non-null and non-empty array? A. It adds an element to the array the value of which is Times Square.B. It replaces the last element in the
Which is the first line to prevent this code from compiling and running without error? A. Line r1B. Line r2C. Line r3D. None of the above. char [][]ticTacToe = new char [3,3]; ticTacToe [1] [3]
What is the result of the following? A. 1B. 2C. 3D. None of the above var list new ArrayList (); list.add("Austin"); list.add("Boston"); list.add ("San Francisco"); list.removeIf (a ->
Which of the following cannot fill in the blank to make the code compile? A. CollectionB. LinkedListC. TreeMapD. None of these can fill in the blank.E. All of these can fill in the blank.
Which of the following fills in the blank so this code compiles? A. ?B. ? extends RuntimeExceptionC. ? super RuntimeExceptionD. None of the above public static void getExceptions (Collection
Which options can fill in the blanks to print Cleaned 2 items? A. extends, ArrayListB. extends, ListC. super, ArrayListD. super, ListE. None of the above import java.util.*; class Wash { }
What is the output of the following? (Choose two.) A. 1843B. 1922C. 1974D. The code compiles but throws an exception at runtime. 35: var mags new HashMap (); 36: mags.put("People", 1974); 37:
How do you access the array element with the value of "z"? A. dimensions["three"][2]B. dimensions["three"][3]C. dimensions[2][2]D. dimensions[3][3] dimensions "one" "p" "two" "x" "y" "three" "x"
How many lines does the following code output? A. Six.B. Seven.C. The code does not compile.D. The code compiles but throws an exception at runtime. var days = new String[] { "Sunday", "Monday",
What is the output of the following? A. highlightsB. NewsweekC. The code does not compile.D. The code compiles but throws an exception at runtime. class Magazine implements Comparable { private
What is the output of the following? A. 1 2B. 2 1C. 2 2D. The code does not compile.E. The code compiles but throws an exception at runtime. var listing = new String[][] { { "Book" }, { "Game",
What is the result of the following? A. The code does not compile.B. Line 14 throws an exception.C. Line 15 throws an exception.D. Line 16 throws an exception.E. Line 17 throws an
What is the output of the following? A. sugar sugar 3B. sugar minnie 1C. minnie minnie 3D. minnie snowball 1E. The code does not compile.F. None of the above. Queue q = new ArrayDeque (); q.
Fill in the blank so the code prints gamma. var list = Arrays.asList("alpha", "beta", "gamma"); Collections.sort (list, System.out.println(list.get (0)); -);
What is the output of the following when run as java FirstName Wolfie? (Choose two.) A. FirstNameB. WolfieC. The code throws an ArrayIndexOutOfBoundsException.D. The code throws a
What does the following output? A. [1, 2]B. [1, 4]C. [2, 4]D. [2, 3]E. [3, 4]F. The code does not compile. 11: var pennies = new ArrayList (); 12: pennies.add (1); 13: pennies.add(2); 14:
What is true of the following code? (Choose two.) A. If the blank contains -x.compareTo(y), then the code outputs 0.B. If the blank contains -x.compareTo(y), then the code outputs -1.C. If the
What does this code output? A. [1, 9, 10]B. [1, 10, 9]C. [9, 1, 10]D. [9, 10, 1]E. [10, 1, 9]F. [10, 9, 1] String[] nums= new String[] { "1", "9", "10" }; Arrays.sort (nums);
What is true of the following code? (Choose three.) A. One line does not compile.B. Two lines do not compile.C. If any lines that do not compile are removed, the String on line 40 is set to
Which is the first line to prevent this code from compiling and running without error? A. Line r1B. Line r2C. Line r3D. None of the above char[] [] ticTacToe = new char [3] [3]; ticTacToe [0]
What does the following output? A. [a, lamb, had, Mary, little]B. [a]C. [a, a]D. The code does not compile.E. The code throws an exception at runtime. 18: List list List.of( 19: "Mary", "had",
Which of the following fills in the blank so this code compiles? A. ?B. ? extends ExceptionC. ? super ExceptionD. None of the above. public static void getExceptions (Collection < coll.add(new
What is the output of the following? A. sugar sugar 3B. sugar minnie 1C. snowball minnie 1D. snowball snowball 3E. The code does not compile.F. None of the above. var q = new ArrayDeque ();
What is the result of running the following program? A. XB. The code does not compile.C. The code compiles but throws a NullPointerException at runtime.D. The code compiles but throws a
How many lines does the following code output? A. Zero.B. Six.C. Seven.D. The code does not compile.E. The code compiles but throws an exception at runtime. var days = new String[] { "Sunday",
We are running a library. Patrons select books by name. They get at the back of the checkout line. When they get to the front, they scan the book’s ISBN, a unique identification number. The
Suppose we want to implement a Comparator so that it sorts the longest strings first. You may assume there are no null values. Which method could implement such a comparator? A. public int compare
What is true of the code when run as java Copier.java? (Choose two.) A. One line contains a compiler error.B. Two lines contain a compiler error.C. Three lines contain a compiler error.D. Four
What is true of the following code? (Choose two.) A. If the blank contains int, then the code outputs 0.B. If the blank contains int, then the code outputs 1.C. If the blank contains int, then
Which cannot fill in the blank for this code to compile? A. ArrayListB. LinkedListC. TreeMapD. TreeSetE. All of these can fill in the blank. var c = new c.add("pen"); c.remove("pen"); _ ();
How many of the following are legal declarations? A. OneB. TwoC. ThreeD. FourE. FiveF. Six public void greek() { [][]String alpha; [] String beta; String [] [] gamma; String[] delta[]; String
What is the result of the following? A. 2 3B. 2 56C. 3 3D. 3 56E. None of the above. var list = new ArrayList (); list.add(56); list.add(56); list.add (3); var set = new TreeSet (list);
What is the output of the following? (Choose three.) A. When inserting ArrayList into the blank, the code prints 1 false.B. When inserting ArrayList into the blank, the code does not
What is the output of the following? A. highlightsB. NewsweekC. nullD. The code does not compile.E. The code compiles but throws an exception at runtime. class Magazine { private String name;
Which is the first line to prevent this code from compiling and running without error? A. Line r1B. Line r2C. Line r3D. None of the above. char[] [] ticTacToe = new char [3] [3]; ticTacToe [1]
What is the first line with a compiler error? A. Line RB. Line SC. Line TD. Line UE. None of the above. class Mammal {} class Bat extends Mammal {} class Cat extends Mammal {} class Sat {}
What is a possible result of this code? A. [3]B. [16]C. [16, 3]D. [16, 3, 3]E. None of the above. 17: var nums = new HashSet (); 18 nums.add((long) Math.min (5, 3)); 19: nums.add(Math.round
What is the output of the following? A. 13 5 B. 13 18C. 18 5D. 18 13E. The code does not compile.F. The code compiles, but prints something else. 5: var x = new LinkedList (); 6: x.offer
Which of these four array declarations produces a different array than the others? A. int[][] nums = new int [2] [1]; B. int[] nums[] = new int [2] [1]; C. int[] nums[] = new int[] [] { {0}, {0} };
Suppose we want to store JellyBean objects. Which of the following require JellyBean to implement the Comparable interface or create a Comparator to add them to the collection? (Choose
Which of the following fills in the blank so this code compiles? A. ?B. ? extends RuntimeExceptionC. ? super RuntimeExceptionD. None of the above. public static void throwOne (Collection < var
Which of the following references the first and last elements in a nonempty array?A. trains[0] and trains[trains.length]B. trains[0] and trains[trains.length - 1]C. trains[1] and
What does the following output? A. -1 0 -1B. -1 -1 0C. 0 -1 0D. 0 0 -1E. The output is not defined.F. The code does not compile. var linux = new String[] { "Linux", "Mac", "Windows" }; var mac
Which line in the main() method doesn’t compile or points to a class that doesn’t compile? A. Line 21.B. Line 22.C. Line 23.D. Line 24.E. None of the above. All of the code compiles. 1:
Fill in the blank to make this code compile: A. compare(Truck t)B. compare(Truck t1, Truck t2)C. compareTo(Truck t)D. compareTo(Truck t1, Truck t2)E. None of the above. public class Truck
How many lines does the following code output? A. Six.B. Seven.C. The code does not compile.D. The code compiles but throws an exception at runtime. var days = new String[] { "Sunday", "Monday",
Which of the following fill in the blank to print out true? (Choose two.) A. Arrays.asList(array)B. Arrays.asList("Natural History, Science")C. List.of(array)D. List.of("Natural History",
Which option cannot fill in the blank to print Clean socks? A. var wash = new Wash();B. var wash = new Wash();C. Wash wash = new Wash();D. Wash wash = new Wash();E. Wash wash = new
Which of the options in the graphic best represent the blocks variable? A. Option AB. Option BC. Option CD. Option D char [][] blocks = new char[][] { { 'a', 'b', 'c' }, { 'd' }, { 'e', 'f'} };
Fill in the blank so the code prints gamma. (Choose two.) A. (s, t) -> s.compareTo(t)B. (s, t) -> t.compareTo(s)C. Comparator.comparing((String s) ->
How many of the following are legal declarations? A. NoneB. OneC. TwoD. ThreeE. Four float [] lion = new float []; float [] tiger = new float [1]; float [] bear = new[] float; float [] ohMy new
Which is the first line of code that causes an ArrayIndexOutOfBoundsException? A. m1B. m2C. m3D. m4E. The code does not compile.F. None of the above var matrix = new String [1] [2]; matrix [0]
Fill in the blank so the code prints beta.A. (s, t) -> s.compareTo(t)B. (s, t) -> t.compareTo(s)C. Comparator. Comparing(String::length)D. Comparator.
What does the following output? A. peterB. wendyC. Does not compile due to line x1D. Does not compile due to line x2E. Does not compile due to another reasonF. Throws an exception at runtime
What does the following output? (Choose two.) A. -1B. -2C. -3D. 0E. 1F. 2 var os = new String[] { "Mac", "Linux", "Windows" }; Arrays.sort (os); System.out.println (Arrays.binarySearch (os,
Suppose we have list of type List. Which method allows you to pass a List and returns an immutable Set containing the same
Which of these elements are in the output of the following? (Choose three.) A. sugarB. minnieC. snowballD. 1E. 2F. 3 var q = new ArrayDeque (); q. offerFirst("snowball"); q.offer ("sugar");
Which of these four pairs of declarations can point to an array that is different from the others? A. int[] [] [] [] numsla, nums1b; B. int[][][] nums2a [], C. int[] [] nums 3a [][], D. int[]
What is true about the output of the following code? A. It is negative because ints has fewer elements.B. It is 0 because the arrays can’t be compared.C. It is positive because the first
Which of the following does not behave the same way as the others? A. var set = new HashSet();B. var set = new HashSet();C. HashSet set = new HashSet();D. HashSet set = new
How many of these lines have a compiler error? A. 0B. 1C. 2D. 3E. 4F. 5 20: var list List.of ('a', 'c', 'e'); 21: Char letter1 = list.get(0); 22: char letter2 = list.get(0); 23: int letter3 =
What is the first line with a compiler error? A. Line RB. Line SC. Line TD. Line UE. None of the above class Mammal {} class Bat extends Mammal {} class Cat extends Mammal {} class Sat {} class
What is the result of the following when called as java Binary.java? (Choose two.) A. nullB. []C. BinaryD. The code throws an ArrayIndexOutOfBoundsException.E. The code throws a
What is the result of the following? A. -1B. 0C. -1D. The code does not compile.E. The result is not defined. Comparator c= (x, y) -> y - x; var ints= Arrays.asList (3, 1, 4);
How many dimensions does the array reference moreBools allow? boolean[][] bools[], moreBools;A. One dimensionB. Two dimensionsC. Three dimensionsD. None of the above
Which statement is true about the following figure while ensuring the code continues to compile? (Choose two.) A. can be inserted at positions P and R without making any other changes.B. can be
Which statement most accurately represents the relationship between searching and sorting with respect to the Arrays class? A. If the array is not sorted, calling Arrays.binarySearch() will be
What is the result of running the following program? A. 6B. XC. The code does not compile.D. The code compiles but throws a NullPointerException at runtime.E. The code compiles but throws a
Showing 600 - 700
of 1045
1
2
3
4
5
6
7
8
9
10
11