JAVA[tm] TECHNOLOGY EXAM OBJECTIVES
Sun Certified Programmer for Java[tm] 2 Platform 1.2
Sun Certified Programmer for Java 2 Platform 1.4
Sun Certified Programmer for Java 2 Platform 1.4 Upgrade Exam
Sun Certified Developer for Java 2 Platform
Sun Certified Web Component Developer for Java 2 Platform, Enterprise Edition (J2EE[tm])
Sun Certified Enterprise Architect for J2EE Technology
SECTION 1: DECLARATIONS AND ACCESS CONTROL
- Write code that declares, constructs, and initializes arrays of any base type using any of the permitted forms both for declaration and for initialization.
- Declare classes, inner classes, methods, instance variables, static variables, and automatic (method local) variables making appropriate use of all permitted modifiers (such as public, final, static, abstract, and so forth).
- State the significance of each of these modifiers both singly and in combination, and state the effect of package relationships on declared items qualified by these modifiers.
- For a given class, determine if a default constructor will be created, and if so, state the prototype of that constructor.
- State the legal return types for any method given the declarations of all related methods in this or parent classes.
SECTION 2: FLOW CONTROL AND EXCEPTION HANDLING
- Write code using if and switch statements and identify legal argument types for these statements.
- Write code using all forms of loops including labeled and unlabeled use of break and continue, and state the values taken by loop control variables during and after loop execution.
- Write code that makes proper use of exceptions and exception handling clauses (try, catch, finally) and declares methods and overriding methods that throw exceptions.
SECTION 3: GARBAGE COLLECTION
- State the behavior that is guaranteed by the garbage collection system, and write code that explicitly makes objects eligible for collection.
SECTION 4: LANGUAGE FUNDAMENTALS
- Identify correctly constructed source files, package declarations, import statements, class declarations (of all forms including inner classes), interface declarations and implementations (for java.lang.Runnable or other interface described in the test), method declarations (including the main method that is used to start execution of a class), variable declarations and identifiers.
- State the correspondence between index values in the argument array passed to a main method and command line arguments.
- Identify all Java programming language keywords and correctly constructed identifiers.
- State the effect of using a variable or array element of any kind when no explicit assignment has been made to it.
- State the range of all primitive data types and declare literal values for String and all primitive types using all permitted formats, bases, and representations.
SECTION 5: OPERATORS AND ASSIGNMENTS
- Determine the result of applying any operator, including assignment operators, instance of, and casts to operands of any type, class, scope, or accessibility, or any combination of these.
- Determine the result of applying the boolean equals (Object) method to objects of any combination of the classes java.lang.String, java.lang.Boolean, and java.lang.Object.
- In an expression involving the operators &, |, &&, ||, and variables of known values, state which operands are evaluated and the value of the expression.
- Determine the effect upon objects and primitive values of passing variables into methods and performing assignments or other modifying operations in that method.
SECTION 6: OVERLOADING, OVERRIDING, RUNTIME TYPE, AND OBJECT ORIENTATION
- State the benefits of encapsulation in object oriented design and write code that implements tightly encapsulated classes and the relationships "is a" and "has a".
- Write code to invoke overridden or overloaded methods and parental or overloaded constructors, and describe the effect of invoking these methods.
- Write code to construct instances of any concrete class including normal top level classes, inner classes, static inner classes, and anonymous inner classes.
SECTION 7: THREADS
- Write code to define, instantiate, and start new threads using both java.lang.Thread and java.lang.Runnable.
- Recognize conditions that might prevent a thread from executing.
- Write code using synchronized, wait, notify, or notifyAll, to protect against concurrent access problems and to communicate between threads.
- Define the interaction between threads and between threads and object locks when executing synchronized, wait, notify, or notifyAll.
SECTION 8: THE JAVA.AWT PACKAGE
- Write code using component, container, and LayoutManager classes of the java.awt package to present a Graphical User Interface with specified appearance and resize behavior, and distinguish the responsibilities of layout managers from those of containers.
- Write code to implement listener classes and methods, and in listener methods, extract information from the event to determine the affected component, mouse position, nature, and time of the event.
- State the event classname for any specified event listener interface in the java.awt.event package.
SECTION 9: THE JAVA.LANG PACKAGE
- Write code using the following methods of the java.lang.Math class: abs, ceil, floor, max, min, random, round, sin, cos, tan, and sqrt.
- Describe the significance of the immutability of string objects.
SECTION 10: THE JAVA.UTIL PACKAGE
- Make appropriate selection of collection classes/interfaces to suit specified behavior requirements.
SECTION 11: THE JAVA.IO PACKAGE
- Write code that uses objects of the file class to navigate a file system.
- Write code that uses objects of the classes InputStreamReader and outputStreamWriter to translate between Unicode and either platform default or ISO 8859-1 character encoding and Distinguish between conditions under which platform default encoding conversion should be used and conditions under which a specific conversion should be used.
- Select valid constructor arguments for FilterInputStream and FilterOutputStream subclasses from a list of classes in the java.io.package.
- Write appropriate code to read, write and update files using FileInputStream, FileOutputStream, and RandomAccessFile objects.
- Describe the permanent effects on the file system of constructing and using FileInputStream, FileOutputStream, and RandomAccessFile objects.
SECTION 1: DECLARATIONS AND ACCESS CONTROL
- Write code that declares, constructs and initializes arrays of any base type using any of the permitted forms both for declaration and for initialization.
- Declare classes, nested classes, methods, instance variables, static variables and automatic (method local) variables making appropriate use of all permitted modifiers (such as public, final, static, abstract, etc.). State the significance of each of these modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
- For a given class, determine if a default constructor will be created and if so state the prototype of that constructor.
- Identify legal return types for any method given the declarations of all related methods in this or parent classes.
SECTION 2: FLOW CONTROL, ASSERTIONS, AND EXCEPTION HANDLING
- Write code using if and switch statements and identify legal argument types for these statements.
- Write code using all forms of loops including labeled and unlabeled, use of break and continue, and state the values taken by loop counter variables during and after loop execution.
- Write code that makes proper use of exceptions and exception handling clauses (try, catch, finally) and declares methods and overriding methods that throw exceptions.
- Recognize the effect of an exception arising at a specified point in a code fragment. Note: The exception may be a runtime exception, a checked exception, or an error (the code may include try, catch, or finally clauses in any legitimate combination).
- Write code that makes proper use of assertions, and distinguish appropriate from inappropriate uses of assertions.
- Identify correct statements about the assertion mechanism.
SECTION 3: GARBAGE COLLECTION
- State the behavior that is guaranteed by the garbage collection system.
- Write code that explicitly makes objects eligible for garbage collection.
- Recognize the point in a piece of source code at which an object becomes eligible for garbage collection.
SECTION 4: LANGUAGE FUNDAMENTALS
- Identify correctly constructed package declarations, import statements, class declarations (of all forms including inner classes) interface declarations, method declarations (including the main method that is used to start execution of a class), variable declarations, and identifiers.
- Identify classes that correctly implement an interface where that interface is either java.lang.Runnable or a fully specified interface in the question.
- State the correspondence between index values in the argument array passed to a main method and command line arguments.
- Identify all Java programming language keywords. Note: There will not be any questions regarding esoteric distinctions between keywords and manifest constants.
- State the effect of using a variable or array element of any kind when no explicit assignment has been made to it.
- State the range of all primitive formats, data types and declare literal values for String and all primitive types using all permitted formats bases and representations.
SECTION 5: OPERATORS AND ASSIGNMENTS
- Determine the result of applying any operator (including assignment operators and instance of) to operands of any type class scope or accessibility or any combination of these.
- Determine the result of applying the boolean equals (Object) method to objects of any combination of the classes java.lang.String, java.lang.Boolean and java.lang.Object.
- In an expression involving the operators &, |, &&, || and variables of known values state which operands are evaluated and the value of the expression.
- Determine the effect upon objects and primitive values of passing variables into methods and performing assignments or other modifying operations in that method.
SECTION 6: OVERLOADING, OVERRIDING, RUNTIME TYPE AND OBJECT ORIENTATION
- State the benefits of encapsulation in object oriented design and write code that implements tightly encapsulated classes and the relationships "is a" and "has a".
- Write code to invoke overridden or overloaded methods and parental or overloaded constructors; and describe the effect of invoking these methods.
- Write code to construct instances of any concrete class including normal top level classes and nested classes.
SECTION 7: THREADS
- Write code to define, instantiate and start new threads using both java.lang.Thread and java.lang.Runnable.
- Recognize conditions that might prevent a thread from executing.
- Write code using synchronized wait, notify and notifyAll to protect against concurrent access problems and to communicate between threads.
- Define the interaction among threads and object locks when executing synchronized wait, notify or notifyAll.
SECTION 8: FUNDAMENTAL CLASSES IN THE JAVA.LANG PACKAGE
- Write code using the following methods of the java.lang.Math class: abs, ceil, floor, max, min, random, round, sin, cos, tan, sqrt.
- Describe the significance of the immutability of String objects.
- Describe the significance of wrapper classes, including making appropriate selections in the wrapper classes to suit specified behavior requirements, stating the result of executing a fragment of code that includes an instance of one of the wrapper classes, and writing code using the following methods of the wrapper classes (e.g., Integer, Double, etc.):
- doubleValue
- floatValue
- intValue
- longValue
- parseXxx
- getXxx
- toString
- toHexString
SECTION 9: THE COLLECTIONS FRAMEWORK
- Make appropriate selection of collection classes/interfaces to suit specified behavior requirements.
- Distinguish between correct and incorrect implementations of hashcode methods.
Declarations and Access Control
- Declare classes, nested classes, methods, instance variables, static variables and automatic (method local) variables making appropriate use of all permitted modifiers (such as public, final, static, abstract, etc.). State the significance of each of these modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
- Identify legal return types for any method given the declarations of all related methods in this or parent classes.
Flow Control, Assertions, and Exception Handling
- Write code using if and switch statements and identify legal argument types for these statements.
- Recognize the effect of an exception arising at a specified point in a code fragment. Note: The exception may be a runtime exception, a checked exception, or an error (the code may include try, catch, or finally clauses in any legitimate combination).
- Write code that makes proper use of assertions, and distinguish appropriate from inappropriate uses of assertions.
- Identify correct statements about the assertion mechanism.
Garbage Collection
- Recognize the point in a piece of source code at which an object becomes eligible for garbage collection.
Language Fundamentals
- Identify classes that correctly implement an interface where that interface is either java.lang.Runnable or a fully specified interface in the question.
- State the effect of using a variable or array element of any kind when no explicit assignment has been made to it.
Operators and Assignments
- Determine the result of applying any operator (including assignment operators and instance of) to operands of any type class scope or accessibility or any combination of these.
- In an expression involving the operators &, |, &&, || and variables of known values state which operands are evaluated and the value of the expression.
- Determine the effect upon objects and primitive values of passing variables into methods and performing assignments or other modifying operations in that method.
Overloading, Overriding, Runtime Type and Object Orientation
- Write code to invoke overridden or overloaded methods and parental or overloaded constructors; and describe the effect of invoking these methods.
- Write code to construct instances of any concrete class including normal top level classes and nested classes.
Threads
- Recognize conditions that might prevent a thread from executing.
- Write code using synchronized wait, notify and notifyAll to protect against concurrent access problems and to communicate between threads.
- Define the interaction among threads and object locks when executing synchronized wait, notify or notifyAll.
The Collections Framework
- Make appropriate selection of collection classes/interfaces to suit specified behavior requirements.
- Distinguish between correct and incorrect implementations of hashcode methods.
- Write an application program using Java technology. The application requires the following:
- A graphical user interface demonstrating good principles of design
- A network connection, using a specified protocol, to connect to an information server
- A network server, which connects to a previously specified Java technology database
- A database, created by extending the functionality of a previously written piece of code, for which only limited documentation is available
- List some of the major choices you must make during the implementation of the above.
- List some of the main advantages and disadvantages of each of your choices.
- Briefly justify your choices in terms of the comparison of design and implementation objectives with the advantages and disadvantages of each.
SECTION 1: THE SERVLET MODEL
1.1 For each of the HTTP methods, GET, POST, and PUT, identify the corresponding method in the HttpServlet class.
1.2 For each of the HTTP methods, GET, POST, and HEAD, identify triggers that might cause a browser to use the method, and identify benefits or functionality of the method.
1.3 For each of the following operations, identify the interface and method name that should
be used:
- Retrieve HTML form parameters from the request
- Retrieve a servlet initialization parameter
- Retrieve HTTP request header information
- Set an HTTP response header; set the content type of the response
- Acquire a text stream for the response
- Acquire a binary stream for the response
- Redirect an HTTP request to another URL
1.4 Identify the interface and method to access values and resources and to set object attributes within the following three Web scopes:
1.5 Given a life-cycle method: init, service, or destroy, identify correct statements about its purpose or about how and when it is invoked.
1.6 Use a RequestDispatcher to include or forward to a Web resource.
SECTION 2: THE STRUCTURE AND DEPLOYMENT OF MODERN SERVLET WEB APPLICATIONS
2.1 Identify the structure of a Web Application and Web Archive file, the name of the WebApp deployment descriptor, and the name of the directories where you place the following:
- The WebApp deployment descriptor
- The WebApp class files
- Any auxiliary JAR files
2.2 Match the name with a description of purpose or functionality, for each of the following deployment descriptor elements:
- Servlet instance
- Servlet name
- Servlet class
- Initialization parameters
- URL to named servlet mapping
SECTION 3: THE SERVLET CONTAINER MODEL
3.1 Identify the uses for and the interfaces (or classes) and methods to achieve the following features:
- Servlet context init. parameters
- Servlet context listener
- Servlet context attribute listener
- Session attribute listeners
3.2 Identify the WebApp deployment descriptor element name that declares the following features:
- Servlet context init. parameters
- Servlet context listener
- Servlet context attribute listener
- Session attribute listeners
3.3 Distinguish the behavior of the following in a distributable:
- Servlet context init. parameters
- Servlet context listener
- Servlet context attribute listener
- Session attribute listeners
SECTION 4: DESIGNING AND DEVELOPING SERVLETS TO HANDLE SERVER-SIDE EXCEPTIONS
4.1 For each of the following cases, identify correctly constructed code for handling business logic exceptions, and match that code with correct statements about the code's behavior: Return an HTTP error using the sendError response method; Return an HTTP error using the setStatus method.
4.2 Given a set of business logic exceptions, identify the following: The configuration that the deployment descriptor uses to handle each exception; How to use a RequestDispatcher to forward the request to an error page; Specify the handling declaratively in the deployment descriptor.
4.3 Identify the method used for the following: Write a message to the WebApp log; Write a message and an exception to the WebApp log.
SECTION 5: DESIGNING AND DEVElOPING SERVLETS USING SESSION MANAGEMENT
5.1 Identify the interface and method for each of the following:
- Retrieve a session object across multiple requests to the same or different servlets within the same WebApp
- Store objects into a session object
- Retrieve objects from a session object
- Respond to the event when a particular object is added to a session
- Respond to the event when a session is created and destroyed
- Expunge a session object
5.2 Given a scenario, state whether a session object will be invalidated.
5.3 Given that URL-rewriting must be used for session management, identify the design requirement on session-related HTML pages.
SECTION 6: DESIGNING AND DEVELOPING SECURE WEB APPLICATIONS
6.1 Identify correct descriptions or statements about the security issues:
- Authentication, authorization
- Data integrity
- Auditing
- Malicious code
- Web site attacks
6.2 Identify the deployment descriptor element names, and their structure, that declare the following:
- A security constraint
- A Web resource
- The login configuration
- A security role
6.3 Given an authentication type: BASIC, DIGEST, FORM, and CLIENT-CERT, identify the correct definition of its mechanism.
SECTION 7: DESIGNING AND DEVELOPING THREAD-SAFE SERVLETS
7.1 Identify which attribute scopes are thread-safe:
- Local variables
- Instance variables
- Class variables
- Request attributes
- Session attributes
- Context attributes
7.2 Identify correct statements about differences between the multi-threaded and single-threaded servlet models.
7.3 Identify the interface used to declare that a servlet must use the single thread model.
SECTION 8: THE JAVA SERVER PAGES (JSP) TECHNOLOGY MODEL
8.1 Write the opening and closing tags for the following JSP tag types:
- Directive
- Declaration
- Scriptlet
- Expression
8.2 Given a type of JSP tag, identify correct statements about its purpose or use.
8.3 Given a JSP tag type, identify the equivalent XML-based tags.
8.4 Identify the page directive attribute, and its values, that:
- Import a Java class into the JSP page
- Declare that a JSP page exists within a session
- Declare that a JSP page uses an error page
- Declare that a JSP page is an error page
8.5 Identify and put in sequence the following elements of the JSP page lifecycle:
- Page translation
- JSP page compilation
- Load class
- Create instance
- Call jspInit
- Call _jspService
- Call jspDestroy
8.6 Match correct descriptions about purpose, function, or use with any of the following implicit objects:
- request
- response
- out
- session
- config
- application
- page
- pageContext
- exception
8.7 Distinguish correct and incorrect scriptlet code for:
- A conditional statement;
- An iteration statement
SECTION 9: DESIGNING AND DEVELOPING REUSABLE WEB COMPONENTS
9.1 Given a description of required functionality, identify the JSP page directive or standard tag in the correct format with the correct attributes required to specify the inclusion of a Web component into the JSP page.
SECTION 10: DESIGNING AND DEVELOPING JSP PAGES USING JAVABEAN COMPONENTS
10.1 For any of the following tag functions, match the correctly constructed tag, with attributes and values as appropriate, with the corresponding description of the tag's functionality:
- Declare the use of a JavaBean component within the page.
- Specify, for jsp: useBean or jsp: getProperty tags, the name of an attribute.
- Specify, for a jsp: useBean tag, the class of the attribute.
- Specify, for a jsp: useBean tag, the scope of the attribute.
- Access or mutate a property from a declared JavaBean.
- Specify, for a jsp: getProperty tag, the property of the attribute.
- Specify, for a jsp: setProperty tag, the property of the attribute to mutate, and the new value.
10.2 Given JSP page attribute scopes: request, session, application, identify the equivalent servlet code.
10.3 Identify techniques that access a declared JavaBean component.
SECTION 11: DESIGNING AND DEVELOPING JSP PAGES USING CUSTOM TAGS
11.1 Identify properly formatted tag library declarations in the Web application deployment descriptor.
11.2 Identify properly formatted taglib directives in a JSP page.
11.3 Given a custom tag library, identify properly formatted custom tag usage in a JSP page. Uses include:
- An empty custom tag
- A custom tag with attributes
- A custom tag that surrounds other JSP code
- Nested custom tags
SECTION 12: DESIGNING AND DEVELOPING A CUSTOM TAG LIBRARY
12.1 Identify the tag library descriptor element names that declare the following:
- The name of the tag
- The class of the tag handler
- The type of content that the tag accepts
- Any attributes of the tag
12.2 Identify the tag library descriptor element names that declare the following:
- The name of a tag attribute
- Whether a tag attribute is required
- Whether or not the attribute's value can be dynamically specified
12.3 Given a custom tag, identify the necessary value for the bodycontent TLD element for any of the following tag types:
- Empty-tag
- Custom tag that surrounds other JSP code
- Custom tag that surrounds content that is used only by the tag handler
12.4 Given a tag event method (doStartTag, doAfterBody, and doEndTag), identify the correct description of the methods trigger.
12.5 Identify valid return values for the following methods:
- doStartTag
- doAfterBody
- doEndTag
- PageConext.getOut
12.6 Given a "BODY" or "PAGE" constant, identify a correct description of the constant's use in the following methods:
- doStartTag
- doAfterBody
- doEndTag
12.7 Identify the method in the custom tag handler that accesses:
- A given JSP page's implicit variable
- The JSP page's attributes
12.8 Identify methods that return an outer tag handler from within an inner tag handler.
SECTION 13: DESIGN PATTERNS FOR WEB APPLICATIONS
13.1 Given a scenario description with a list of issues, select the design pattern (Value Objects, MVC, Data Access Object, or Business Delegate) that would best solve those issues.
13.2 Match design patterns with statements describing potential benefits that accrue from the use of the pattern, for any of the following patterns:
- Value Objects
- MVC
- Data Access Object
- Business Delegate
CONCEPTS
- Draw UML Diagrams
- Interpret UML diagrams.
- State the effect of encapsulation, inheritance, and use of interfaces on architectural characteristics.
COMMON ARCHITECTURES
- Recognize the effect on each of the following characteristics of two tier, three tier and multi-tier architectures: scalability maintainability, reliability, availability, extensibility, performance, manageability, and security.
- Recognize the effect of each of the following characteristics on J2EE technology: scalability maintainability, reliability, availability, extensibility, performance, manageability, and security.
- Given an architecture described in terms of network layout, list benefits and potential weaknesses associated with it.
LEGACY CONNECTIVITY
- Distinguish appropriate from inappropriate techniques for providing access to a legacy system from Java code given an outline description of that legacy system
ENTERPRISE JAVA BEANS[tm]
- List the required classes/interfaces that must be provided for an EJB.
- Distinguish stateful and stateless Session beans.
- Distinguish Session and Entity beans.
- Recognize appropriate uses for Entity, Stateful Session, and Stateless Session beans.
- State benefits and costs of Container Managed Persistence.
- State the transactional behavior in a given scenario for an enterprise bean method with a specified transactional deployment descriptor.
- Given a requirement specification detailing security and flexibility needs, identify architectures that would fulfill those requirements.
- Identify costs and benefits of using an intermediate data-access object between an entity bean and the data resource.
ENTERPRISE JAVA BEANS CONTAINER MODEL
- State the benefits of bean pooling in an EJB container.
- State the benefits of Passivation in an EJB container.
- State the benefit of monitoring of resources in an EJB container.
- Explain how the EJB container does lifecycle management and has the capability to increase scalability.
PROTOCOLS
- Given a scenario description, distinguish appropriate from inappropriate protocols to implement that scenario.
- Identify a protocol, given a list of some of its features, where the protocol is one of the following: HTTP, HTTPS, IIOP, JRMP.
- Select from a list, common firewall features that might interfere with the normal operation of a given protocol.
APPLICABILITY OF J2EE TECHNOLOGY
- Select from a list those application aspects that are suited to implementation using J2EE.
- Select from a list those application aspects that are suited to implementation using EJB.
- Identify suitable J2EE technologies for the implementation of specified application aspects.
DESIGN PATTERNS
- From a list, select the most appropriate design pattern for a given scenario. Patterns will be limited to those documented in Gamma et al. and named using the names given in that book.
- State the benefits of using design patterns.
- State the name of a Gamma et al. design pattern given the UML diagram and/or a brief description of the pattern's functionality.
- Select from a list benefits of a specified Gamma et al. design pattern.
- Identify the Gamma et al. design pattern associated with a specified J2EE feature
MESSAGING
- Identify scenarios that are appropriate to implementation using messaging, EJB, or both.
- List benefits of synchronous and asynchronous messaging.
- Select scenarios from a list that are appropriate to implementation using synchronous and asynchronous messaging.
INTERNATIONALIZATION
- State three aspects of any application that might need to be varied or customized in different deployment locales.
- Match the following features of the Java 2 platform with descriptions of their functionality, purpose or typical uses: Properties, Locale, ResourceBundle, Unicode, java.text package, InputStreamReader and OutputStreamWriter.
SECURITY
- Select from a list security restrictions that Java 2 environments normally impose on applets running in a browser.
- Given an architectural system specification, identify appropriate locations for implementation of specified security features, and select suitable technologies for implementation of those features.