Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Friday, July 31, 2009

Core Java Basics

Hi friends,
Today, I would like to note some points that freshers in JAVA should know.

1.Abstract class

For an abstract class, we can't create an object,

it's sole purpose is only to be extended.

If a Class is marked abstract and if any class is extending this Class then we will have to implement this method in that class too, or it will throw an error.

2.Final Keyword

Final Keyword is used before a class declaration and such a class cannot be extended.

3.Interface

An Interface is otherwise known as a 100% abstract class, consisting of abstract methods only. Suppose if you create any other methods other than abstract methods, then it will throw an error

Only an interface can extend another interface

A class can implement a interface but cannot extend it


4.Static

We can use static keyword either in front of a Class or a method

and suppose

If we are calling this method in another class, we need not create an instance/object for that class,we can straight away call the method with the help of the class name itself.

5.Method

A method should always be contained inside a class

6.Object

Objects are created with "new" keyword and are present in a memory known as heap.
Their scope ends with the end of execution of the Class.

7.Instance Variables

Instance Variables are created inside methods and are present in a memory known as stack.
Their scope ends with the end of execution of the method.

This is not all! We have lots more to discuss! We shall learn slowly one step at a time!

No comments: