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.
Java-Cannot convert double to class
Name: Dado Date: February 14, 2005 at 15:25:49 Pacific OS: WinXP CPU/Ram: 1GB
Comment:
I created a method for adding complex numbers that should return a value of type NameOfaClass. I also have two instance variables declared of type double (real and imaginary). The method is called from another class.: public NameOfaClass sum(NameOfaClass number) { NameOfaClass somevalue = number; return (somevalue.real+this.real)+(somevalue.imaginary+this.imaginary); } I get an error however saying that a double type cannot be converted to NameOfaClass type. Can anyone suggest how I could calculate this and return a value of type NameOfaClass? Do I need to create a new object of type NameOfaClass and somehow return the desired value? Help is greatly appreciated!
Summary: Hi: I am a newbie trying to learn C++. Our instructor gave us several assignments already and I am struggeling with the last one. Here are the instructions: Write a C++ program that calculates exact c...
Summary: I have a program which im writing that will count up ip addresses starting from 1.0.0.1. Each octet of the ip address is assigned as an int. ie int oct1, int oct2 I then want to assign these 4 values ...
Summary: Hi, I've worked on doing an application in java to convert celsius to fahrenheit and visa-versa but it's not compiling and i can't seem to solve the errors. If anyone has a chance to take a look here'...