The Suns Java Certification and its Possible Role

The Sun’s Java Certification and its Possible Role in the Joint Teaching Material Nataša Ibrajter Faculty of Science Department of Mathematics and Informatics Novi Sad 1

Contents n n Kinds of Sun Certified Exams Why Become Java 2 Certified? Developer's Certification Exam (SCJD) The Programmer’s Exam (SCJP) n n Some Characteristic Questions A Proposal for the Joint Java Course The NS Experience Impact on the Joint Material 2

Kinds of Sun Certified Exams 3

Kinds of Sun Certified Exams n Sun Certified Programmer (SCJP) n n CX-310 -035 Programmer’s Exam Sun Certified Developer (SCJD) n n CX-310 -252 A Developer’s Programming Assignment CX-310 -027 Developer’s Essay Exam 4

Why Become Java 2 Certified? n n n It provides proof of professional achievement. It increases one’s marketability. It provides greater opportunity for advancement in one’s field. It is increasingly found as a requirement for some types of advanced training. It raises customer confidence in you and your company’s services. 5

Developer's Certification Exam (SCJD) n It consists of two parts: n n n a project assignment and a follow-up exam The assignment describes a task that starts with some code supplied with a project description. Person who takes the exam is supposed to finish the project. 6

Developer's Certification Exam (SCJD) n The follow-up exam has at least three aspects: n n n Java's features and libraries, knowledge and understanding of one's own classes, defending the choices one made writing code. 7

Developer's Certification Exam (SCJD) n n I/O streams Swing The AWT event model Object serialization n n RMI javadoc Packages Threads Interfaces 8

The Programmer’s Exam (SCJP) n Language fundamentals n n Source files Keywords and identifiers Primitive data types Literals n n boolean literals char literals 9

The Programmer’s Exam (SCJP) n n n Arrays Class fundamentals n n integral literals floating-point literals string literals the main() method variables and initialization Argument passing: by reference or by value Garbage collection 10

The Programmer’s Exam (SCJP) n Operators and assignments n n Evaluation order The unary operators n n n ++ and -+ and ~ ! cast operator 11

The Programmer’s Exam (SCJP) n The arithmetic operators n n n * and / % + and arithmetic error conditions The shift operators: >>, << and >>> n n fundamentals of shifting negative numbers arithmetic promotion of operands reduction of the right operand 12

The Programmer’s Exam (SCJP) n The comparison operators n n n n <, <=, > and >= the instanceof operator the equality comparison operators: == and != Logical operators: &&, || and ! Short-circuiting Bitwise operators: &, |, ^ and ~ The conditional operator: ? : The assignment operator 13

The Programmer’s Exam (SCJP) n Modifiers n n Modifier overview The access modifiers n n n public private default protected subclasses and method privacy 14

The Programmer’s Exam (SCJP) n Other modifiers n n n n n final abstract static initilalizers native transient synchronized volatile Modifiers and features 15

The Programmer’s Exam (SCJP) n Converting and casting n n Explicit and implicit type changes Primitives and conversion n n primitive conversion: assignment conversion, narrower primitives and literal values primitive conversion: method call primitive conversion: arithmetic promotion Primitives and casting 16

The Programmer’s Exam (SCJP) n Object reference conversion n n object reference assignment conversion object method-call conversion Object reference casting Flow control, assertions and exception handling n The loop constructs n n while do for break and continue statements in loops 17

The Programmer’s Exam (SCJP) n Selection statements n n n Exceptions n n n if-else construct switch construct flow of control in exception conditions throwing exceptions Assertions n n n assertions and compilation runtime enabling of assertions using assertions 18

The Programmer’s Exam (SCJP) n Objects and classes n Benefits of object-oriented implementation n n Implementing OO relationships Overloading and overriding n n n encapsulation re-use overloading method names method overriding Constructors and subclassing n overloading constructors 19

The Programmer’s Exam (SCJP) n Inner classes n n the enclosing this reference and construction of inner classes member classes defined inside methods Threads n Thread fundamentals n n what a thread executes when execution ends thread states thread priorities 20

The Programmer’s Exam (SCJP) n Controlling threads n n n n yielding suspending sleeping blocking monitor states scheluduling implementation Monitors, wait and notify n the object lock and synchronization 21

The Programmer’s Exam (SCJP) n n n wait and notify the class lock beyond the pure model deadlock another way to synchronize java. lang and java. util packages n n n The Object class The Math class The wrapper classes 22

The Programmer’s Exam (SCJP) n Strings n n the String class the String. Buffer class string concatenation easy way The collections API n n n collection types collections, equality and sorting the hash. Code method collection implementations in the API collections and code maintenance 23
![Some Characteristic Questions Language fundamentals n n Consider the following line of code: int[] Some Characteristic Questions Language fundamentals n n Consider the following line of code: int[]](http://slidetodoc.com/presentation_image_h2/2efecc29e61a9b5b6a696ae17d8b3b93/image-24.jpg)
Some Characteristic Questions Language fundamentals n n Consider the following line of code: int[] x = new int[25]; After execution, which statements are true? Choose all that apply. 1. 2. 3. 4. 5. x[24] is 0. x[24] is undefined. x[25] is 0. x[0] is null. x. length is 25. 24

Some Characteristic Questions n Operators and assignments n What results from the following fragment of code? 1. 2. 3. 4. 5. 6. int x = 1; String [] names = {“Fred”, “Jim”, “Sheila”}; names[--x] += “. ”; for(int i =0; i<names. length; i++){ System. out. println(names[i]); } 25

Some Characteristic Questions 1. 2. 3. 4. 5. The output includes Fred. with a trailing period. The output includes Jim. with a trailing period. The output includes Sheila. with a trailing period. None of the outputs show a trailing period. An Array. Index. Out. Of. Bounds. Exception is thrown. 26

Some Characteristic Questions n Modifiers n Given the following code and making no other changes, which combination of access modifiers (public, protected or private) can legally be placed before a. Method() on line 2 and be placed before a. Method() on line 6? 1. 2. 3. 4. 5. 6. 7. class Super. Duper{ void a. Method(){} } class Sub extends Super. Duper{ void a. Method(){} } 27

Some Characteristic Questions 1. 2. 3. 4. 5. line line 2: 2: 2: public; line 6: private protected; line 6: private default; line 6: private; line 6: protected public; line 6: protected 28

Some Characteristic Questions Converting and casting n n Will the following code compile? 1. byte b = 2; 2. byte b 1 = 3; 3. b = b * b 1; 1. Yes 2. No 29

Some Characteristic Questions class hierarchy for next question Animal Mammal Dog Cat implements Washer Raccoon implements Washer Swamp. Thing 30

Some Characteristic Questions n Consider the following code: 1. 2. 3. 4. 5. 6. Dog rover, fido; Animal anim; rover = new Dog(); anim = rover; fido = (Dog)anim; Which of the following statements are true? Choose one. 31

Some Characteristic Questions 1. 2. 3. 4. 5. Line 5. will not compile. Line 6. will not compile. The code will compile but will throw an exception at line 6. The code will compile and run, but the cast in line 6 is not required and can be eliminated 32

Some Characteristic Questions n Flow control, assertions and exception handling Consider the following code: 1. 2. 3. 4. 5. 6. 7. 8. for(int i=0; i<2; i++){ for(int j=0; j<3; j++){ if(i == j){ continue; } System. out. println(“i = ”+i+” j = ”+j); } } 33

Some Characteristic Questions Which lines would be part of the output? Choose all that apply. 1. 2. 3. 4. 5. 6. i i i =0 =0 =0 =1 =1 =1 j j j = = = 0 1 2 34

Some Characteristic Questions n Objects and classes n Considering this class: 1. public class Test 1{ 2. public float a. Method(float a, float b){} 3. 4. } Which of the following methods would be legal if added (individually) at line 3? Choose all that apply. 35

Some Characteristic Questions 1. 2. 3. 4. 5. public int a. Method(int a, int b){} public float a. Method(float a, float b, int c) throws Exception{} public float a. Method(float c, float d){} private float a. Method(int a, int b, int c){} 36

Some Characteristic Questions Threads n n A Java monitor must either extend Thread or implement Runnable. 1. 2. True False The java. lang and java. util packages n n In the following code fragment, line 4 is executed. 37

Some Characteristic Questions 1. String s 1 = “xyz”; 2. String s 2 = “xyz”; 3. if (s 1 == s 2) 4. System. out. println(“ 4”); 1. True 2. False 1. String s 1 = “xyz”; 2. String s 2 = new String(s 1); 3. if (s 1 == s 2) 4. System. out. println(“ 4”); 1. True 2. False 38

A Proposal for the Joint Java Course n Part I - Imperative Java programming n n n n Introduction (in case that Java is the first programming language) The language overview (elements of Java) Simple data types Expressions and control structures Structured data types: arrays Methods Recursion Complex examples with arrays (searching and sorting) 39

A Proposal for the Joint Java Course n Part II - OOP in Java and advanced topics n n n n Introduction to OOP (OOP in general, place of Java, its development. . . ) Basic notations of OOP Classes and objects. Class methods and variables. Object creation Inheritance and polymorphism Concatenated list structures Trees Packages Interfaces 40

A Proposal for the Joint Java Course n n n n n Abstract classes Introduction to UML Exceptions GUI development Class libraries, Java Collection Framework Reflection in Java Threads Basic notions of WWW Applets Remote Method Invocation 41

A Proposal for the Joint Java Course n Part III - Environments for Java programming n n Usage of J 2 SE JDK 1. xx Part IV - Java programming at large n Introducing SE principles in Java programming 42

The NS Experience n n n Our students are obliged to take part in not less than 70% of practical exercises, not less than 50% of exercises and not less than 30% of lectures. The exam consists of the practical part (which is taken during the practical exercises) and of the test. The Java certification is used as a template for the test. 43

The NS Experience n n n Students mostly show weakness in understanding how Java solves OOP issues like overriding, overloading, program flow etc, not in understanding theoretical basics of OOP. The tests practical knowledge in Java, not theoretical knowledge in OOP. If the students missed to study some aspect of a problem taking practical part of the exam, the test forces them to restudy the problem. 44

The NS Experience n n 70% of Programmer’s Exam questions covered by our course More than 90% excluding major sections like threads and assertions Therefore, we cannot ‘blindly’ use any of the questions Should we change our course to cover more questions? n n Suggestion: No However, some compatibility useful 45

Impact on the Joint Material n n From our experience: without references to the Java Certification we cover about 70%/90% of the questions For the creation of the Joint Material, occasional references to Java Certification exam questions are useful to n n see what the industry thinks is important check for omissions 46
- Slides: 46