In: Computer Science
Just give answer no need to explain
Which of the following are true about Interface?
An interface can have methods
An interface can have properties
An interface can have constructor
An interface can have fields
Which of the following are benefits of the Collection
Collection have builtin sorting facility
We have to manage memory of collections as we require.
Collections cannot be readonly or of fixed size.
1.
Which of the following are true about Interface?
a) An interface can have methods -- TRUE
b) An interface can have properties -- FALSE
c) An interface can have constructor -- FALSE
d) An interface can have fields -- TRUE
2.
Which of the following are benefits of the Collection?
a) Collection have builtin sorting facility -- TRUE
b) We have to manage memory of collections as we require. -- FALSE
c) Collections cannot be readonly or of fixed size. -- FALSE
A few brief comments:
1.
a) Interfaces can have methods. Although there will be no body of methods if they are not default.
b) Properties are instance variables. All variables declared inside the interface are static and final. They are constant and called fields.
c) Interface cannot have constructor.
d) Refer point (b)
2.
a) Collections have built in sorting facility.
b) Memory management is automatic in java
c) Collections can be made readonly.