For an interface class, All methods in an interface must not have abstract access modifier

Options
- True
- False


CORRECT ANSWER : True

Discussion Board
rong answer

false is a correct answer because in interface all methods are coumplassary abstract.

Harshad 09-14-2016 12:54 PM

Inteface Class

The answer given above is misleading as by definition:

An interface is a collection of abstract methods. When a class implements an interface at that time the abstract methods of the interface are also inherited. It consists of the behaviours of the class that implements. It is very different from the class as the class consists of the methods and behaviours.

All the methods of the interface needs to be defined in the class unless the class that implements the interface is abstract.

1) An interface can consist of any number of methods and the bytecode of an interface appears in a .class file.
2)Interfaces are mostly seen in packages and the bytecode always matches the package name.
3)Interface can't be instantiated as it doesn't contain any constructors.
4) Methods of an interface are abstract as it can't contain instance field. And it can also extend multiple interfaces.

Rohit Sharma 08-13-2014 01:39 PM

incorrect answer

Methods in an interface (see the Interfaces section) that are not declared as default or static are implicitly abstract, so the abstract modifier is not used with interface methods. (It can be used, but it is unnecessary.)

so the correct answer is false!

Ciro 05-20-2014 02:37 PM

incorrect wording in the Question

" For an interface class, All methods in an interface must not have abstract access modifier " .

Kindly change the question from "must not have" to "need not have ".

Devikiran Ramadas 10-29-2013 03:17 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement