File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I initialize the variable?

 
Abeer El-shaer
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

--------------------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
Pie
Posts: 12020
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So here is one of your methods:

What do you mean to be passing in to the ExpectedValue() method?
 
Abeer El-shaer
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 12020
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic