Java SE Core - Intermed

Print the objectives

Take the exam   Take a beta test

This exams covers core aspects of the Java (standard edition) programming language.
  Released  Beta  Frozen  

Vocabulary & Concepts  1 question

State the significance of the following acronyms : JCP, JSR, JDBC ... other suggestions are welcome
Know how Sun counts (1.0, 1.1, 1.2 = Java 2, 1.3, 1.4, 1.5 = Java 5, 1.6 = Java 6) and that there was no Java 3 or Java 4.

15 0 96

Language Syntax

 
 

Flow Control  2 questions

Create Loops
  • Write code using all kind of Java loops : for, while, do-while and for each (introduced in Java 5)
  • Predict behavior of nested loops
  • Use break and continue in nested loops, both unlabeled and labeled syntaxes.
Define Branching
  • Write syntactically correct tests using if, switch structures
  • Define correct types of arguments for both keywords
80 434 114

Operators  2 questions

Ternary Operator
  • Use correct syntax and explain the ternary x ? y : z operator
  • Identify correct operands and return type compatibility
Bitwise Operators
  • Manipulate primitives using the bitwise manipulation operators ~, & and |
Shift Operators
  • Understanding shift operators
    • >> (SHIFT RIGHT operator)
    • << (SHIFT LEFT operator) and
    • >>> (UNSIGNED SHIFT RIGHT operator)
  • Code Snippets using the >>, <<, and >>>
64 280 135

Primitive Types  1 question

Types
  • For each Java primitive type explain its purpose, its default value, its value range
Literals
  • For the char literals, explain the meaning of \u, \n, \t, \', \" literals
  • For the integral literals, only the decimal notation is covered (neither octal nor hexadecimal)
  • For the floating point literals
    • explain the meaning of the e, f, d suffixes
    • use the Float/Double.NaN, .NEGATIVE_INFINITY, .POSITIVE_INFINITY constants
  • Use the L(l) suffix to get a long literal instead of an int
Conversion
  • Explain the widening conversion chain byte -> short -> int -> long -> float -> double
  • Given code, spot valid and invalid primitive types casting operations
14 509 69

Keywords  1 question

Keywords
  • Recognize reserved Java keywords
  • In general terms, explain the application of each keyword
static
  • Write code that defines class attributes using the static keyword and manipulate them
  • Define class method, explain how to call them
final
  • Explain how to define constant attributes using final
  • Identify places where blank final can be initialized
  • Describe the meaning of final applied to methods
  • Prevent classes from being subclassed by declaring them final
transient
  • Explain the usefulness of the transient modifier in the Serialization process
11 563 31

Assertions  1 question

  • Write code that uses Assertions
  • State how to enable Assertions
  • Identify the exception type raised when reaching a false assertions
20 77 101

Class

 
 

Lifecycle  2 questions

  • Understand the new operator to create an object.
  • Determine the initialization sequence of fields, static fields, static block, constructor, ancestor constructors
  • Explain the use of this() and super() in constructors and identify where you can call them
83 190 102

Inner class  2 questions

  • Write code that define basic inner classes (anonymous or not)
  • Explain the usage of the outer class "this", in the inner class
  • Use final modifier for local variables in enclosing classes to get access to it
67 259 108

Class Loading  1 question

  • Explain the Java SE classpath mechanism
  • Understand the ClassLoader hierarchy and implications on the static scope.
  • Given an object instance get its ClassLoader from its Class
  • Get the system classloader using ClassLoader.getSystemClassLoader()
  • Write code that uses ClassLoader to load external resources on the file system.
18 0 61

Overloading  1 question

  • Explain the overloading mechanism
  • Identify the method name, arguments types and order differentiates 2 method signatures
  • Explain why the return type does not differentiate 2 methods
  • Given code, determine method resolution behavior when using polymorphism in parameters including Java 5 Autoboxing and varargs
16 248 27

Inheritance

 
 

Object  1 question

  • Identify methods inherited from the Object class.
  • Explain correct implementation of the equals() and hashCode() and the contract between them. Describe the behavior of the default implementation.
  • Write correct implementation of the toString() method.
  • Write code that given an instance gets an instance of the Class class.
  • Explain the meaning of the clone() method.
16 239 27

Overriding  1 question

  • Explain the overriding mechanism and late binding
  • Identify correct overriding syntax, distinguish between the overriding and overloading mechanism.
  • State what you can and cannot do with access specifiers in overriding methods
  • State what you can and cannot do with thrown exceptions in overriding methods
  • Establish the difference between super. and super()
  • Explain data hiding
8 373 31

Abstract  2 questions

  • Write code that declares abstract classes and methods
  • Explain why an abstract class cannot be instantiated but has a constructor
  • Identify correct modifiers combinations, ex: Can a method be declared as final abstract ?

74 94 104

Interfaces  1 question

  • Write code that declares an interface and its containing methods
  • Explain the particular nature of attributes declared in interfaces
  • Identify the modifiers that can be applied to interface methods; given code spot which are needed and which are redundant
  • Troubleshoot class that implements multiple interfaces
    • declaring methods with same name but different return type
    • declaring attributes having the same name
15 545 32

RTTI  1 question

  • Write code that uses the instanceof operator for run-time type identification.
  • Identify correct operands of the instanceof operator
  • Given an instance, retrieve an instance of the Class class and state how to get the fully qualified class name of the class
  • Explain the Class.isInstance() method usage
26 1 64

Exceptions  3 questions

  • Create and throw a custom exception class.
  • Use the throws keyword.
  • Know the java standard exception hierarchy for: Throwable, Error, OutOfMemoryError, Exception, RuntimeException, NullPointerException, IOException...
  • Understand execution flow for nested try/catch/finally clauses.
  • Understand and use nested exceptions.
  • Differentiate checked and unchecked exceptions.
118 236 120

Threads  2 questions

Create and Start a new Thread
  • Write code that creates a new Thread by extending the Thread class
  • Write code that creates a new Thread by implementing a Runnable object
  • Write code that creates a new Thread by implementing a Callable object
  • State how to start a thread (using the .start() method)
  • State what happens when you explicitly call the run() method
Synchronized
  • Use a synchronized block to lock object instances and prevent concurrent access
  • Use the synchronized modifier on methods, define the equivalent syntax using a synchronized block
  • Explain the locking mechanism.
Lifecycle and methods
  • Explain what a daemon is and write code that turns a Thread into a daemon
  • Write code that
    • gets the current Thread using Thread.currentThread()
    • tests if a thread is active using Thread.isAlive()
    • makes a thread wait using Thread.sleep(long millis)
    • makes a thread wait for another thread using Thread.join()
    • create cooperative thread using Thread.yield()
Wait and Notify
  • Explain the wait() and notify() mechanism
  • Identify in which circumstances a class can call wait() on an object
  • Explain scenarios where an IllegalMonitorStateException can be thrown
20 664 80

Exam information

  • 37 minutes
  • 25 questions (6679)
  • 70% required
  • +5 √
  • - 6  points
  • 15 day delay
  • status: released

Top contributors