Level 11 Do not declare any variables


#1

compare two boolean values as unassigned variables


#2

I'm looking at exercise 11, I see this instruction:

Use any equality operator to directly compare two boolean values. Do not declare any variables.

Did you choose an equality operator?
Which two Boolean values did you decide to compare?


#3

int myint=10;
char mychar='A';
System.out.println(mychar != myint);


#4

Are you asking for help?


#5

am having problems with leavel 11


#6

Just to make sure that I'm looking at the same exercise that you are, it this the task that you are trying to accomplish:

Use any equality operator to directly compare two boolean values. Do not declare any variables.


#7

yes that is the one..


#8

the program gives me a value false but dose not take me to the next leavel12


#9

Okay, good. Let's look at the code that you posted.

int myint=10;
char mychar='A';	
System.out.println(mychar != myint);

Do you see how the task says "Do not declare any variables."? What you did in your first two lines of code is declare two variables. -- those lines will have to go.

Now, looking at your println, you did pick a good equality operator, now you have to pick two Boolean values -- there are only two of those to choose from (true and false) so it won't take you long. :smile:


#10

i did this System.out.println(true==false) but its still not working.


#11

Did you remove the other two lines too?


#12

yes i did. but its still not working.


#13

Try these, if the first one works, don't do the second one:

  1. reload/refresh the web page
  2. use the Reset this Exercise option under Get Help

#14

just did that, and is still not working.


#15

Well, darn.

Can you post a screenshot of your whole web page please?


#16


#17


#18

Well, I can't see anything wrong there. A couple more, grasping at straws, suggestions:

  • go back one exercise and try the reset again
  • if you have one, try a different web browser

#19

hey i opened a new account but the problem is still occurs.


#20

Try a different browser like google chrome