Search the Whole World Here.,.,

Q2. Consider the following code snippet:

Q2. Consider the following code snippet:


int number = 14;

if (number >= 10;

{      

    if (number  == 10)         

                jLabel1.setText("first string");      

    else               

               jLabel1.setText("second string");    

                 jLabel2.setText("third string");

}


What will be the output of the following code snippet:

Q1.  Identify the error(s) in the following code  fragment

Q1. Identify the error(s) in the following code fragment



switch(ch)
{
    case 'a':
    case 'A':
    case 'e':
    case 'E':
    case 'i':
    case 'i':
    break;
 
    default :  ch = 'N';
    break;
}


Comment your answers fast......
Give me your answers.....


In the above code fragment errors are:

i)  The variable ch is uninitialised.
ii) The switch statements two case constants are
     identical : case 'i' and case 'i'.
     The case constant must have different value.

Ads by Google