473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

increasing the value of the variable that set to DataElement type

9
if a variable that set to DataElement type, how can we increase the value of that variable?

ex:

DataElement time;

if we use

int time,

we can increase the value like

time++;

if the type is DataElement,how can we increase its value?


---------------------------------------------------------------------------------------------------
DataElement class{

public abstract class DataElement {

public abstract boolean equals ( DataElement otherElement ) ;


public abstract int compareTo ( DataElement otherElement ) ;

public abstract void makeCopy ( DataElement otherElement ) ;

public abstract DataElement getCopy () ;

}


hope someone can help me..u could ask me for further details.tq.
Oct 25 '07 #1
2 1310
r035198x
13,262 8TB
if a variable that set to DataElement type, how can we increase the value of that variable?

ex:

DataElement time;

if we use

int time,

we can increase the value like

time++;

if the type is DataElement,how can we increase its value?


---------------------------------------------------------------------------------------------------
DataElement class{

public abstract class DataElement {

public abstract boolean equals ( DataElement otherElement ) ;


public abstract int compareTo ( DataElement otherElement ) ;

public abstract void makeCopy ( DataElement otherElement ) ;

public abstract DataElement getCopy () ;

}


hope someone can help me..u could ask me for further details.tq.
1.) Please use code tags when posting code.
2.) ++ operator is defined only for certaind datatypes like the primitive types. DataElement is your own defined data structure which you define your own rules for. e.g ++ for integers means (generally) increase the value by one. So you need to decide what increase the value of a DataElement means and then use a method to achieve that functionality.
Oct 25 '07 #2
taepy
9
thanks 4 the reply..
actually i've use this class to implement queue class.thanks again 4 the reply.
Oct 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: daniel | last post by:
This is a pretty basic-level question, but I'd really like to know, so thanks for any help or pointers you can provide (like what I would google for ;o) Suppose: <code> myFunc() {
24
by: ALI-R | last post by:
Hi All, First of all I think this is gonna be one of those threads :-) since I have bunch of questions which make this very controversial:-0) Ok,Let's see: I was reading an article that When...
8
by: Marc | last post by:
Hi! I'm calling a web service using C# and a wrapper class generated by wsdl tool. The web service specification contains some nillable parameters which types are Value Types in .NET (long, int,...
49
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.