Nov 7, 2013

Internals of Classes

Internals of Classes: Explaining internal mechanism of classes in java

Internals of classes: Classes in java are user defined data types.We can understand internal of classes with an example which is discussed below in this post.A java class is the container which stores members. Class members means methods,variables,blocks,constructor. Class binds multiple methods into a single unit. A class can have only four types of members i.e. methods,variables,blocks,constructor. 

As in real world, Human is a class,Vehicle is a class, Animal is a class same here in java there are classes having their objects.

More specifically class is a concept. for ex- A class room which has its boundary, all things like fan,table,chair,computer are its member and the area in which these members exists is known as class.

Program for a class in java-

//defining class name in java programming

class Java_prg


// main() method

public static void main(String args[])


// message to display

System.out.println("this is a class");



Java References:-