1: Declarations, Initialization & ScopingHomepage  « Java5 Certification « 1: Declarations, Initialization & Scoping

In this section we look at all types of class declaration and extension and how to use interfaces and the package and import statements. We examine the declaration, initialization and usage of primitives, arrays, enums, and objects as static, instance, local variables and their respective scopes. After this we cover correct use of overriding and overloading of methods as well as identifying legal return values for methods. We investigate constructors to determine if a default constructor will be created, and if so, determine the behaviour of that constructor. We finish of this section by studying class instantiation and how to instantiate nested and non-nested classes.

Lets take a look at the points outlined at the Oracle Website for this part of the certification.

  • Section 1: Declarations, Initialization and Scoping

    1. Develop code that declares classes (including abstract and all forms of nested classes), interfaces, and enums, and includes the appropriate use of package and import statements (including static imports).

    2. Develop code that declares an interface. Develop code that implements or extends one or more interfaces. Develop code that declares an abstract class. Develop code that extends an abstract class.

    3. Develop code that declares, initializes, and uses primitives, arrays, enums, and objects as static, instance, and local variables. Also, use legal identifiers for variable names.

    4. Given a code example, determine if a method is correctly overriding or overloading another method, and identify legal return values (including covariant returns), for the method.

    5. Given a set of classes and superclasses, develop constructors for one or more of the classes. Given a class declaration, determine if a default constructor will be created, and if so, determine the behavior of that constructor. Given a nested or non-nested class listing, write code to instantiate the class.

1.1 Classes, Packages, Imports

In our first lesson within this section we look at the rules for declaring classes and the access allowed to them and also investigate the package and import statements.

1.2 Interfaces / Abstract Classes

In this lesson we look at the rules for declaring and implementing or extending interfaces. After this we investigate how to declare and extend an abstract class and the rules for doing this.

1.3 Variables & Scope

In this lesson we examine the declaration, initialization and usage of primitives, arrays, enums, and objects as static, instance, local variables and their respective scopes.

1.4 Overriding & Overloading

In this lesson we cover correct use of overriding and overloading of methods as well as identifying legal return values for methods.

1.5 Constructors / Nested Classes

In this lesson we look constructors and how they are instantiated and invoked. We then look at nested classes and how we instantiate them.

go to home page Java5 Tutor Homepage go to home page Top

All the Java5 Certification Declarations, Initialization and Scoping lessons are listed below. Click a link to go to that lesson.

1: Declarations

1.1 Classes, Packages & Imports

1.2 Interfaces / Abstract Classes

1.3 Variables & Scope

1.4 Overriding & Overloading

1.5 Constructors / Nested Classes