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
Which statements about parallel streams are correct? (Choose two.)A. A parallel stream is always faster than a serial stream.B. The JVM will automatically apply a parallel stream operation to an
What is the output of the following? A. over the riverB. through the woodsC. to grandmother's house we goD. None of the above. var s = Stream.of ("over the river", "through the woods", "to
Which can fill in the blank to have the code print the single digit 9? A. Only mapToDoubleB. Only mapToIntC. Only mapToLongD. Both mapToDouble and mapToIntE. mapToDouble, mapToInt, and
What is the output of the following application? A. 100B. 200C. 250D. The code does not compile because of line j1.E. None of the above. package savings; import java.util. function. *; public
Which statements about stateful lambda expressions are correct? (Choose two.)A. Stateful lambda expressions should be avoided on both serial and parallel streams.B. Stateful lambda expressions
Which method reference can replace the lambda on the second line so the output is the same? A. a::contains(b)B. a::containsC. String::contains(b)D. String::containsE. The supplied code does not
What is the best example of lazy evaluation?A. The pipeline can execute before seeing all the data.B. The pipeline does not begin until the terminal operation is executed.C. The pipeline executes
Which method can be applied to an existing Stream to return a stream with a different generic type?A. distinct()B. iterate()C. peek()D. sorted()E. filter()F. None of the above.
The ______________ functional interface has an apply() method, while the ______________ functional interface has an applyAsDouble() method. (Choose
Given the following code snippet, what statement about the values printed on lines q1 and q2 is correct? A. They are always the same.B. They are sometimes the same.C. They are never the
Which of the following can fill in the blank to have the code print out *? A. (s,t) -> s.length() - t.length()B. String::isEmptyC. Both of these will produce the desired output.D. Neither of
Which statement about functional interfaces and lambda expressions is not true?A. A lambda expression may be compatible with multiple functional interfaces.B. A lambda expression must be assigned
Which can fill in the blank to have the code print true? A. anyMatchB. allMatchC. noneMatch.D. None of the above. var stream Stream.iterate(1, var b = stream.. System.out.println(b); i-> i); (i
Given the following class, how many lines contain compilation errors? A. None. The code compiles as is.B. One.C. Two.D. Three.E. Four.F. Five. 1: package showtimes; 2: import java.util.*; 3:
Which statements about the findFirst() method applied to a stream are correct?(Choose three.)A. It always returns the first element on an ordered serial stream.B. It may return any element on an
Which method reference can replace the lambda in the first line of the main() method to produce the same
What is true of the following code? A. The code runs without error and prints 0.B. The code runs without error and prints 1.C. The code throws an exception on line 23.D. The code throws an
Which changes can be independently made to this code and have it still compile? (Choose three.) A. Change StringBuilder b to var b.B. Change StringBuilder b to b.C. Remove StringBuilder
What does this code output? A. babyB. chickC. cygnetD. ducklingE. The code does not compile. var babies = Arrays.asList("chick", "cygnet", "duckling"); "baby"; babies.replaceAll(x -> { var
Which lambda expression cannot be assigned to a DoubleToLongFunction functional interface? A. a -> null==null ? 1 : 2LB. e -> (int)(10.0*e)C. (double m) -> {long p = (long)m; return
Given the following code snippet, which values of x will allow the call divide(x) to compile and provide predictable results at runtime? (Choose
Which of the following produces different output than the others? A. Stream.of ("eeny", "meeny", "miny", "moe") .collect (partitioningBy (x -> x.charAt(0) .get(false) B. C. .stream ( ) .collect
Given an IntStream, which method would you use to obtain an equivalent parallel IntStream? A. parallelStream()B. parallels()C. getParallelStream()D. parallel()E. getParallel()F. None of the
Which statement is true?A. All lambdas can be converted to method references, and vice versa.B. All lambdas can be converted to method references, but not vice versa.C. All method references can
The following diagram shows input arguments being used in three functional interface methods of unknown type. Which three functional interfaces, inserted in order from left to right, could be used to
Which of the following is not a functional interface in the java.util.function package? (Choose two.)A. DoublePredicateB. LongUnaryOperatorC. ShortSupplierD. ToIntBiFunctionE. ToStringOperator.
What is the output of the following application? A. [JENNY, GRACE]B. [ted]C. [tps.Boss@4218224c, tps.Boss@815f19a]D. The code does not compile because of the lambda expression.E. The code does
Which lambda can implement this functional interface? A. () -> System.out.println()B. n -> System.out.println(n)C. () -> trueD. n -> trueE. None of the above. public interface
How many of these lines compile? A. OneB. TwoC. ThreeD. FourE. FiveF. Six. 17: Comparator 18: Comparator false; String> c2 (s1, s2) > false; pl String s> false; p2 = (String s) -> false; s1=
Which method is not available on the IntSummaryStatistics class?A. getCountAs Long ()B. getMax ()C. toString()D. None of these methods is available.E. All of these methods are available.
Which functional interface, when filled into the blank, allows the class to compile? A. ConsumerB. FunctionC. SupplierD. UnaryOperatorE. None of the above. package sleep; import java.util.
Given an instance of Stream s and Collection c, which of the following are valid ways of creating a parallel stream? (Choose
What is true of the following code? (Choose two.) A. As written, the code prints one line.B. As written, the code prints two lines.C. As written the code does not compile.D. If line 7 is
What is the minimum number of intermediate operations that can fill in each box [M, N, O, P] to have the pipeline complete given any intermediate operation? A. [0, 0, 0, 1]B. [0, 0, 1, 0]C. [0,
Given the table in the previous question, how many of the boxes in the Intermediate Operation column will have the pipeline complete regardless of which intermediate operation is placed in the
Which of the following declares a Comparator where all objects are treated as equal?A. Comparator comp = (c1) -> 0;B. Comparator comp = (c1) -> {0};C. Comparator comp = (c1, c2) ->
Which can fill in the blank so this code outputs true? A. Only anyMatchB. Only allMatchC. Both anyMatch and allMatchD. Only noneMatchE. The code does not compile with any of these options.
Which method reference can replace the lambda on the second line so the output is the same? A. s::contains(a)B. s::containsC. String::contains(a)D. String::containsE. The supplied code does not
How many of these lines compile? A. 0B. 1C. 2D. 3E. 4F. 5 Predicate Predicate Predicate Predicate Predicate pred1 = (final String s) ->s.isEmpty(); pred2 = (final s) ->s.isEmpty(); pred3 =
What is the output of the following application? A. 0B. 2C. 3D. The code does not compile because of the lambda expression.E. The code does not compile for a different reason. package pet;
What does the following output? A. [tire-][wheel-]B. tire-wheelC. None of the above.D. The code does not compile. Set set = new HashSet (); set.add("tire-"); List list = new LinkedList (); Deque
How many lines does this code output? A. One.B. Two.C. Three.D. None. The code does not compile.E. None. The code throws an exception at runtime. 1: import java.util.*; 2: 3: 4: 5: 6: 7: 8: 9:
How many of the following lines compile? A. NoneB. OneC. TwoD. ThreeE. FourF. Five. 8: IntFunction 9: IntFunction 10: IntFunction IntFunction 11: 12: IntFunction f1 = (Integer f) -> f; (v) ->
Which statements about using a parallel stream instead of a serial stream are correct? (Choose three.) A. The number of threads used is guaranteed to be higher.B. It requires a stateful lambda
Which is a possible output of the following code snippet? A. {false=[Stonehenge, Statue of Liberty], true=[Eiffel Tower, Mount Fuji]}B. {false=[Stonehenge], true=[Mount Fuji, Eiffel Tower, Statue
Which can independently fill in the blank to output No dessert today? A. get("No dessert today")B. orElse("No dessert today")C. orElseGet(() -> "No dessert today")D. orElseThrow()E. None of
What is the output of this code? A. bloatB. BLOATC. oneD. ONEE. The code does not compile due to line x.F. None of the above. List.of("one", "two", "bloat") .limit (1) .map (String: :
Which is one of the lines output by this code?A. []B. [8]C. [9]D. [10]E. The code does not compile. 10: var list = new ArrayList (); 11: list.add (10); 12: List.add(9); 13: list.add(8); 14: 15
What is the output of the following? A. 689B. 986C. The code does not compile.D. The code compiles but throws an exception at runtime. import java.util.Comparator; import
What can a lambda implement?A. All functional interfacesB. Any interfaceC. Only functional interfaces in the JDKD. None of the above.
What is the output of the following application? A. Plenty!B. On Backorder!C. The code does not compile because of the checkInventory() method.D. The code does not compile for a different
What is a possible output of the following application? A. {0.0=[Cold!], 72.0=[HOT!, Just right!]}B. {0.0=[Cold!], 72.0=[Just right!] , 72.0=[HOT!]}C. The code does not compile because of line
What is the name of a file that declares a module?A. mod.javaB. mod-data.javaC. mod-info.javaD. module.javaE. module-data.javaF. module-info.java
Suppose you have a module that contains a class with a call to exports(ChocolateLab.class). Which part of the module service contains this class?A. ConsumerB. Service locatorC. Service
Which are considered part of a service? (Choose two.)A. ConsumerB. Service locatorC. Service providerD. Service provider interface
Given the following diagram, how many of the following are named modules? A. 0B. 1C. 2D. 3E. 4 classpath dog.fluffy.jar dog.fluffy dog.husky.jar dog.husky module-info module path dog.hair.jar
Which of the following statements are true? (Choose two.)A. It is a good practice to add the --add-exports option to your java command.B. It is permitted, but not recommended, to add the
How many of the following are legal module-info.java files? A. NoneB. OneC. TwoD. ThreeE. Four. module com.koala { exports cute; } module com-koala { exports cute; } public module com.koala {
Which two would be best to combine into a single module?A. Consumer and service locator.B. Consumer and service providerC. Consumer and service provider interfaceD. Service locator and service
What command could you run to print output like the following? A. java --all-modulesB. java --describe-modulesC. java --list-modulesD. java --output-modulesE. java --show-modulesF. None of the
Suppose we have an automatic module on the module path named dog-arthur2.jar and no Automatic-Module-Name specified? What module name should named modules use to reference
Given the dependencies in the diagram, which boxes represent the service provider interface and service provider, respectively? A. W and XB. W and ZC. X and YD. X and ZE. Y and ZF. None of the
Using the diagram in the previous question, which boxes represent the consumer and service locator, respectively? A. W and XB. W and ZC. X and YD. X and ZE. Y and ZF. None of the above. W Y X Z
What is the minimum number of JAR files you need for a cyclic dependency? A. 0B. 1C. 2D. 3E. 4
Fill in the blank with code to look up and call a service. A. Mouse.get()B. Mouse::getC. Provider.get()D. Provider::getE. None of the above. String cheese .map(_ .map (Mouse: : favorite Food)
Suppose we want to have two modules: com.ny and com.sf. Which is true about the placement of the module-info.java file(s)? A. One module-info.java file is required in position Z.B. Two
Consider the modules in the previous diagram. Suppose we want the code in module com.sf to depend on code in module com.ny. Which of the following directives goes into module com.sf’s module-info
Which options are commonly used when compiling a module? A. -d and -mB. -d and -pC. -m and -pD. -d, -m, and -pE. None of the above.
Which of the following are modules supplied by the JDK? (Choose three.) A. java.baseB. java.basicC. java.desktopD. java.sdkE. java.sqlF. java.swing
Which best describes a top-down migration? (Choose two.)A. The first step is to move all the modules to the module path.B. The first step is to move a single module to the module path.C. Most
Suppose the consumer, service locator, service provider, and service provider interface are each in separate modules. Which of the following best describes the following module-info
Suppose you have these two JARs from Java 8. Which steps, when taken together, would be the best way to make them modules? (Choose two.) A. Add a module-info.java to each.B. Add them to the
Which command produces output such as the following?animal.puppy -> animal.dog.A. jdeps –d zoo.animal.puppy.jarB. jdeps –s zoo.animal.puppy.jarC. jmod –d zoo.animal.puppy.jarD. jmod –s
Suppose the consumer, service locator, service provider, and service provider interface are each in separate modules. Which of the following best describes the following moduleinfo
Suppose the consumer, service locator, service provider, and service provider interface are each in separate modules. Which of the following best describes the following module-info
What is a benefit of using modules? (Choose two.)A. Better access controlB. Custom Java buildsC. Elimination of JAR filesD. Fewer .java files needed in your applicationE. Not necessary to
Suppose the consumer, service locator, service provider, and service provider interface are each in separate modules. Which of the following best describes the following module-info
Which types of modules are allowed to contain a module-info file?A. Automatic onlyB. Named onlyC. Unnamed only.D. Automatic and namedE. Automatic and unnamedF. Named and unnamed.
Which of the following is true of the following module declaration? A. The first line that fails to compile is line 1.B. The first line that fails to compile is line 2.C. The first line that
How many of these keywords can be used in a module-info.java file: closes, export, import, require, and uses? A. NoneB. OneC. TwoD. ThreeE. FourF. Five.
Suppose the consumer, service locator, service provider, and service provider interface are each in separate modules. Which of the following best describes the following module-info
Which of the following are modules supplied by the JDK? (Choose three.)A. jdk.baseB. jdk.basicC. jdk.desktopD. jdk.javadocE. jdk.jdepsF. jdk.net
Which are true statements about types of migration? (Choose three.)A. All modules are immediately moved to the module path in a bottom-up migration.B. All modules are immediately moved to the
A class in which of the following parts of a module service should include a method call to load(ChocolateLab.class) that would allow callers to use it? A. ConsumerB. Service locatorC. Service
How many of these module declarations are valid? A. ZeroB. OneC. TwoD. ThreeE. FourF. Five. module com. leaf {} module com.leaf2 {} module com-leaf { } module LEAF {} module leaf2 {}
Which is a benefit of ServiceLoader?A. It allows you to add functionality without recompiling the application.B. It allows you to load a service written in C++.C. It is an interface.D. When
Which are true statements? (Choose two.)A. Code on the classpath can reference code in automatic, named, and unnamed modules.B. Code on the classpath can reference code in named modules, but not
Suppose we have the packages in the diagram. What could we add to the module-info.java in com.duck to allow the com.park module to reference the Duckling class but not allow the com.bread module to
Given the diagram in the previous question, what could we add to module-info.java in com.duck to allow the com.park package to reference the Duckling class, but not allow the Egg class to reference
Given the diagram in question 43 and the correct export statement to share only com. duckling, which of the following should be included in the module-info.java file of com.park to specify that
Which is both part of the service and has a provides directive?A. ConsumerB. Service locatorC. Service providerD. Service provider interfaceE. None of the above.
What command is the simplest way to list suggestions for classes in jdk.unsupported?A. jdeps cookie.jarB. jdeps –s cookie.jarC. jdeps –jdkinternals cookie.jarD. jdeps --jdkinternals
Which modules are on the classpath?A. Automatic onlyB. Named onlyC. Unnamed onlyD. Automatic and namedE. Automatic and unnamedF. Named and unnamed.
Which line of code belongs in a service locator?A. ServiceLoader loader = ServiceLoader.load();B. ServiceLoader loader = ServiceLoader.load(Mouse.class);C. ServiceLoader loader =
Which is true about a service? (Choose two.)A. Changing the service provider interface always requires recompiling the service provider.B. Changing the service provider interface sometimes requires
Which modules are on the module path?A. Automatic onlyB. Named onlyC. Unnamed onlyD. Automatic and namedE. Automatic and unnamedF. Named and unnamed.
The service locator and service provider interface share a module. Which boxes represent the consumer and service provider, respectively? A. X and YB. X and ZC. Y and ZD. Z and ZE. Z and
What command is the simplest way to list what modules a JAR depends on without listing package names? A. jdeps cookie.jarB. jdeps –s cookie.jarC. jdeps –jdkinternals cookie.jarD. jdeps
What is a benefit of using modules? (Choose three.)A. Ability to reuse codeB. Clearer dependency managementC. Improved performanceD. Multithreading supportE. Platform independenceF. Unique
Fill in the blanks to list a way of getting a lot of information useful in debugging modules: _______ -m x –p y --______________.A. jar and –show-modulesB. jar and –show-module-detailC. jar
Showing 300 - 400
of 1045
1
2
3
4
5
6
7
8
9
10
11