Thursday, 28 February 2013

A int And boolean type is incaptible in java

we know that java take all its syntax from c but in c this program works but not in java
class Demo
{
  
  public static void main(String... S)
   {
     boolean x=1;
     while(x)
     {
      
       System.out.println("program is correct");
      }
      System.out.println("not good");
    }
}


this will give compilation error and said int are not campatble with boolean in java why?

1 comment: