• Post Reply Bookmark Topic Watch Topic
  • New Topic

boolean statements  RSS feed

 
N Kol
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a big time error trying to get this boolean thing to work:



I am totally lost.
I need it to show true if the answer is abridged, and false if unabridged.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply stating "I get a big time error" doesn't really help us help you. WHAT exactly is the error? Is it when you try to compile or when you run it? If it's a compiler error, what is the exact text of the error? If it's during run-time, what exactly is it doing wrong - what do you expect to happen, and what actually does happen?
 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To add to Fred's comment..

you might want to check: isAbridged is not equal Abridged.

I am guessing so you need to explicitly explain the problem.

Gary
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
Please use the code button to post code, and make sure it is correctly indented. Since you are new, I have edited one of your posts, and you can see how much better it looks. But it shows an indentation error.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
replace the above line

with


and place
boolean abridged;

somewhere above this method...

 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think by doing that also your problem will not get resolved..
Please post a complete class.so that we can help you out in a better manner..
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It all depends how many booleans you have meaning abridged. It is usual to have a field called abridged and methods called setAbridged() and isAbridged(). See this PDF §8.3, page 55.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!