0

Java Programming Language Quiz - 4

Description: Java Programming Language Quiz - 4
Number of Questions: 9
Created by:
Tags: java
Attempted 0/9 Correct 0 Score 0

A method is defined in a class as : void processUser(int i) { } If this method is overriden in a sub class,_

  1. the new method should return int

  2. the new method can return any type of values

  3. the argument list of new method should exactly match that of overriden method

  4. the return type of new method should exactly match that of overriden method


Correct Option: C
  1. The element will be successfully added

  2. ArrayIndexOutOfBounds Exception

  3. The Vector allocates space to accommodate up to 15 elements

  4. none of these


Correct Option: A,C
  1. Thread

  2. Runnable

  3. Both of these

  4. none of these


Correct Option: B

Which is true about a method-local inner class?

  1. It must be marked final

  2. It can be marked abstract

  3. It can be marked public

  4. It can be marked static


Correct Option: B
  1. It can extend exactly one class and implement exactly one interface

  2. It can extend exactly one class and can implement multiple interfaces

  3. It can extend exactly one class or implement exactly one interface

  4. It can implement multiple interfaces regardless of whether it also extends a class

  5. It can implement multiple interfaces if it does not extend a class


Correct Option: C
  1. The java command can access classes from more than one package, from a single JAR file.

  2. JAR files can be used with the java command but not with the javac command.

  3. In order for JAR files to be used by java, they MUST be placed in the /jre/lib/ext sub-directory within the J2SE directory tree.

  4. When a part of a directory tree that includes subdirectories with files is put into a JAR file, all of the files are saved in the JAR file, but the subdirectory structure is lost.


Correct Option: A
  1. X extends Y is correct if and only if X is a class and Y is an interface

  2. X extends Y is correct if and only if X is an interface and Y is a class

  3. X extends Y is correct if X and Y are either both classes or both interfaces

  4. X extends Y is correct for all combinations of X and Y being classes and/or interfaces.


Correct Option: C
- Hide questions