October 09, 2013

Core Java Interview Questions And Answers



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

  • Blogger news

    This Blog Contains All Topics Related To Internet, Website Help, Interview Questions, News, Results From Various Resources, Visit Daily For More Interesting And Famous Topics.
  • Random Post

  • About

    We Provide All Information Which you Needed. We Maintain This Blog Very Carefully, If You Find Any Mistake or Any Suggestions Then Please Let Us Know, You Can Contact Us By Comments, On FB Page Or On Google+ Page. ~ Thank You