Question- Can there be an abstract class with no abstract methods
in it?
Answer- Yes
Question- Can an Interface be final?
Answer- No
Question- Can an Interface have an inner class?
Answer- Yes.
public interface abc {
static int i=0;
void dd();
class a1 {
a1() {
int j;
System.out.println("in interfia");
};
public static void main(String a1[]) {
System.out.println("in interfia"); } } }
Question- Can we define private and protected modifiers for
variables in interfaces? (Core Java)
Answer- No
Question- What is Externalizable?
Answer- Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out) and readExternal(ObjectInput in)
Question- What modifiers are allowed for methods in an Interface?
Answer- Only public and abstract modifiers are allowed for methods in interfaces.
0 comments:
Post a Comment