Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Classes and Objects 
 

Objects and classes are the fundamental parts of object-orientated programming technique. A class can contains both data as well as methods. A simple class having no method must contain a method known as main() method. Execution of any class starts from t

 

Classes and Objects

                         

Objects and classes are the fundamental parts of object-orientated programming technique. A class can contains both data as well as methods. A simple class having no method must contain a method known as main() method. Execution of any class starts from the main() method. 

A class can have more than one instances (objects), let us consider a class employee having the employee details that serves for the employees of an organization, each time we create a new object for each employee. While all the employees share the same template (i.e. employee class).

This section illustrates how to define our own classes, that includes declaring and defining of member variables, methods, and constructors. We also try to cover nesting of classes within other classes, enum and annotations.
  1. Classes:
    This section explores the concept of a class in reference to object oriented programming techniques. A class defines the properties of  objects and methods used to control an object's behavior. In terms of object-oriented programming, the class is like a template from which an instance (object) of a class is created at run time.
                                                                     
  2. Objects:
    A
    n object is the combination of related states and behavior in which variables are just like states and the methods are just like behaviors (providing some functionality). In an object, variables store values for later use and methods are the unit of codes that provides a particular functionality. We can say objects are the basic units of the object-oriented programming. 
                                        

  3. Nested Classes:
    One more advantage of Java, as an object-oriented programming language is that it allows us to define a class within another class, such classes are known as nested classes.
                                                                         
  4. Enum Types: 
    Enum is a keyword which was introduced in Java 5. It is a particular type of class whose instances are only those objects which are members of that enum. The super class of all enum objects is java.lang.Enum, apart from this enum can not be extended.
                                                                      
  5. Annotations:
    Annotation is one more powerful feature of Java, an object-oriented programming language included in JDK 1.5. Annotations were introduced in September 2004  and added to the Java language through specification.

                         

» View all related tutorials
Related Tags: c class io nested definition source while ini member e il it not init art ce in no part as

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.