SCJP – Quick Notes

GENERAL TIPS

# An empty source file will compile without error

# If a. java file does not contain a public class or interface it can have any name

# The Sun SDK allows one and only one public class or interface within a source code file.

# The filename must exactly match the name of the public class or interface declared in the file and have the .java extension #The java.lang package is automatically imported in every compilation unit, it does not have to be specifically imported

# It is legal to import a single-type and a package having the same names

i.e.

import java.util.Vector;

import Vector.pest; // no compile error

# A compile error occurs if the same modifier appears more than once in a declaration

# Package access (no access modifier declared) is also referred to as friendly access

# A class may not be both final and abstract as an abstract class implies extension

# Multiple extends are illegal ie a class may have only one superclass

# If no extends clause is used, the class automatically inherits from the java.lang.Object class

# An Anonymous class cannot have an extends clause

# A class must provide a method implementation (execution code) for every method declared in or inherited by the interface

Page Visitors: 3077

The following two tabs change content below.
Tomcy John

Tomcy John

Blogger & Author at javacodebook
He is an Enterprise Java Specialist holding a degree in Engineering (B-Tech) with over 10 years of experience in several industries. He's currently working as Principal Architect at Emirates Group IT since 2005. Prior to this he has worked with Oracle Corporation and Ernst & Young. His main specialization is on various web technologies and acts as chief mentor and Architect to facilitate incorporating Spring as Corporate Standard in the organization.
Tomcy John

Latest posts by Tomcy John (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *