Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

concrete class and abstract

This is a discussion on concrete class and abstract within the C# forums, part of the Software Development category; what is concrete class and abstract class give their difference?...

Go Back   Geeks Talk > Software Development > C#
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 08-24-2009
Junior Member
 
Join Date: Aug 2009
Location: chennai
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
dprakashraj is on a distinguished road
concrete class and abstract

what is concrete class and abstract class give their difference?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-25-2009
Junior Member
 
Join Date: Nov 2007
Posts: 26
Thanks: 2
Thanked 4 Times in 4 Posts
shilpa.c is on a distinguished road
Re: concrete class and abstract

what is concrete class and abstract class give their difference?


Concrete class is nothing but normal class, we can use as a base class or may not.Not compulsory, it can't contain abstract methods.we can create object and work with this class.

class Sample
{
public void MyMethod()
{..............}
}


Abstract class:- Abstract class is class which declared with a keyword Abstract,
Must be used as a base class.
Only intension to declare a abstract class is to use as a base class,that is we can't create object of this class like concrete class.
It can contain abstract methods as well as concrete(normal) methods.

public abstract class MyClass
{
public void MyMethod()
{..............}

public abstract TestMethod()
{
.........
}
}

Last edited by shilpa.c; 08-25-2009 at 04:09 AM.
Reply With Quote
  #3 (permalink)  
Old 08-25-2009
Expert Member
 
Join Date: May 2009
Location: Bangalore
Posts: 984
Thanks: 155
Thanked 420 Times in 201 Posts
rijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nice
Re: concrete class and abstract

Quote:
Originally Posted by dprakashraj View Post
what is concrete class and abstract class give their difference?
Hi Prakashraj,

Abstract class is a class that has no direct instances, but whose descendants may have direct instances.

There are case i which it is useful to define classes for which the programmer never intends to instantiate any objects; because such classes normally are used as bae-classes in inheritance hierarchies, we call such classes abstract classes

These classes cannot be used to instantiate objects; because abstract classes are incomplete. Derived classes called concrete classes must define the missing pieces.

Eg:

public abstract class Geek
{
//...Class implementation

public abstract member()
{

}
}


Concrete class is a normal class, Like,

public class Geek
{

public void method()
{
.....
}
}


Thanks & Regards,
Riju.
Reply With Quote
  #4 (permalink)  
Old 09-03-2009
Junior Member
 
Join Date: Sep 2009
Location: India, Durgapur
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Dipankar6868 is on a distinguished road
Re: concrete class and abstract

If a Class can be used to create object : then it will be Concrete Class
If a Class is not made for Object Creation : then it will be Abstract Class, but it must have a abstract method declaration inside it & without definition. ( If in a class there is a single Abstract function then, this class must be Abstract class)
Reply With Quote
  #5 (permalink)  
Old 09-03-2009
Junior Member
 
Join Date: Sep 2009
Location: new delhi
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
niteshsinha is on a distinguished road
Re: concrete class and abstract

any thing more
Reply With Quote
Reply

  Geeks Talk > Software Development > C#

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
can we use abstract method without using abstract class ? karthikeyan_ramaraj Java 5 2 Weeks Ago 05:20 AM
Difference between interface and abstract class? are they both same mahesh9920 OOPS 29 4 Weeks Ago 08:18 AM
Why ActionForm class is a abstract? timmireddy Java 0 07-09-2009 06:34 AM
HttpServlet abstract class chandra.mr Java 2 03-24-2008 02:55 AM
Abstract Class Situation Geek_Guest Java 7 10-24-2007 12:43 AM


All times are GMT -4. The time now is 11:44 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved