Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java 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)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

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 us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-10-2007, 05:50 AM
Member
 
Join Date: Nov 2007
Posts: 36
Shaolin is on a distinguished road
Java terms
Hi Guys,

I need some help defining some java terms. I've been reading up on them but I still cant get my head around some of them and would like someone to explain it in real simple terms with some examples please.

1. Object
2. reference (e.g. references to objects)
3. instance
4. What is the purpose of an abstract class?
5. container
6. packages test;
7. import test.*;
8. Polymorphism
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-22-2007, 04:36 AM
CaptainMorgan's Avatar
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 841
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
What exactly are you confused or unclear about? Your list contains some of the fundamentals of OOP and Java language basics. While reading up on them is good, you've haven't shown an attempt at discussing or displaying your understanding of these terms. Make an attempt to discuss your list items by focusing on the first one and if you have specific questions pertaining to the concept you're discussing or an example you're willing to show, then I'm sure you'll be answered.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-27-2007, 07:02 PM
gibsonrocker800's Avatar
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
While i agree with CaptainMorgan that you should attempt these things on your own, i want to explain the purpose of abstract classes because it was a hard concept for me to grasp at first.

The purpose of an abstract class is to force one to extend that class if they want to construct an object of that type. For example, say i had a class:

public abstract class BankAccount {}

If i wanted to have a BankAccount in another program, i could not simply say:
BankAccount account = new BankAccount();

Due to the fact that this class is abstract, if i want to use it, i must make a class that extends it. So for example:
public class SavingsAccount extends BankAccount {}

Now, i can say BankAccount account = new SavingsAccount(); (i'm pretty sure, not completely positive on the BankAccount portion of the line).

So, the purpose of doing this, is to make a class with general information that cannot stand alone, it must be further specified, but it has the basic info. An example that i just thought of, that would work well as an abstract class is a Weapon class for a video game. It defines general things like ammo and stuff like that, but in my main game class, i cannot define a general Weapon, i must make a more specific class that extends Weapon.

So yeah, the rest are pretty easy to understand, and if you can't understand Objects and references, i wouldn't be worrying about abstract classes and polymorphism yet, first grasp the basic concepts, and then move on to more advanced topics.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


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

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



All times are GMT +3. The time now is 03:52 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org