Results 1 to 4 of 4

Thread: explain class in java

  1. #1
    Join Date
    Nov 2009
    Posts
    518

    explain class in java

    Hi,
    I am a new bee to java. I like this programming language very much because it uses the object oriented features. I know java classes, but an good explanation can help me know classes better. Thanks

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: explain class in java

    Java is a object-oriented programming. In java programming language a class acts as a construct and it is used as blueprint to create objects. The blueprint is the state and behavior and all objects of the class share it. An object is called the instance of the class.
    Last edited by Praetor; 03-11-2009 at 09:43 AM.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: explain class in java

    Classes are the fundamental of java programming language. An class employee can be defined as:
    class Employee {
    int age;

    double salary;
    }

    Here "Employee" is a class. By convention the initial of a class is capital.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: explain class in java

    Classes are used in java so that the code can be robust and reused. Classes simplify the work between interrelated data. Here is another example of class in java
    public class Film {
    String called;
    int minutes;
    public Film (String title, int length) {
    called = title;
    minutes = length;
    }
    public int getminutes() {
    return minutes;
    }
    public String getcalled() {
    return called;
    }
    public void setminutes(int length) {
    minutes = length;
    }
    }

Similar Threads

  1. Explain java xor (^) operator
    By sligh in forum Software Development
    Replies: 5
    Last Post: 09-05-2012, 06:44 PM
  2. Explain how to define function outside the class in C++?
    By Palnila in forum Software Development
    Replies: 4
    Last Post: 29-12-2010, 03:11 AM
  3. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  4. Explain the System.Exception class of C#
    By Jesus2 in forum Software Development
    Replies: 3
    Last Post: 17-11-2009, 03:51 AM
  5. Explain Try Catch Block in java
    By cyber-noob in forum Software Development
    Replies: 3
    Last Post: 16-11-2009, 02:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,496,066.38180 seconds with 17 queries