boolean doesn't set to true in Java

There are multiple syntactic problems with your code:

  • Two opening { after your main method header;
  • getMal() is the wrong case, it doesn’t match your method getmal() in AjaxR;
  • There is no closing brace for your controller class;
  • There is no closing brace for AjaxR either.

However, when those errors are fixed (I will leave that as an exercise for you to complete!), your code behaves as you expect – “Hello” is printed and stat is definitely set to true.

Browse More Popular Posts

Leave a Comment