+ Reply to Thread
Results 1 to 2 of 2

Thread: What is an abstract class

  1. #1
    Senior Member
    Join Date
    Apr 2008
    Posts
    13,341
    Rep Power
    141

    What is an abstract class

    What is an abstract class?



  2. #2
    Junior Member
    Join Date
    Jul 2008
    Location
    New Delhi
    Posts
    26
    Rep Power
    5

    Re: What is an abstract class

    It is defined by keyword abstract. It has no implementation, only has the definition of the method without body.
    All the methods and properties in an Interface by default public and abstract.
    we can use static in Interface
    ex:

    Definition of Abstract
    public abstract class product
    {
    protected string ID;
    protected double ID;
    public abstract string ID
    {
    get;
    set;
    }
    public abstract double price
    {
    get;
    set;
    }
    public abstract double calculation();
    }
    Implement of Abstract
    public class Implement:Product
    {
    public override string ID
    {
    get
    {
    return id;
    }
    set

    {
    id=value;
    }

    }
    public
    override double Price
    {
    get
    {
    return
    price;
    }
    set

    {
    price=value;
    }

    }
    public
    override double calculation()
    {
    return Price*1.25;
    }
    }
    Testing of Interface
    Implement TestI=new Implement();
    TestI.Id="B1";
    TestI.Price=900.00;
    double Iamt=TestI.calculation();



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Features Removed from C and C++
    By TAM in forum JAVA Technologies
    Replies: 1
    Last Post: 27-09-07, 05:35 PM
  2. Bob Technologies placement paper 2
    By sridhar in forum BOB TECHNOLOGIES Placement Papers
    Replies: 0
    Last Post: 03-02-07, 07:43 PM
  3. java JSP
    By naga in forum JAVA Technologies
    Replies: 4
    Last Post: 21-08-06, 04:03 PM
  4. reply to abstract class question5
    By kavithaethiraaj in forum JAVA Technologies
    Replies: 0
    Last Post: 18-04-06, 03:29 AM
  5. Answers Wanted to these QUESTIONS ?
    By aparna3032 in forum JAVA Technologies
    Replies: 3
    Last Post: 23-02-06, 03:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Content Relevant URLs by vBSEO 3.5.1 PL1