|
| ||||||||||
| Tags: java, multiply, programming language, variables |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Multiplying Variables in java
I program in java and so I use the best IDE for it, that it I use Eclipse IDE but the problem is that I am having a error on my varaible declaration line after I type every third line. Please check, I have posted it below Code: import java.math.*; . . . . . double cnt, energycnt, transRange; energycnt = cnt * Math.pow(transRange,2); |
|
#2
| ||||
| ||||
| Re: Multiplying Variables in java
Hi Please check the following code, this may help you. Code: public class sennode {
private int xcord;
private int ycord;
private double energyLevel;
public sennode(int xInit, int yInit, double newEnergy){
xcord = xInit;
ycord = yInit;
energyLevel = newEnergy;
}
double const = 0 ;
double energycnt = 0;
double transRange = 0;
energycnt = const * Math.pow(transRange,2);
} |
|
#3
| |||
| |||
| Re: Multiplying Variables in java
Hi Thanks for your help and your code. I have read your code in details but unfortunately that is not the problem for sure. May be you can try something different. Thanks again. |
|
#4
| ||||
| ||||
| Re: Multiplying Variables in java
Hi May be this code can help you Code: public class sensorNode {
private int xcord;
private int ycord;
private double energyLevel;
/**
* @param xInit the x-coordinate for node
* @param yInit the y-coordinate for node
* @param newEnergy the initial energy for node
*/
public sensorNode(int xInit, int yInit, double newEnergy){
xcord = xInit;
ycord = yInit;
energyLevel = newEnergy;
}
double const = 0 ;
double energycnt = 0;
double transRange = 0;
energycnt = const * Math.pow(transRange,2);
}
__________________ The FIFA Manager 2009 PC Game |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Multiplying Variables in java" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What are an Atomic Variables in Java? | Dilbert | Software Development | 5 | 04-01-2011 06:51 PM |
| About instance variables in java | Khaled11 | Software Development | 1 | 19-03-2010 02:38 PM |
| Java properties / variables dynamically | Miles Runner | Software Development | 5 | 04-03-2010 10:31 AM |
| What is Instance variables in Java? | Owen Fernandes | Software Development | 5 | 23-01-2010 07:27 AM |
| Java bans Global Variables | KALLIYAN | Software Development | 4 | 10-11-2009 03:17 AM |