jeudi 30 novembre 2017

Why I am getting compile time error as 'else' without 'if'. Can anyone explain me with detail

Why I am getting compile time error as 'else' without 'if'. Can anyone explain me with detail

class Test
    {
        public static void main(String[] args)
        {
            if(false)
                if(true)
                    if(false)
                    else
                        System.out.println("1");
                else
                    System.out.println("2");
            else
                System.out.println("3");
        }
    }

Aucun commentaire:

Enregistrer un commentaire