ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
Can we instantiate Interfaces?
 Question Submitted By :: Manoj Pandey
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Can we instantiate Interfaces?
Answer
# 1
No we can instantiate interface directly.but we can create
instantiate  of interface in directly

interface i1
{
    public void wish();
}
public class A implements i1
{
   public static void main(string...arg)
   {
      i1 o1=new A();
         o1.wish();
    }
 public void wish()
{
  System.out.println("we can create instantiate in directly");
}
}
 
Is This Answer Correct ?    10 Yes 0 No
Paletipatisrinu
 
  Re: Can we instantiate Interfaces?
Answer
# 2
no we can not.
 
Is This Answer Correct ?    2 Yes 2 No
Guest
 
 
 
  Re: Can we instantiate Interfaces?
Answer
# 3
answer no 1. is correct programatically but actually
instantiates means obtain the behavier of object we can do
this only by creating object of class ,object has state and
behaviour, in answer 1,we transfer state first and then
write behaviour in the class,then instantiate that class ie
like dynamic method dispatch.means therotically we can not
instantiate Interfaces
 
Is This Answer Correct ?    0 Yes 0 No
Dhawal
 
  Re: Can we instantiate Interfaces?
Answer
# 4
You can only create a reference of an interface but cannot 
instantiate.
 
Is This Answer Correct ?    1 Yes 0 No
Divya
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
84. try { 85. ResourceConnection con = resourceFactory.getConnection(); 86. Results r = con.query(”GET INFO FROM CUSTOMER”); 87. info = r.getData(); 88. con.close(); 89. } catch (ResourceException re) { 90. errorLog.write(re.getMessage()); 91. } 92. return info; Which is true if a ResourceException is thrown on line 86? 1 Line 92 will not execute. 2 The connection will not be retrieved in line 85. 3 The resource connection will not be closed on line 88. 4 The enclosing method will throw an exception to its caller.  1
what is Portal(web based online portal)? AIG1
basic difference b/w ALL types of JDBC driver. Systematix1
what is the Use of throws exception?  2
can you program for reverse string? IBM5
How to create an instance of a class if the class has private constructor?  2
Can an unreachable object become reachable again?  3
whst is encapsulation?when u encpsulate actually while devoloping code? AMDOC5
primitive data types in Java ?  3
What is CardLayout? Infosys1
Default layout of panel and frame?  2
Hi Friends, Can u give few interview questions which relates ArrayList and Hashmap. I mean how to link ArrayList and HashMap.I know this is not good way of asking questions like this , but i need Microsoft1
how can u apply shallow cloning and deep cloning to create object? Yash-Technologies1
Why are the methods of the Math class are static?  1
Marker interface means , interface which has no methods.Then what is the necessity of its usage.I read "it tells the compiler that it should be treated differently ". "It is used to store state of an object". But still am not clear.Please explain clearly.  1
Can a for statement loop indefinitely?  3
Explain Public static void main?  2
String is an immutable object. Then how can the following code be justified. String s1 = ?ABC?; String s1 = s1+?XYZ?; s.o.p(s1); The output is ABCXYZ, which is the value of s1 ? Flextronics5
string is immutable? right every one knows that, my question is it advantage or disadvantage making string immutable? HCL4
what is ejb? what is the importance of ejb? Photon1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com