Hi,
I am preparing myself for scjp certification.So I thought why don't I blog what I learn.
Friends! let me know if you feel I have gone wrong...
Thanks,
smartace
Let me start with the introduction to scjp which I collected from java.sun.com and continue blogging with each chapter I cover.
SCJP is a certification which helps you to bench mark the level of knowledge you have in java programming, libraries and api.There is multiple level of certification offered by Sun. The exam can be taken up at any authorized Prometric training center around the world.
Sun offers seven Java-related certification exams:
• Sun Certified Java Programmer (SCJP)
• Sun Certified Java Developer (SCJD)
• Sun Certified Web Component Developer (SCWCD)
• Sun Certified Business Component Developer (SCBCD)
• Sun Certified Mobile Application Developer (SCMAD)
• Sun Certified Enterprise Architect (SCEA)
• Sun Certified Developer for Java Web Services (SCDJWS)
SCJP 5 certification exam totally contains 46 questions, out of which 27 should be correct to be pass. That means the pass mark is 58%. Duration of the exam is 105 minutes.
Exam objectives:
The seven categories of objectives for the exam are as follows:
1. Declarations, initialization, and scoping
2. Flow control
3. API contents
4. Concurrency
5. Object-oriented concepts
6. Collections/generics
7. Fundamentals
I am preparing myself for scjp certification.So I thought why don't I blog what I learn.
Friends! let me know if you feel I have gone wrong...
Thanks,
smartace
Let me start with the introduction to scjp which I collected from java.sun.com and continue blogging with each chapter I cover.
SCJP is a certification which helps you to bench mark the level of knowledge you have in java programming, libraries and api.There is multiple level of certification offered by Sun. The exam can be taken up at any authorized Prometric training center around the world.
Sun offers seven Java-related certification exams:
• Sun Certified Java Programmer (SCJP)
• Sun Certified Java Developer (SCJD)
• Sun Certified Web Component Developer (SCWCD)
• Sun Certified Business Component Developer (SCBCD)
• Sun Certified Mobile Application Developer (SCMAD)
• Sun Certified Enterprise Architect (SCEA)
• Sun Certified Developer for Java Web Services (SCDJWS)
SCJP 5 certification exam totally contains 46 questions, out of which 27 should be correct to be pass. That means the pass mark is 58%. Duration of the exam is 105 minutes.
Exam objectives:
The seven categories of objectives for the exam are as follows:
1. Declarations, initialization, and scoping
2. Flow control
3. API contents
4. Concurrency
5. Object-oriented concepts
6. Collections/generics
7. Fundamentals
Declarations,initialization, and scoping
ReplyDeleteThe declarations, initializations and scoping are the basic concept of java. The first that one should know is Identifiers. Identifiers are the names used to declare a variable, method and class. Java has a set of in built keywords and those keywords must not be used as identifier.
The legal identifier must start with a letter, a currency ($), or a connecting character (_) and not with a number. There is no limit to the number of characters in an identifier. The identifier is case-sensitive and can have any combination of letter, number, currency characters, or connecting characters.
Class is a template definition of the methods and variables in a particular kind of object.
At runtime instances of classes are created, called object of the class.
Before discussing about class, let’s go through the rules for declaring the class or source file:
> There can be only one public class per source code file.
> The source code can have multiple non public classes in it.
> The name of the class file must be same as the public class.
> The order of statements in class is such as package statement, import statement and then class declaration.
> Comments can be any where in the code.
The modifiers used for class are of two categories:
Access Modifier –public, protected, private and default (no access modifier)
Non-Access Modifier like final, abstract etc.
Access Modifiers:
• Public modifier-the field is accessible from all classes.
• Private modifier-the field is accessible only within its own class.
• Protected modifier - accessible by the package classes and any subclasses that are in other packages
• Default modifier -accessible to classes in the same package but not by classes in other packages, even if these are subclasses.
Non Access Modifiers:
Final:
The variable marked final can not be modified.The method marked final can not be overridden by subclasses.The class marked final can not have subclass.
Static:
Static variable can be accessed with the class name and hence called class variable.Static method can not access only static members of the class.Inner class can be a static class.
Abstract:
Abstract method has only declaration and no definition.Abstract class can not be instantiated. In order to instantiate, it must have a concrete subclass.
Each class except Object is an extension of (that is, a subclass of) a single existing class and may implement interfaces. Using extends keyword a class can be extended from another class.
Nested Class is a class that is defined within another class.
Will Continue...
* Local variables can only be marked as final .
ReplyDelete* Class can have only two access modifiers : public and default. It cant be protected or private.
Thanks zeetac for adding on good points.
ReplyDeleteIf class can only be public or default, will the code below complie and run?
ReplyDeleteclass Test {
public static void main(String[] args) {
System.out.println("This is test code");
Test.SampleClass s=new Test().new SampleClass();
s.print();
}
protected class SampleClass{
public void print(){
System.out.println("This is protected class");
}
}
}
The above code will compile and run fine. From that its clear that class can have access modifier protected.
ReplyDeleteBut only if its an inner class.
The top level class can have only public or default access modifier.