Click here to Skip to main content
15,907,328 members
Home / Discussions / Java
   

Java

 
AnswerRe: Android Pin
DaveAuld8-Oct-10 8:52
professionalDaveAuld8-Oct-10 8:52 
QuestionOracle Driver problem Pin
itsh117-Oct-10 18:36
itsh117-Oct-10 18:36 
AnswerRe: Oracle Driver problem Pin
Richard MacCutchan7-Oct-10 22:30
mveRichard MacCutchan7-Oct-10 22:30 
AnswerRe: Oracle Driver problem Pin
David Skelly8-Oct-10 1:45
David Skelly8-Oct-10 1:45 
Questionhelp in j2me Pin
allaa2507-Oct-10 5:10
allaa2507-Oct-10 5:10 
AnswerRe: help in j2me Pin
Gerben Jongerius7-Oct-10 7:13
Gerben Jongerius7-Oct-10 7:13 
QuestionSimple Java Problem Pin
andyjin77776-Oct-10 17:55
andyjin77776-Oct-10 17:55 
AnswerRe: Simple Java Problem Pin
Cedric Moonen6-Oct-10 20:33
Cedric Moonen6-Oct-10 20:33 
There's really a lot of things which are wrong with your code:
1) To calculate the sum, you add a and B, but they were never assigned any value except 0. And 0 + 0 is 0.
2) B doesn't exist, you declared b. So your program shouldn't even compile (I guess this is a typo error)
3) showInputDialog returns a string. You have to parse the string in order to extract the two values needed for the sum. But what if the user enters something else than a sum (like garbage text). You never check if the string is valid.
4) In fact you try to parse the string and store the result in F but it doesn't work this way: your string is not a double, because it contains a "+". So, first thing to do is to tokenize the string in order to retrieve the two operands.

Please, next time you have to post code, use the pre tags it makes the code much more readable (as explained in the posting guidelines that I suggest you to read).
Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

AnswerRe: Simple Java Problem [modified] Pin
SinghUlarity...8-Oct-10 5:54
SinghUlarity...8-Oct-10 5:54 
GeneralRe: Simple Java Problem Pin
SinghUlarity...8-Oct-10 6:00
SinghUlarity...8-Oct-10 6:00 
QuestionMessage Removed Pin
5-Oct-10 8:32
vivek8865-Oct-10 8:32 
AnswerRe: JAVA program to check please answer Pin
Dr.Walt Fair, PE5-Oct-10 11:19
professionalDr.Walt Fair, PE5-Oct-10 11:19 
GeneralRe: JAVA program to check please answer Pin
vivek8865-Oct-10 23:02
vivek8865-Oct-10 23:02 
AnswerRe: JAVA program to check please answer Pin
Richard MacCutchan5-Oct-10 11:35
mveRichard MacCutchan5-Oct-10 11:35 
GeneralRe: JAVA program to check please answer Pin
vivek8865-Oct-10 23:02
vivek8865-Oct-10 23:02 
GeneralRe: JAVA program to check please answer Pin
Richard MacCutchan5-Oct-10 23:06
mveRichard MacCutchan5-Oct-10 23:06 
GeneralRe: JAVA program to check please answer Pin
vivek8865-Oct-10 23:32
vivek8865-Oct-10 23:32 
GeneralRe: JAVA program to check please answer Pin
TorstenH.6-Oct-10 0:11
TorstenH.6-Oct-10 0:11 
GeneralRe: JAVA program to check please answer Pin
vivek8866-Oct-10 0:12
vivek8866-Oct-10 0:12 
GeneralRe: JAVA program to check please answer Pin
Richard MacCutchan6-Oct-10 0:20
mveRichard MacCutchan6-Oct-10 0:20 
GeneralRe: JAVA program to check please answer Pin
TorstenH.6-Oct-10 2:02
TorstenH.6-Oct-10 2:02 
GeneralRe: JAVA program to check please answer Pin
David Crow7-Oct-10 9:58
David Crow7-Oct-10 9:58 
AnswerRe: JAVA program to check please answer Pin
Luc Pattyn5-Oct-10 11:59
sitebuilderLuc Pattyn5-Oct-10 11:59 
GeneralRe: JAVA program to check please answer Pin
vivek8865-Oct-10 22:52
vivek8865-Oct-10 22:52 
GeneralRe: JAVA program to check please answer Pin
Nagy Vilmos5-Oct-10 23:15
professionalNagy Vilmos5-Oct-10 23:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.