New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
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
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
computer science
oracle
OCP Oracle Certified Professional Java SE 11 Developer Practice Tests Exam 1Z0 819 And Upgrade Exam 1Z0 817 1st Edition Scott Selikoff, Jeanne Boyarsky - Solutions
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: public class Computer { 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 24 15: 16: 17: } public void compute()
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 ProblemException extends Exception { ProblemException (Exception e) { super (e); } } class Major
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, RuntimeException at position 2C. IllegalArgumentException at position 1, RuntimeException at position
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 TimeMachine implements AutoCloseable { int v; public Time Machine (int v) {this.v = v;} public void
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 line w3.D. The code does not compile because of line w4.E. The code compiles and prints a stack
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 handle or declare potential problemsC. To ensure that exceptions never cause the application 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 Happy extends IOException {} public class Dopey extends Grumpy {} public class Sleepy extends
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 class Duck { protected int count; public abstract int getDuckies(); } public class Ducklings extends
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 can be declared in any order. B. A try statement cannot be declared with these two catch block 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 not compile because of line z2.E. The code does not compile because of line z3.F. None of the above.
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 code where this is called can include a try-with-resources block that handles this exception.C. This
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 compile due to the declaration of IncidentReportException.E. None of the above. package com.tps; import
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 rF. The code does not compile regardless of the expression used. package music; import java.sql.*;
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 exception is printed at runtime with Text in the message.D. The code does not compile.E. None of the
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 level) throw RuntimeException { if (level
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 furniture; class Chair { public void sit() throws IllegalArgumentException {
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 statement.E. The code does not compile for a different reason. import java.io.*; import java.sql.*;
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 compile because of line h2.D. The code does not compile because of line h3.E. The code does not compile
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 reason.F. None of the above. package tron; class DiskPlayer implements AutoCloseable { public void close()
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 the answer cannot be determined until runtime.E. None of the above. package canyon; final class
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 of theseD. Neither of these.
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 to register an account at the same time.C. An order update page calls itself infinitely.D. 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 compile due to the declaration of IncidentReportException.E. None of the above. package com.tps; import
Given the following application, which specific type of exception will be printed in the stack trace at runtime? A. ClassCastExceptionB. IllegalArgumentExceptionC. NullPointerExceptionD. RuntimeExceptionE. The code does not compile.F. None of the above. } package carnival; public class
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 museums = new ArrayList (1); museums.add("Natural History"); museums.add("Science");
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[] {}; String ohMy [] = new String[0] {};
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 code uses autoboxing.E. Two lines of code use autoboxing.F. Three lines of code use autoboxing.
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[] [] blue = new int [2 x 2]; E. None of the above
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: chars.add('b'); 23: chars.clear(); 24: chars.remove(0); 25: System.out.print(chars.isEmpty()+""+
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 above import java.util.*; public class ExtendingGenerics { } private static < list.add(element);
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 array with the value Times Square.C. It does not compile.D. It throws an exception.E. None of 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] = 'X'; ticTacToe [2] [2] = 'X'; ticTacToe [3] [1] = 'X'; System.out.println(ticTac Toe. length + "
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 -> a.length() > 10); System.out.println (list.size());
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. private void output ( x. for Each } _ x) { (System.out::println);
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 { } public class LaundryTime { public static void main(String[] args) { Wash wash new 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: mags.put("Readers Digest", 1922); 38: mags.put("The Economist", 1843); 39: 40: Collection years =
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" "y" "Z"
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", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; for (int i = 1; i
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 String name; public Magazine (String name) { this.name name; } @Override public int compareTo
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", "29.99" } }; System.out.println(listing. length + " "+ listing [0].length);
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 exception.F. 3null4 13: var numbers = Arrays.asList (3, 1, 4); 14: numbers.set(1, null); 15: int first =
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. add ("snowball"); addLast("sugar"); addFirst("minnie"); q. q. System.out.println(q.peek() + " " +
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 NullPointerException.E. The code throws a different exception. public class FirstName { public static void
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: pennies.add (Integer.value0f (3)); 15: pennies.add (Integer.valueOf (4)); 16: pennies.remove (2); 17:
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 blank contains x.compareTo(y), then the code outputs 0.D. If the blank contains -y.compareTo(x), then
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); System.out.println (Arrays.toString (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 null.D. If any lines that do not compile are removed, the String on line 41 is set to "pan".E. If any
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] [0] = 'X'; ticTacToe [1][1] = 'X'; 'X'; // r1 // r2 ticTacToe [2] [2] System.out.println(ticTacToe.
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", "a", "little", "lamb"); 20: Set set = new HashSet (list); 21: set.addAll(list); 22: for (String
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 RuntimeException()); coll.add(new Exception ()); } coll) {
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 (); q.offer ("snowball"); q.offer ("minnie"); q.offer ("sugar"); System.out.println(q.peek() + " " +
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 different exception at runtime. 1: package fun; 2: public class Sudoku { 3: static int[][] game; 4: 5: 6: 7:
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", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; for (int i = 1; i <
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 checkout system finds the book based on this number and marks the book as checked out. Of these choices,
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 (String s1, String s2) { return s1.length() s2.length(); } B. public int compare (String s1, String
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 lines contain a compiler error.E. If the compiler errors were fixed, the code would throw an
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 the does not compile.D. If the blank contains String, then the code outputs flower.E. If the blank
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"); _ (); System.out.println(c.isEmpty());
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 epsilon [] []; var[] []zeta; }
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); System.out.print(set.size()); System.out.print(" "); System.out.print (set. iterator () .next());
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 compile.C. When inserting HashMap into the blank, the code prints 1 false.D. When inserting HashMap into the
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; public Magazine (String name) { this.name name; } public int compareTo (Magazine m) { return
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] = 'X'; ticTacToe [2] [2] = 'X'; // r1 // r2 ticTacToe [3] [1] = 'X';
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 Fur { } void clean () { } var bat= new Fur (); var cat= new Fur (); var sat = new Fur (); // line
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 (3.14)); 20: nums.add((long) Math.pow(4,2)); 21: System.out.println(nums);
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 (18); 7: x.offer (5); 8: x.push (13); 9:System.out.println(x.poll(). " " + x.poll());
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} }; D. 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 two.) A. ArrayListB. HashMapC. HashSetD. SortedArrayE. TreeMapF. TreeSet
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 iter coll. iterator(); if (iter.hasNext()) throw iter.next(); } coll) {
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 trains[trains.length]D. trains[1] and trains[trains.length - 1]E. None of the above.
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 = new String[] { "Mac", "Linux", "Windows" }; var search = Arrays.binary Search (linux, "Linux");
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: interface Comic { 2: void draw(C c); 3: 4: } class ComicClass implements Comic { public void draw (C c)
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 implements Comparable { private int id; public Truck (int id) { this. id = id; } } @Override public int }
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", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; for (int i = 0; i < days. length; i++)
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", "Science")E. new ArrayList("Natural History", "Science")F. new List("Natural History", "Science")
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 Wash();F. All of these can fill in the blank. class Wash { T item; public void clean (T item) {
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'} }; Option A Option B blocks blocks 'a' 'b' 'C' 'd' Option C 'f' 'a' 'b' 'c' 'd' 'e 'E' 'g 1 blocks
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) -> s.charAt(0))D. Comparator.comparing((String s) -> s.charAt(0)).reverse()E. 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 [1] float;
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] [0] matrix [0] [1] matrix [1] [0] matrix [1] [1] = // m1 = // m2 "I'm trying to free your mind
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. Comparing(String::length).reversed()E. None of the above. var list List.of("alpha", "beta", "gamma"); ); Collections.sort (list,
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 var names = new HashMap (); names.put("peter", "pan"); names.put("wendy", "darling"); var first
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, "RedHat")); System.out.println(Arrays.binary Search (os, "Mac"));
Suppose we have list of type List. Which method allows you to pass a List and returns an immutable Set containing the same elements? A. List.copyOf(list)B. List.of(list)C. Set.copyOf(list);D. Set.of(list);E. None of the above
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"); q.offer Last ("minnie"); System.out.println(q.poll()); System.out.println(q.removeFirst());
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[] nums4a [] [] [], nums2b; nums 3b [] []; numbs 4b [] [] [];
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 element is larger.D. It is undefined.E. The code does not compile. var ints = new int[] {3,1,4}; var
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 HashSet();E. HashSet set = new HashSet();
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 = list.get(0); 24: Integer letter4 = list.get(0); 25: Object letter5 = list.get(0);
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 Fur
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 NullPointerException.F. The code does not compile. 1: import java.util. *; 2: public class Binary { 3: 4: 5:
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); Collections.sort(ints, c); System.out.println(Collections.binarySearch(ints, 1));
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 inserted at positions Q and S without making any other changes.C. can be inserted at all four
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 accurate, but slower than if it were sorted. B. The array does not need to be sorted before calling
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 different exception at runtime. 1: package fun; 2: public class Sudoku { 3: 4: 5: 6: 7: 8: 9: 10: 11: }
Showing 600 - 700
of 1045
1
2
3
4
5
6
7
8
9
10
11
Step by Step Answers