0

programming languages Online Quiz - 279

Description: programming languages Online Quiz - 279
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0
  1. getInitParameterNames()

  2. getInitParameter(String name)

  3. getServletName()

  4. getServletContext()


Correct Option: B

Does File class have any method to read or write content in a file?

  1. True

  2. False


Correct Option: B

If there is an exception in finalize method, will the object be garbage collected?

  1. True

  2. False


Correct Option: B

byte b; final int a = 10; final int x = a; b = x; System.out.println("The value of b is " + b);

  1. Compilation error

  2. Runtime Error

  3. 10

  4. None of these


Correct Option: C

Which one of these statements are valid? Char \u0061r a =’a’; Char \u0062 = ’b’; Char c =’\u0063’Which one is not correct A. x = = Float.NaN B. Float.isNan(x); C. Myobject .equals(float.NaN);

  1. A

  2. B

  3. C

  4. All


Correct Option: D

main method can be overridden.. True/False

  1. True

  2. False


Correct Option: B

Which one is not correct A. x = = Float.NaN B. Float.isNan(x); C. Myobject .equals(float.NaN);

  1. A

  2. B

  3. Both

  4. None of these


Correct Option: B

Which is true about overloading?

  1. return type should be different

  2. access speciifer should be different

  3. arguments should be different

  4. the overloaded methods should throw a different excpetion


Correct Option: C

What is the rule regarding overriding methods throwing exceptions?

  1. Overriding method can not throw more generic exception than base method

  2. Overriding method can throw new or broader checked exceptions

  3. None of the above

  4. Both a and b


Correct Option: A

println exhibits which type of polymorphism

  1. Overloading

  2. Overriding

  3. Both 1 and 2

  4. Dynamic polymorphism


Correct Option: A

void main() { unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); }

  1. not same

  2. same

  3. unknown symbol ‘~’

  4. none of the above


Correct Option: B

f1(int c) { printf("%d", c); } void main() { int a=1; f1(a++); }

  1. 0

  2. 1

  3. 2

  4. 3


Correct Option: B

main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p\t%p\t%p",p,q,r); }

  1. 0001 0002 0003

  2. compile error

  3. 0001 0002 0004

  4. 0001 0002 0006


Correct Option: C
- Hide questions