Archive for January, 2011

Hiding : Happens during inheritance (between superclass and subclass).

Shadowing : Happens within a class (between a member variable and local variable).

Examples :

Hiding :

class Parent {

String city = “Dallas”;


class Child extends Parent {

String city =”Zurich”;


“city” in Child hides the one in Parent.

Shadowing :

class Main {

String city = “Dallas”;

void method() {

String city = “Zurich”;



“city”, local variable shadows the member variable.


Read Full Post »

Stack and heap memory

What is stored where?

Stack :

– local variables

Heap :

– instance variables

– static variables

– objects

Following  snippet will help to understand better.

stack_heap image

Read Full Post »

MS word, Outlook, Spreadsheet, Browsers are some of the examples of heavy weight programs.

Running the above programs concurrently.

Multithreading :
Let’s take Outlook. At the same time it allows to compose a mail, send/receives new mail while typing, prints some mail while typing and send/receiving the mail, this concept is called multithreading.

Reference link which explains with pictures.

Read Full Post »