Learn Java section 6/12


<In what way does your code behave incorrectly? Include ALL error messages.

when i click run the right side states false, never had this msg. Is that a good thing? I was asked to move one line to another, did and wasn’t correct then tried to make whitespace ect in different areas no dice. Tried also after getting and error message about boolean to use equal sign, last msg was false not sure what that means ie do I go on or rewrite line.


Replace this line with your code.

<do not remove the three backticks above>

Here is why you see false displayed when you run your program:

You first stored the value false in a variable called isFormatted.

boolean isFormatted = false;

Then you told Java to print that variable:


Do you see how that works now?

About the rest of your question, you are going to have to post a screenshot so that I can see what you see.

I only put the = false because in the error message it mentioned the boolean so I tried to make one to make the error go away. Initially I just dropped the is formatted portion to the 5th line like the instructions asked. Not sure at that point what I did wrong in correlation to what was asked of me.

So with your input are you stating that the equation is actually false? I am asking because it isn’t in red like an error, so is it still wrong? or is this response just stating what is being shown, a false statement?

Okay I get the part that I asked it to Print the isFormatted and if isFormatted=false then it should spit out false. I still however do not know how to input what the question/instructions are asking for.


I guess this is actually the right answer?

Yes, that is correct.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.