Java程序員認證考試

Sun Java認證分爲兩個級別:Sun 認證Java程序員和Sun 認證Java開發員。下面是小編整理的關於Java程序員認證考試,希望大家認真閱讀!

Java程序員認證考試

  SUN認證

SUN認證是給網絡設計界建立的一套認證標準,Sun公司推出了Java以及Solaris技術認證方案。對於企業而言,可以藉助這項認證作爲招聘人才的.評判標準,或是作爲衡量員工技術水準的依據;在個人方面,通過這些認證也可以證明個人的技術能力。

認證考試   該認證主要面對Java程序員。同時,該認證是業界唯一經Sun授權的Java認證,考試內容涉及所有Java相關知識、編程概念及applet開發技巧。Sun認證Java程序員考試旨在觀察您通過應用軟件分配進行復雜編程的能力,之後還要測試您完成編程所需的知識。每次考試都包括65道以上的選擇題,時間大約爲90分鐘。目前在這方面有兩項認證:Sun Certified Java Programmer(SCJP)和 Sun Certified Java Developer

(SCJD)。SCJP測驗Java程序設計概念及能力,內容偏重於Java語法及JDK的內容;SCJD則進一步測試用Java開發應用程序的能力,考試者必須先完成一個程序的設計方案,再回答與此方案相關的一些問題。   2. Solaris系統管理認證考試

對Solaris/Sun OS系統管理員,Sun推出Certified Solaris Administrator(CSA)。CSA分別爲兩個等級(Part Ⅰ和 Part Ⅱ),測試對Solaris系統管理的瞭解程度。

3. Solaris網絡管理認證考試

爲了測試使用者對於Solaris網絡管理能力,Sun推出Certified Network Administrator(CNA)。內容包括基本網絡概念、Routing and Subnet、Security、Performance、DNS、NIS+等。

通過SUN任何一門專業認證後,考生將收到SunMicrosystems總公司寄發的資格證書及徽章,並有權將通過Sun認證的標記印在個人名片上,作爲個人技術能力的肯定。

  SUN JAVA程序員認證考試大綱

Basic Object Oriented Concept

Object

An instance of a class

Has state and behavior

State is contained in its member variables

Behavior is implemented through its methods.

Message

For objects to interact with one another

Result of a message is a method invocation which performs actions or modifies the state of the receiving object

Classes

An object`s class is the object`s type

The ability to derive one class from another and inherit its state and behavior

Most general classes appear higher in the class hierarchy

Most specific classes appear lower in the class hierarchy

Subclasses inherit state and behavior from their superclasses

Interface

A collection of method definitions without actual implementations

For defining a protocol of behavior that can be implemented by any class anywhere in the class hierarchy.

Packages

A collection of related classes and interfaces

is imported by default automatically

Java Language Fundamentals

The order for every "heading" is as follows:

package declarations -- package erfaces;

import statements -- import .*

class definitions -- public class myClass { .....

Order of public vs. non-public class definitions doesn`t matter.

Allows only one top-level public class per source file

Name of source file must be the same as name of the public class

main() method must be:

public

static

Not return a value (void return type)

Take an array of strings:(String[] args) or (String args[]) doesn`t matter

`args` is just a common name, you can use any name you like. However, there must be a set of "[]"

Legal examples:

public static void main(String[] args)

static public void main(String args[])

Command line arguments are placed in the String array starting at 0 after the java command and the program name

For non-applet java application, there must be a main method

For applet, you do not use main()

Applet:

a subclass of Panel, which itself is a subclass of Container

init() - called when applet is first instantiated.

start() - called when the web page containing the applet is to be displayed

stop() - called when the web browser is about to show another web page and quit the current one

HTML required to display an applet in a web page:

PARAM tag allows you to pass a value to an applet:

To use these values in your applet, use the getParameter(String paramname ) method to return the value as a string:

greeting=getParameter("message");

Java Identifier

Consists of letters and digits

Must begin with a letter , "$" or "_"

Unlimited length

Cannot be the same as a reserved keyword

Java Reserved Word

Reserved Keywords cover categories such as primitive types, flow control statements, access modifiers, class, method, and variable declarations, special constants, and unused words

abstract - boolean - break - byte - case - catch - char - class - const - continue - default - do - double - else - extends - final - finally - float - for - goto - if - implements - import - instanceof - int - interface - long - native - new - null - package - private - protected - public - return - short - static - super - switch - synchronized - this - throw - throws - transient - try - void - volatile - while

True, false and null are literals, not keywords

Primitives

Occupy pre-defined numbers of bits

Have standard implicit initial values

Type conversion

You cannot assign booleans to any other type.

You cannot assign a byte to a char.

You can assign a variable of type X to type Y only if Y contains a wider range of values than X.

Primitives in order of `width` are char/short, int, long, float, double.

For Objects, you can assign object X to object Y only if they are of the same class, or X is a subclass of Y, which is called "upcasting".

Promotion

In arithmetic operations, variable may be widened automatically for the purpose of evaluating the expression

The variables themselves would not be changed, but for its calculations Java uses a widened value.

Casting

Similar to forcing a type conversion - values can be casted between different primitive types

Done by placing the destination cast type keyword between parentheses before the source type expression

Some cast operations may result in loss of information

Variables derived from these primitive types that are declared in nested blocks could only be accessible within that block and its sub-blocks, and are destroyed when the block they belong to is stopped

Major primitive types:

Primitive Type

Size

Range of Values

Byte

8 bit

-27 to 27-1

Short

16 bit

-215 to 215-1

Int

32 bit, all are signed

-231 to 231-1

Long

64 bit

-263 to 2 63-1

Char

16 bit unicode

`/u0000` to `/uffff`

(0 to 216-1 )

Java unicode escape format: a "/u" followed by four hexadecimal digits. e.g.,

char x=`/u1234`

Other primitive types:

Long - can be denoted by a trailing "l" or "L"

Float - can be denoted by a trailing "f" or "F"

Double - can be denoted by a trailing "d" or "D"

Booleans - true or false only, cannot be cast to or from other types

Array - declared using the square brackets "[]". Example of legal declarations :

int[] x;

int x[];

int i[][]; declares a two dimensional array.

Can be created dynamically using the new keyword

Can be created statically using an explicit element list

Array element counts from 0. For example, int[10] actually has 10 elements, from 0 to 9, not from 1 to 10

Array can be constructed after declaration, or to have everything done on the single line

int[] i;

i = new int[10];

OR

int i[] = new int[10];

Array members can be initialized either through a FOR loop, or through direct assignment

int myarray[] = new int[10];

for(int j=0; j

myarray[j]=j;

}

OR

char mychar[]= new char[] {`a`,`e`,`i`,`o`,`u`};

Do not get confused with string. Strings are implemented using the String and StringBuffer classes.

Bitwise Operation

numerics can be manipulated at the bit level using the shift and bitwise operators

Java includes two separate shift-right operators for signed and unsigned operations, the ">>" and the ">>>"

>> performs a signed right-shift. If the first bit on the left is 1, then when it right-shifts the bits, it fills in a 1s on the left. If the leftmost bit is 0, then when it right-shifts the bits, it fills in a 0s on the left. The first bit represents the sign of a number to preserve the sign of the number.

>>> performs an unsigned right-shift. The left side is always filled with 0s.

<< performs a left-shift. The right side is always filled with 0s.

Java Operator

Operators that compare values

equal to, "=="

not equal to, "!="

greater than, ">"

less than, "<"

greater than or equal to, ">="

less than or equal to, "<="

Logical Operators

logical AND, "&"

logical OR, "|"

logical XOR, "^"

boolean NOT, "!"

short-circuit logical AND, "&&"

short-circuit logical OR, "||"

Operator precedence determines the order of evaluation when different operators are used, although precedence can be explicitly set with parentheses "()".

Multiple operators of the same precedence are evaluated from left to right

In logical boolean expressions, the right operand is only evaluated after the left hand operand has been evaluated first.

For short-circuit logical expression, if the left hand condition does not evaluate to true, the right hand condition will not be evaluated at all

For Objects, == determines whether the variables reference the same object in memory, rather than comparing their contents.

For example, when

String x = "Hey";

String y = "Hey";

Java creates only one String object, so the result of comparison is always true.

To avoid the above situation, use the NEW keyword so that string x and y can be of different objects.

In Booleans, equals() returns true if the two objects contain the same Boolean value.

In String, equals() returns true if the Strings contain the same sequence of characters.

Java Modifiers

private

Accessible only from inside the class

Cannot be inherited by subclasses

protected

Accessible only by classes in the same package or subclasses of this class

public

Can be accessed by anyone

static

Belongs to the class, not to any particular instance of the class

For variables, there is only one copy for all instances of the class. If an instance changes the value, the other instances see that changes

For methods, it can be called without having created an instance, and cannot be used the this keyword, nor be referred to instance variables and methods directly without creating an instance For inner classes, they can be instantiated without having an instance of the enclosing class

Methods of the inner class cannot refer to instance variables or methods of the enclosing class directly

final

Variable`s value cannot be changed

Methods cannot be overridden

Classes cannot be subclassed.

native

Method written in non java language

Outside the JVM in a library

Optimized for speed

abstract

Method which is not implemented with code body

synchronized

method makes non-atomic modifications to the class or instance

for static method, lock for the class is acquired before executing the method

for non-static method, a lock for the specific object instance is acquired

transient

field is not part of the object`s persistent state

should not be serialized

volatile

field may be accessed by unsynchronized threads

certain code optimizations must not be performed on it

none

class- non-public class is accessible only in its package

interface - non-public interface is accessible only in its package

member - member that is not private, protected, or public is accessible only within its package

Summary of Class Member Accessibility