Welcome to Dream.In.Code
Become a Java Expert!

Join 149,497 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,362 people online right now. Registration is fast and FREE... Join Now!




polymorphism and arrays

 
Reply to this topicStart new topic

polymorphism and arrays

Mathiza
19 Mar, 2007 - 05:47 AM
Post #1

New D.I.C Head
*

Joined: 8 Feb, 2007
Posts: 7


My Contributions
thi is what i have so I don'y know whether I should write my calculating method in my classes that implements my interface and should I write my calculation method coz that is the only problem that is holding me back??
[code]
public abstract class Measurement
{
private int value;
protected String symbol;

/**
*Measurement's two argument construtor
*@ param integer value and protected string.
*/
public Measurement(int v, String s)
{
value = v;
symbol = s;
}
//set the value.
public void setValue(int v)
{
value = v;
}
/**
*method getValue
*@ return Returns an integer.
*/
public int getValue()
{
return value;
}
//set symbol.
public void setSymbol( String s)
{
symbol = s;
}
/**
*method getsymbol
*@ return Returns a string.
*/
protected String getSymbol()
{
return symbol;
}
//returns objects to measurement
public String toString()
{
return String.format("Measurement:",getValue(),getSymbol());
}
public abstract int isThermal();


}
==============================
public interface ImperialConvertable
{
int getConvertToF();
}
========================
public interface MetricConvertable
{
int getConvertTok();
}
========================================
public class Celsius implements ImperialConvertable
{

}
============================
public class fahrenheit implements ImperialConvertable
{

}
======================
public class Delisle implements ImperialConvertable
{

}
==============================
here is my question below


Attached File(s)
Attached File  The_South_African_Weather_Service.doc ( 28.5k ) Number of downloads: 24
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 06:12PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month