Java & OO Fundamentals

Platform
  • Define the following terms: bytecode, JVM.
  • Differentiate the purpose of the JDK and the JRE.
  • Associate the terms Java SE and Java EE to a correct given definition.
  • Identify the files extensions that contain Java source code and Java bytecode.
  • Understand (high level principle) how Java achieves cross operating system portability.
  • Define the purpose of .java and .class files.
Variables
  • Declare a local variable of type int, double or boolean.
  • Identify the default value of references, int, double and boolean.
  • Identify cases where a default value is not assigned, and predict an error in a code fragment that uses an uninitialized variable.
Scope
  • Use blocks "{ }" for narrowing the scope of local variables.
  • Given a code fragment, detect the forbidden usage of local variables where they are not visible (outside definition block, before definition).
Operators
  • Write expressions and predict the result of given expressions that use these operators: =, +=, ++, ==, !=, <, <=, >, >=, !, ||, &&, +, -, *, /.
Flow Control
  • Write code with the if-else, while, for.
NOT covered: switch, continue and break, "for each" introduced in Java 5. Methods
  • Define and call static methods with parameters and a return type.
  • Use the void keyword to have no return type.
  • Understand how the return keyword impacts the execution flow.
  • Understand that parameters are passed by value (copied on the stack).
Naming
  • Identify cases where these Java language basic naming conventions are not respected:
    • keywords and packages: lower case
    • classes: CaMeL case, begin with a capital.
    • methods and variables (including static): caMeL case, begin with a lower case.
Know that any unicode character can be used to name classes, variables, attributes, methods and packages. Comments Define comments inside a Java code fragment, using // and /* */. Javadoc Navigate through the Jave SE JavaDoc to find informations. Classes and Objects
  • Write a basic .java file to define a class, declaring the package correctly.
  • Use the default constructor, or write a constructor.
  • Define instance attributes with an initial value.
  • Differentiate the scope of attributes and local variables.
  • Declare valid methods with a return type (which might be void).
  • Return a value at the end of a method execution.
  • Identify the signature for the main method, and use it as program entry point (including its parameter).
  • Declare and use static methods and attributes. Given a code fragment, identify the forbidden situation where a static method calls a non-static method (or access a non static attribute) without going through an instance. Understand that static attributes are shared for all instances in the JVM.
  • Access attributes and methods with and without this keyword.
Packages
  • From its package name, determine the sub-directory path where a .java file should be located.
  • When using a class from another package, import that package correctly.
  • Create a package and put a class in it.
  • Put a class in the default package.
  • Locate a .java or .class file in the directory structure from its package name.
  • Import classes from other packages in a .java file.
  • Distinguish a class using:
    • its fully-qualified name;
    • its short name plus a specific class import;
    • its short name plus a package import (* notation).
  • Know the general purpose of java.lang and java.util.
Encapsulation
  • Assign a visibility modifier (public, private) to a method or attribute. In a code fragment, determine the validity of these modifiers basic usage (no trick).
References
  • Differentiate class and object instance of a class, a class may have multiple instances.
  • Understand the reference mechanism, ascertain the difference between an object and its reference. Identify impact on:
    • comparing objects (== vs. .equals())
    • assignments
    • passing methods arguments. Know that object references are passed by value to methods and that the referenced object is not copied: When an object is passed to a (Java) method, the code inside the method modifies the states (the attributes) of the object. Back from the method execution, in the caller code, the object state is not restored and remains affected.
  • Manipulate state of objects (set of object's attributes). From a code fragment, predict the behaviors of reference usage. Understand that a reference to an object is like a pointer, and changing the value of a reference does not affect the object it pointed to.
Properties
  • Define the notion of property.
  • Identify getters and setters from a given class defintion.
Strings
  • Instantiate, concatenate and compare String literals and variables.
  • Understand that a String is not a primitive type.
Garbage Collection
  • Differentiate the memory management of Java and other languages that do not use garbage collection.
  • This includes knowing that the JVM tracks unreferenced objects which are eligible for GC, and that the JVM decides when to run the GC.
  • Identify simple code situations that lead to memory leaks.

你可能感兴趣的:(java,jvm,jdk,OO,Access)