Adding 2 object fields
I'm trying to add two object fields and assign the total
int sum = ((objmilli.millimeters) + (objcenti.centimeters));
I keep getting an error. Can you tell me what's wrong with
my syntax ?
Re: Adding 2 object fields
Can you give me a little more info? What is the compile error, and what are
the declared data types of the two object members you are trying to sum?
Also, I presume you have actually instantiated the two objects in question?
(Perhaps posting the entire method body code would help).
DevX Section Leader
"Pete" <java.@127.0.0.1> wrote in message news:firstname.lastname@example.org...
> I'm trying to add two object fields and assign the total
> to sum:
> int sum = ((objmilli.millimeters) + (objcenti.centimeters));
> I keep getting an error. Can you tell me what's wrong with
> my syntax ?
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL