Computing.Net > Forums > Programming > About Java!! Need Help!

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

About Java!! Need Help!

Reply to Message Icon

Name: Jeff
Date: October 24, 2002 at 09:42:05 Pacific
OS: win98
CPU/Ram: 256
Comment:

Can Somebody tell me that how can i use "abstract" with OOP concept in JAVA??Can give any examples??? eg.if i'm straight forward using the variables from the database,then how can i still using the "abstract" concept?? Examples plz....



Sponsored Link
Ads by Google

Response Number 1
Name: Marcus
Date: October 24, 2002 at 20:30:12 Pacific
Reply:

Hi!

The keywork abstract is to define a class or methods within a class that has no implementation.

This is used for inheritance where the abstract method or class have to be implemted when inherited.

A classical example of inheritance is the shape class.

The shape is an abstract entitity, a shape is just a shape.

but all shapes have common attributes, such as a center, the abillity to be rotated, the area, etc.

All shapes define this operations differently , hence they need different implementations. e.g. a circle calculates it's area differently than a square.
This is where abstract comes in.
If a method is defined abstract
in the base class it has to be redefined,
in it's childclasses.

Not sure what you mean by using variable from a database..

/Marcus



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: About Java!! Need Help!

Need help with JAVA www.computing.net/answers/programming/need-help-with-java/4465.html

I need help about vb 6.0 www.computing.net/answers/programming/i-need-help-about-vb-60/5404.html

Need help with a Java Program www.computing.net/answers/programming/need-help-with-a-java-program/12412.html