GoConqr has a new look! Let us know what you think.

Quiz

java

rahul errabelly 30 questions

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (30)

  1. 1Which of the following are legal lines of Java code?
    1. int w = (int)888.8;
    2. byte x = (byte)100L;
    3. long y = (byte)100;
    4. byte z = (byte)100L;
    1. A1 and 2
    2. B2 and 3
    3. C3 and 4
    4. Dall are correct
  2. 2what will be the output of the program
    public class Test3
    { public static void main(String a[])
    { int x=10;
    for(int y=0;y<5;y++,x--)
    System.out.print(x+" , ");
    }
    }
    1. A10,9,8,7,6,
    2. B9,8,7,6,5,
    3. CCompilation fails
    4. DAn exception is thrown at runtime
  3. 3Which of these is an incorrect array declaration?
    1. Aint arr[] = new int[5]
    2. Bint [] arr = new int[5]
    3. Cint arr[][] = new int[5]
    4. Dint arr[] = int [5] new
  4. 4class While
    {public static void main(String a[])
    { int x=0;
    while(1) //line 6
    {
    System.out.print("x plus one is "+(x+1)); //line 8
    }
    }
    }
    Which statement is true?
    1. A(a)There is a syntax error on line 1
    2. BThere is a syntax error on line 6
    3. CThere is a syntax error on line 1,6& 8
    4. DNo Error
  5. 5what will be the output of the program?
    class Demo
    {
    public static void main(String a[])
    {
    int x=0;
    float y=10.0;
    System.out.println(x+" "+y);
    }
    }
    1. A0 10.0
    2. B0 10
    3. Ccompilation error
    4. D) run time error
  6. 6 Arrays in Java are implemented as?
    1. Aclass
    2. Bobject
    3. Cvariable
    4. Dnon of the above
  7. 7Which of these functions is called to display the output of an applet
    1. Adisplay()
    2. Bpaint()
    3. Cdisplayapplet()
    4. DpaintApplet()
  8. 815.What is the output of this program?
    class output
    {
    public static void main(String args[])
    {
    String a="hello i love java";
    System.out.println(indexof('i')+" "+indexof('o')+" "
    +lastIndexof('i')+" "+lastIndexof('o') ));
    }
    }
    1. A6 4 6 9
    2. B5 4 5 9
    3. C7 4 7 9
    4. D8 4 8 9
  9. 9What is the output of this program?

    class array_output
    {
    public static void main(String args[])
    {
    int array_variable [] = new int[10];
    for (int i = 0; i < 10; ++i)
    {
    array_variable[i] = i;
    System.out.print(array_variable[i] + " ");
    i++;
    }
    }
    }
    1. A0 1 2 3 4
    2. B2 3 4 5 6
    3. C0 2 4 6 8
    4. D8 7 6 5 4
  10. 10Which statement is true about java?
    1. ASequence dependent programming language
    2. Bcode dependent programming language
    3. CPlatform dependent programming language
    4. DPlatform independent programming language

Information

Description
Quiz on java, created by rahul errabelly on 19/01/2018.
Language
English
Views
3
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?