Category: Root

SCJP Training: Lesson 7: Fundamentals #Java Short Notes #SCJP

Controlling Access to Members of a Class Using Package Members Command-Line Arguments Command-Line I/O Objects Passing information to a Method or Constructor Using Objects Managing Source and Class Files Assignment, Arithmetic, and Unary Operators Equality, Relational, and Conditional Operators Object as a Superclass Comparing Strings and Portions of Strings From: http://sitestree.com/?p=5054 Categories:Java Short Notes, SCJPTags: …

Continue reading

SCJP Essential Knowledge #Java Short Notes #SCJP

int x=5; String y=”3″; System.out.print(x + 1 + y); Output: 63 When there is no live reference to an object, the object becomes eligible for garbage collection. The concrete interface method implementation must be public. When a class implements Comparator, it must implement a compare method. When a class implements Comparable, it must implement a …

Continue reading

SCJP Training: Lesson 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). #Java Short Notes #SCJP

Declaring Classes Abstract Methods and Classes Nested Classes Interfaces Enum Types Creating and Using Packages Using Package Members (import statements, static imports) Defining an Interface Implementing an Interface Abstract Methods and Classes Primitive Data Types Arrays Enum Types Understanding Instance and Class Members Variables Declaring Member Variables Understanding Instance and Class Members Passing Information to …

Continue reading

SCJP Training: Lesson 2: Flow Control #Java Short Notes #SCJP

The if-then and if-then-else Statements The switch statement The for Statement The while and do-while Statements Branching Statements Questions and Exercises:Classes (assertion example) Catching and Handling Exceptions The try Block The catch Blocks The finally Block Putting It All Together The Catch or Specify Requirement Specifying the Exceptions Thrown by a Method Putting It All …

Continue reading

SCJP: Rules #Java Short Notes #SCJP

A class’s superclasses don’t have to implement Serializable in order to be serialized if a superclass doesn’t implement Serializable then it’s constructor will run during deserialization A transient variable’s state is lost during serialization, but a volatile variable’s state is not lost Java:Volatile variable Transient Variable NumberFormat, Calendar, DateFormat are abstract classes. Use the getInstance …

Continue reading

SCJP: Short Notes #Java Short Notes #SCJP

For the package package com.sun2;public enum Seasons {SUMMER, FALL, WINTER, SPRING} Valid import statements are: import com.sun2.Seasons; // the class import static com.sun2.Seasons.*; //all enum valuesimport static com.sun2.Seasons.FALL; //only one enum value An interface can extend many interfaces Interfaces can have variables, overrides and overloads An enum can have methods and can override those methods …

Continue reading

SCJP: More Rules #Java Short Notes #SCJP

java -classpath gFolder/Game.jar civilization.java: In such command, -classpath will override (replace) CLASSPATH environment variable. java -classpath gFolder/Game.jar civilization.java: if both gFolder and current directory contain Game.jar then the jar file under gFolder will be used. If you want java compiler to recognize your jar file, either you have to mention the location of the jar …

Continue reading

SCJP Practice Exams #Java Short Notes #SCJP

Check these practice exams. Be careful that many java rules may have changed over the time. Check that which jdk version or the exam these practice exams support http://www.jchq.net/mockexams/exam2.htm 20 practice exams Java Ranch JavaRanch Self Tester Marcus Green’s Mock Exam 1 Marcus Green’s Mock Exam 2 Marcus Green’s Mock Exam 3 Sun’s SCJP2 Site …

Continue reading

SCJP: Basic Java I/O #Java Short Notes #SCJP

ByteStream is the basic I/O stream. Handles data as a stream of bytes. Does operation with byte unit and uses 8 bit. FileInputStream, FileOutputStream – can be used to copy files as byte by byte. Character Streams: FileReader and FileWriter are character streams. They treat file data as 16 bit unicode charater streams. InputStreamReader, OutputStreamWriter …

Continue reading

SCJP: Java Concurrency #Java Short Notes #SCJP

Java High Level Concurrency Objects constructors cannot be synchronized Liveness of multi-threaded applications Immutable Objects An application may have one or more processes. A process may have one or more threads. Two ways to create threads Thread.sleep(4000); To pause a thread. The time like 4000 ms is really dependent on the os and not precise …

Continue reading