I’m Currently Preparing for OCPJP (SCJP) Exam and i thought it might be useful to post my Notes on every chapter of Kathy Sierra and Bert Bates book “SCJP Sun Certified Programmer for Java 6 Exam 310-065” , you can not study from these notes, you must read every chapter from the book, these notes for everyone who wants to make a quick review on every chapter, i will post 10 posts (1 post/chapter),and here is the first Chapter of the Series,
Chapter 1: Declarations and Access Control
Instance Variables: Variables defined inside a class that each Object have a copy of it.
There is Three Types of Identifiers :
1) Legal Identifiers:
a) Starts with $,_,Letters but can’t start with a Number, after the first letter we can add Number to Identifier.
b)They are Case-Sensitive.
c) No limit to Number of Characters an identifier can Contain.
2) Sun Code Conventions:
a) with Classes /Interfaces: class Name Must Start with a Capital Letter.
b) with Functions/Methods: method name must start with a small letter.
c) with variables : same as methods must start with a small letter.
d) with Constants: all Constant Characters Must be CAPITAL.
3) Java Beans Standards :
a) Functions that doesn’t return boolean called Getters and must start with get for example : getSize()
b) Functions that return Boolean may start with is/get but “is” is perfered isValid()
c) Function that set values must start with set called Setters setSize()
d) Setters Must be Void and Accept Parameters. Continue reading