Posts

Showing posts from October 22, 2010

Outer Inner and Anonymous Classes java

Outer and Inner Class in Java     In Java, Class which is written inside the class called Inner Class. Class which has the inner class called outer class.     There are four types of Inner Class in java.     1)Static nested class 2)Member Class 3)Local Class 4)Anonymous Class     Static nester class -     Any class written inside the class with static keyword called  Static nester class.     Example -     public class Test{             /* Static nested class*/         static class InnerClass{                 }     }         There is  InnerClass is  Static Nested Class.     Member Class -     Any class written inside the class without the...

about Heap and Stack Memory in Java

Stack  Memory Allocation and Heap Memory Allocation In Java Virtual Machine, There are two type of memory allocation process. 1)Stack  Memory Allocation 2)Heap Memory Allocation Stack  Memory Allocation -            When ever any class will be written in java, this files content will goes in the  Stack  Memory Allocation area.     Example:-            class TestA{         int x=10;         int y=20             public int add(int x, int y){         return x+y;            }     }     The class A will be stored in Stack  Memory Allocation area. Heap Memory Allocation -     When ever object of any clas...

Recent Post

Recent Posts Widget