Languages-Java [3i Infotech Placement]: Sample Questions 48 - 49 of 141

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 48

Edit

Describe in Detail

Essay▾

What is a JAR file?

Explanation

Understanding of JAR File
  • “JAR” stands for java Archive.
  • It is a file format based on the popular ZIP file format and used for aggregating many files into one.
  • A JAR file is contains compressed version of class files, audio file, image files- as an aggregation of resources into a single, compressed file.

Question 49

Appeared in Year: 2004

Question

MCQ▾

If this method is overridden in a sub class, ________

Choices

Choice (4)

a.

The new method can return any type of values

b.

The argument list of new method should exactly match that of overridden method

c.

The return type of new method should exactly match that of overridden method

d.

Both b. and c. are correct

Answer

d.

Explanation

  • The overriding method has the same name, number and type of arguments, and return value as the method it overrides. (return type of a subclass can be a subclass of the return type of its superclass) .
  • Overriding method can have different throws clause if it doesn՚t specify any types not specified by the throws clause in the overridden method.
  • The access specifier for the overriding method can allow more but not less access than the overridden method. For example, a protected method in the superclass can be made public but not private.

Developed by: