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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
wHAT IS DEFAULT SPECIFIER IN JAVA
wHAT IS DEFAULT CONSTRUCTOR IN JAVA
wHAT IS DEFAULT METHOD IN JAVA
 Question Submitted By :: Anilsamal
I also faced this Question!!     Rank Answer Posted By  
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 1
obj

default constructor

main
 
Is This Answer Correct ?    3 Yes 14 No
Avnish Kumar Dubey
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 2
default specifier specifies access level of class
eg:-
class A{
}
this is default
default constructor is constructor with same name as of 
class and no arguments
eg: class A{
A()
}
there is no default method in java
 
Is This Answer Correct ?    16 Yes 3 No
Rohit
 
 
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 3
default specifier is private

default constructor is className(){}

there is no default method in java
 
Is This Answer Correct ?    4 Yes 11 No
Guest
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 4
default specifier is-default
default constructor
no default method
 
Is This Answer Correct ?    4 Yes 2 No
Renu
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 5
DEFAULT SPECIFIER IN JAVA:
There are 4 types of accessibility specifier in java, they
are private,public,protected and default.
There is no key word in java to specify default specifier 
When we do not specify any specifier which means default
specifier,

For Example :
 public String getName(){...} 
// here accessibility specifier  is public

 String getName(){...} 
// here accessibility specifier is defalut, whose scope    
is package-scope means this method is not accessible outside
the current package

DEFAULT CONSTRUCTOR IN JAVA:
Default constructor is the implicit constructor provided by
the compiler when we do not specify any constructor in our class
Default constructor looks like..
---------------------------------
<Access Modifier> <class_name>(){
super();// implicit super call
}

I have not heard about any default method in java..As far my
knowledge there is no default method till JAVA platform 1.4....
 
Is This Answer Correct ?    10 Yes 0 No
Debasankar
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 6
Default Specifier is : friendly. but there is no keyword 
provided by java

Default Construtor is : the constructor of top level super 
class of each java class that is "Object" class.

Default Method is : main method that would called by 
default through the java interpretor.
 
Is This Answer Correct ?    4 Yes 3 No
Devesh Dashora
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 7
DEFAULT SPECIFIER IN JAVA IS CALLED AS PACKAGE ACCESS

DEFAULT SPECIFIER IN JAVA IS CALLED AS CLASS NAME() WHICH 
WAS PROVIDED BY COMPILER DURING COMPILATION TIME

THERE IS NO DEFAULT METHOD IN JAVA
 
Is This Answer Correct ?    1 Yes 4 No
Sanjay
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 8
in java default specifier is public but within the 
samepackage.due to this property of public within same 
package we have to define public before the main method 
bcoz main has to be taken from jdk which is like the 
different package. So if we want to anythig accessing to 
the diffrent package we have to declare that with the 
public keyword explicitly. 

default constructor in java is same name of the class whose 
object has to be declared.
example
class v
{
public static void main(String vip[])
{
System.out.println("i am vip");
}
in this default constructor is v();

as much as i know ,there is no concept of default method
 
Is This Answer Correct ?    0 Yes 2 No
Vipin Dhiman
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 9
default specifier in java is DEFAULT
which can only be visible within the same package.
You can't access any default member of a class directly 
from outside the package ,  you can access those member 
through another method of that class.

default CONSTRUCTOR in java is the constructor which has 
the same name of the class and has no arguments. if you 
define at least one constructor in a class JVM will not put 
the default constructor in the class like..

public className(){super();}

if there is no constructor in the class JVM will put the 
default constructor in the class like..

public className(){super();}

since its not visible. but implicitly defined by compiler..


there is no concept of DEFAULT method in java spec.
 
Is This Answer Correct ?    2 Yes 1 No
Safikur
 
  Re: wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
Answer
# 10
DEFAULT SPECIFIER IN JAVA:
There are 4 types of accessibility specifier in java, they
are private,public,protected and default.
There is no key word in java to specify default specifier 
When we do not specify any specifier which means default
specifier,the default specifier  access the with in package
only. 
EX:- public void setName(String name)
     {
       this.name=name;
     }
 The above method access any class or any package
   void setName(String name)
     {
       this.name=name;
     }
The above method can access with in package.

DEFAULT CONSTRUCTOR IN JAVA:-
THE default constructor in java is System default constructor.

EX:-
public class A
{
   String name;
    public void setName(String name);
     {
       this.name=name;
     }
}
The above program their is no constructor .then that time
java compiler created default constructor.

Note: we can interested see default constructor frist we
compile java program(javac A.java) after javap A.Then that
time u watch system default constructor.

DEFAULT METHOD IN JAVA:--
The dafault method in java is super().
EX:-
public class A
{
  A()
  {
   System.out.println("IAM CONSTRUCTOR FROM CLASS A ");
  }
}
public class B extends A
{
B()
{
System.out.println("IAM CONSTRUCTOR FROM CLASS B");
}
public static void main(String k[])
{
 B b=new B();
}
}
output:-
IAM CONSTRUCTOR FROM CLASS A 
IAM CONSTRUCTOR FROM CLASS B
hence super() method is default method
 
Is This Answer Correct ?    0 Yes 0 No
Srinu
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Difference between Superclass and Subclass?  2
Is 'null' a keyword?  3
jdbc drivers? Wipro7
what is servlet filter?  1
transaction attributes ?  2
How 'java' got its name and what it stands for?  5
What is singleton class?  6
What is the root class for all Java classes?  4
C and C++ has constructors and distructors, why does Java does not have distructors? T3-Softwares1
what is difference between abstraction and interface? FIC6
What is dynamic binding?  2
What is a J2EE component? List out all the component? Adobe2
Explain Global variables in Packages?  2
What is casting? BMC3
What is the difference between C++ & Java? Syntel21
What is persistence ?  2
What is the importance in context in JDBC connection pools? iFlex2
what are depricated methods ? Satyam4
what is the use of abstract class? AMDOC2
What is the difference between getCodeBase and getDocumentBase methods?  1
 
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