Java SE 8 Programmer 1 correctly answered
(updated) already passed
1. What year was the Java programming created 1995
2. What does OCA stand for Oracle Certified
Associate
3. What are the 2 tests for Java developers
provided by Oracle OCA and OCP
4. The full declaration of a method is called the method signature
5. True or False - can you add a multiline comment within false
a multiline comment?
6. How many public classes can be added to a single file 1
7. Write the syntax for the main method. public static
void
main(String[]
args)
8. When you compile a Java class what file type extension .class
is output?
9. What does a .class file contain bytecode
10. True or false, what creating a public Java class in a
file true does the case used in the file name have
to match the case used by the Java class name?
11. In a method declaration, the public, called
protected and private declarations are what?
1/
39
,Java 8 Questions for Oracle Certified Associate
Java SE 8 Programmer 1 correctly answered
(updated) already passed
access modifiers
12. What is the one special package in Java that you don't java.lang
need to import?
13. What is the generic term for packages that are defined child
packages
after the com.company package?
2/
39
,Java 8 Questions for Oracle Certified Associate
Java SE 8 Programmer 1 correctly answered
(updated) already passed
14. When creating an array, which one of these definitions 4
is correct? 1.) String[] args, 2.) String args[], 3.) String... All of the
above
args, 4.) all of the above
15. What package does the Files and Paths object belong java.nio.file
to?
16. What 2 common packages contain the Date class java.util.Date and
java.sql.Date
17. If a class wanted to use the java.util.Date class, but the Add an explicit
import for
class had imports for java.util.* and java.sql.* java.util.Date since explic- itly
which both contain the Date class how importing a class takes
would you fix this? precedence over any
wild- card imports.
18. What command do you use to compile a Java class? javac
19. What package is the ArrayList class in? java.util.
20. When defining a constructor for class Junk, what is the public Junk()
{}
proper syntax?
// notice there is NO re-
turn value.
21. What is a code block outside of a method called? instance initializer
22. Given the class public class Junk { int eggs=0;
3/
39
, Java 8 Questions for Oracle Certified Associate
Java SE 8 Programmer 1 correctly answered
(updated) already passed
public Junk() { eggs=1; } { eggs = 10; } } Answer: 1
what is the value of eggs and why?
Reason: The value is 1
be- cause the fields
and in- stance
initializers are run in
the order they are de-
4/
39