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
Suppose you have the following interface in a module named animal.insect.api. What needs to be included in the module-info file for it to be a service provider interface? A. exports
What command is the simplest way to list what modules a JAR depends on including package names? A. jdeps cookie.jarB. jdeps –s cookie.jarC. jdeps –jdkinternals cookie.jarD. jdeps
How many modules are part of the cyclic dependency? A. 0B. 1C. 2D. 3E. 4 module com.light { exports com.light; } module com.animal { exports com.animal; requires com.light; requires com.plant;
What is true about the -d option?A. It can be used with the jar command, but not the java command.B. It can be used with the java command, but not the jar command.C. It can be used with the jar
Assuming all referenced files and directories exist and are correct, what does this code do? A. Creates a JAR file representing the com.mouse moduleB. Creates a JAR file that is not a
What module is always in the jdeps output?A. java.baseB. java.langC. java.selfD. jdk.baseE. jdk.langF. jdk.self
Which are valid modes on the jmod command? (Choose three.)A. createB. listC. hashD. showE. verboseF. version
This diagram shows the second step of a migration to modules. What type of migration is this? A. Bottom-up.B. Side-to-side.C. Top-down.D. There is not enough information to determine which type
Suppose we have the two JARs in the diagram on the module path and the module-info in the com.magic jar only exports one package: com.magic.unicorn. There is no module-info file in the com.science
Suppose the two JARs described in the previous question are on the classpath. How many of the four packages in the diagram can a module on the module path access?A. 0B. 1C. 2D. 3E. 4
What is true about the following module-info.java file?module Book { }.A. It does not compile because it is empty.B. It does not compile because the module name is uppercase.C. It does not compile
When adding a new service provider, which of these do you need to recompile?A. ConsumerB. Service locatorC. Existing service providersD. Service provider interfaceE. None of the above.
When working with modules, what option names are equivalent to -m and -s?A. --module and --shortB. --module and --statisticsC. --module and --summaryD. --module-path and --shortE. --module-path
Which are considered part of a service?A. Classes referenced by the implementation, but not the interfaceB. Classes referenced by the interface, but not the implementationC. Classes referenced by
Which commands have the options -m and –s to represent modules and summary, respectively?A. javac and jarB. javac and jdepsC. javac and jmodD. java and jarE. java and jdepsF. java and jmod.
Suppose you have the following class in a module named animal.insect.impl. Which two most likely go in the module-info of the service locator? (Choose two.) A. requires
Which statements are true? (Choose two.)A. A bottom-up migration has more steps involving the classpath than a top-down migration.B. A top-down migration has more steps involving the classpath than
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 ServiceLoader.load(Mouse.class)
Given the diagram, what statements need to be in module-info.java for the mammal module? (Choose three.) A. exports mammal;B. exports mammal.eat;C. requires animal;D. requires
Given the previous diagram and the following module-info.java for the panda module, what change can be made to the requires statement? A. exports transitive mammal;B. exports transitive
Given the diagram in question 78 and the following module-info.java for the panda module, what is the result of including line m1? A. Any modules that require mammal will automatically get panda as
How many service providers are allowed to implement a service provider interface and have the consumer reference the first one? A. Exactly oneB. Exactly twoC. One or twoD. One or more.E. None
Which of the following are modules supplied by the JDK? (Choose three.)A. java.loggingB. java.javadocC. java.jdkD. java.managementE. java.namingF. java.scripts.
Which are true of a JAR file that has only one module-info.class file, placed in the META-INF directory? (Choose two.)A. It is an automatic module if on the classpath.B. It is an automatic module
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 statements are most accurate about the ServiceLoader class? (Choose two.)A. load() does not take any parameters.B. load() takes the class type as a parameter.C. When looping through the
Suppose we have an automatic module on the module path named lizard-^-cricket-^-1.0.0-SNAPSHOT.jar and no Automatic-Module-Name specified. What module name should named modules use to reference
What file formats are legal for a module to be distributed?A. jarB. jmodC. zipD. jar and jmodE. jar and zipF. jmod and zip.
Why is this module-info incorrect for a service provider? A. The exports directive should be export.B. The exports directive should not be present because all calls to the service provider should
How many modules are part of the cyclic dependency? A. 0B. 1C. 2D. 3E. 4 module.com.light { exports com.light; } module com.plant { exports com.plant; requires com.light; requires com.animal; }
What statements are true about requires mandated java.base? (Choose two.)A. This output is expected when running the java --list-modules command.B. This output is expected when running the java
Which of the following methods is not available on an ExecutorService instance? (Choose
The following program simulates flipping a coin an even number of times. Assuming five seconds is enough time for all of the tasks to finish, what is the output of the following
Which of the following is a recommended way to define an asynchronous task?A. Create a Callable expression and pass it to an instance of an Executor.B. Create a class that extends Thread and
Given the following program, how many times is Locked! expected to be printed? Assume 100 milliseconds is enough time for each task created by the program to complete. A. One time.B. Five
Given the original array, how many of the following for statements result in an exception at runtime, assuming each is executed independently? A. Zero.B. One.C. Two.D. Three.E. Four.F. The code does
Fill in the blanks: ______________ is a special case of ______________, in which two or more active threads try to acquire the same set of locks and are repeatedly unsuccessful. A. Deadlock,
What is the output of the following application? A. nullB. 1nullC. 1D. Line 6 does not compile.E. Line 8 does not compile.F. An exception is thrown at runtime. 3: public class TpsReport { 4:
Which of the following static methods does not exist in the Executors class? (Choose
How many times does the following application print Ready at runtime? A. Zero.B. One.C. Three.D. The code does not compile.E. An exception is thrown at runtime. package parade; import
Let’s say you needed a thread executor to create tasks for a CyclicBarrier that has a barrier limit of five threads. Which static method in ExecutorService should you use to obtain
The following diagrams represent the order of read/write operations of two threads sharing a common variable. Each thread first reads the value of the variable from memory and then writes a new value
What is the output of the following application? A. Hare won the race! is printed first.B. Tortoise won the race! is printed first.C. The code does not compile.D. The code hangs indefinitely at
Which of the following concurrent collections is sorted? (Choose
What is the output of the following application? A. [Filing]B. [Filing]3.14159C. [Filing]null 3.14159D. The declaration of f1 does not compile.E. The declaration of f2 does not compile.F. The
Assuming 10 seconds is enough time for all of the tasks to finish, what statements about the following program are correct? (Choose two.) A. The code does not compile.B. The incrementBy10() method
What is the most likely result of executing the following application? A. A deadlock is produced at runtime.B. A livelock is produced at runtime.C. The application completes successfully.D. The
Which ScheduledExecutorService method can result in the same action being executed by two threads at the same
What is the output of the following application? A. A deadlock is produced at runtime.B. A livelock is produced at runtime.C. 1000D. The code does not compile.E. The result is unknown until
Which of the following is most likely to be caused by a race condition?A. A thread perpetually denied access to a resourceB. A program hanging indefinitelyC. An int variable incorrectly reporting
Which statement about the following class is correct? A. The code compiles and is thread-safe.B. The code compiles and is not thread-safe.C. The code does not compile because of the size()
Which two method names, when filled into the print2() method, produce the same output as the print1() method? Assume the input arguments for each represent the same non-null numeric
How many lines of the following code snippet contain compilation errors? A. NoneB. OneC. TwoD. ThreeE. None of the above. 11: ScheduledExecutorService t = Executors 12: 13: Future result =
How many times does the following application print W at runtime? A. 0B. 10C. 12D. The code does not compile.E. The output cannot be determined ahead of time.F. None of the above. package
Using the Boat class from the previous question, what is the final state of the application?A. The application produces an exception at runtime.B. The application terminates successfully.C. The
Given the following program, how many times is TV Time expected to be printed? Assume 10 seconds is enough time for each task created by the program to complete. A. One time.B. Three times.C. The
Given the original array, how many of the following for statements enter an infinite loop at runtime, assuming each is executed independently? A. Zero.B. One.C. Two.D. Three.E. Four.F. The
Which ExecutorService method guarantees all running tasks are stopped in an orderly fashion? A. shutdown()B. shutdownNow()C. halt()D. shutdownAndTerminate()E. None of the above.
Assuming 10 seconds is enough time for all of the tasks to finish, what is the output of the following application? A. 0B. 125C. -125D. The code does not compile.E. The result is unknown until
What is the output of the following application? A. trueB. falseC. The code does not compile.D. The result is unknown until runtime.E. An exception is thrown.F. None of the above. import
The following code snippet results in an exception at runtime. Which of the following is the most likely type of exception to be
What is the result of compiling and executing the following program? A. The code does not compile.B. The code compiles and prints a NullPointerException at runtime.C. The code compiles but does
Assuming the file path referenced in the following class is accessible and writable, what is the output of the following program? (Choose two.) A. 1B. 23C. 13D. The code does not compile.E. If
What is the expected output of the following application? Assume the directories referenced in the class do not exist prior to the execution and that the file system is available and able to be
Which classes are least likely to be marked Serializable. (Choose two.)A. A class that monitors the state of every thread in the application.B. A class that holds data about the amount of rain that
What is the output of the following code snippet? Assume that the current directory is the root path. A. /lost/blue.txt and /lost/blue.txt/keysB. /found/../keys/./lost/blue.txt and
Fill in the blanks: Writer is a(n) ______________ that related stream classes ______________.A. concrete class, extend.B. abstract class, extend.C. abstract class, implement.D. interface,
Assuming /away/baseball.txt exists and is accessible, what is the expected result of executing the following code snippet? A. A new file /home/baseball.txt is created.B. A new file
Assuming the file referenced in the following snippet exists and contains five lines with the word eggs in them, what is the expected output? A. No lines will be printed.B. One line will be
What is the output of the following program? Assume the file paths referenced in the class exist and are able to be written to and read
Why does Console readPassword() return a char array rather than a String?A. It improves performance.B. It improves security.C. Passwords must be stored as a char array.D. String cannot hold the
Given the following class inheritance diagram, which two classes can be placed in the blank boxes? A. BufferedOutputStream and PrintStreamB. BufferedOutputStream and
How many lines of the following code contain compiler errors? A. All of the lines compileB. OneC. TwoD. ThreeE. Four or more. 12: var path = Paths.get(new URI("ice.cool")); 13: var view =
What is the output of the following application? A. -2B. 2C. 3D. 5E. 7F. An exception is thrown at runtime. import java.io.*; public class TaffyFactory { public int getPrize (byte[] luck)
What is the output of the following program? Assume the file paths referenced in the class exist and are able to be written to and read
Given the following file system diagram, in which forward is a symbolic link to the java directory, which values if inserted into the following code do not print /java/Sort.java at runtime? (Choose
Which method defined in Reader can be used in place of calling skip(1)? A. jump()B. mark()C. markSupported()D. read()E. reset()F. None of the above.
The Rose application is run with an input argument of /flower. The /flower directory contains five subdirectories, each of which contains five files. What is the result of executing the following
What may be the result of executing the following program? A. The program asks the user a question and prints the results to the error stream.B. The program throws a NullPointerException at
What is the output of the following method applied to an InputStream that contains the first four prime numbers, stored as bytes: 2, 3, 5, 7? A. 5B. 7C. The code does not compile.D. The code
Which statement about the following method is correct? Assume the directory /tea/ earlGrey/hot exists and is able to be read. A. It does not compile.B. It compiles but does not print anything at
Which method are classes that implement java.io.Serializable required to implement?A. cereal()B. deserialize()C. serial()D. serialize()E. clone()F. None of the above.
What is the result of compiling and executing the following program? Assume the current directory is /stock and the path /stock/sneakers does not exist prior to execution. A. The directory
Assuming the absolute path referenced in the code exists and its contents are accessible, which statement about the following code snippet is correct? A. The first stream statement does not
When reading file information, what is an advantage of using an NIO.2 attribute interface rather than reading the values individually using Files methods? (Choose two.) A. Costs fewer round-trips
Suppose that you need to read data that consists of serialized int, double, boolean, and String values from a file. You also want the program to be performant on large files. Which three java.io
Which statement about the following method is correct? Assume the directory coffee exists and is able to be read. A. It does not compile.B. It compiles but does not print anything at
Assuming the file referenced in the StudentManager class exists and contains data, which statement about the following class is correct? (Choose two.) A. The code does not compile.B. The code
Given an instance of Console c, which of the following two method calls are invalid ways of retrieving input from the user? (Choose two.)A. c.read()B. c.reader().read()C. c.reader().readLine()D.
What is the output of the following code snippet? Assume that the current directory is the root path /. A. ../found/red.zip and ../../locksB. /found/red.zip and
Assuming the current working directory is /home, then what is the output of the following program? A. /home/tricksB. /homeC. tricksD. The code does not compile.E. The code compiles but prints
Which statements about the Files methods lines() and readAllLines() are correct? (Choose two.)A. They have different return types.B. The readAllLines() method is always faster.C. The lines() may
Given the following application, in which a user enters bone twice, what is the expected result? A. The program completes after printing a message once.B. The program completes after printing a
What is the expected result of calling deleteTree() on a directory? Assume the directory exists and is able to be modified. A. It will delete the directory itself only.B. It will delete the
Which code, if inserted into the method, will cause it to correctly copy any file passed to it that is accessible? (Choose two.) void copyFile(String source, String target) throws Exception { try
Let’s say we want to write an instance of Cereal to disk, having a name value of CornLoops and sugar value of 5. What is the value of name and sugar after this object has been read from disk using
During deserialization from an I/O stream, which element of the class can be used to assign a value to the deserialized object? A. Variable initializerB. Instance initializerC. Static
Assuming there are no symbolic links involved and file ursery/sapling.seed exists, which statements about the following code snippet are correct? (Choose three.) A. The code may throw an exception
What is the output of the following application? Assume /all-data exists and is accessible within the file system. A. The code does not compile.B. The number of lines in all files in a directory
The following figure represents a stream pipeline. Given this, would the boxes X, Y, Z best represent?A. Origin, intermediate operation, and final operation B. Origin, intermediate operation, and
Showing 400 - 500
of 1045
1
2
3
4
5
6
7
8
9
10
11