aspose file tools
The moose likes Beginning Java and the fly likes How can I initialize the variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How can I initialize the variable?" Watch "How can I initialize the variable?" New topic
Author

How can I initialize the variable?

Aroma Karim
Greenhorn

Joined: Nov 01, 2012
Posts: 24

--------------------Configuration: <Default>--------------------
C:\cccc.java:184: variable c might not have been initialized
Result.setText(Float .toString(ExpectedValue( c)));
^
Note: C:\cccc.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

Process completed.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9939
    
    6

So here is one of your methods:

What do you mean to be passing in to the ExpectedValue() method?


Never ascribe to malice that which can be adequately explained by stupidity.
Aroma Karim
Greenhorn

Joined: Nov 01, 2012
Posts: 24
fred rosenberger wrote:So here is one of your methods:

What do you mean to be passing in to the ExpectedValue() method?

yes that's right !
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9939
    
    6

What do you mean by "Yes, that's right"?

'c' is a local variable to your method. Local variable do not get initialized automatically. So you have to do something like

float c = 0;

or

float c = 234.837;

or

float c = -2323.43432;

But we can't help you more than that, since we have NO idea what c is supposed to represent.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: How can I initialize the variable?
 
Similar Threads
Action Listener
Run Time Error
Displaying an image in a set location in an applet
Check Boxes
How to make the window (JPanel?) bigger in gridbaglayout