wHAT IS DEFAULT SPECIFIER IN JAVA
wHAT IS DEFAULT CONSTRUCTOR IN JAVA
wHAT IS DEFAULT METHOD IN JAVA

Answer Posted / vipin dhiman

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 ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does java stand for?

786


What is the different between get and post?

726


What are three ways in which a thread can enter the waiting state in java programming?

909


When will you define a method as static?

801


What is function overriding and overloading in java?

809


Explain about field hiding in java?

716


What is meant by stack and queue?

779


Which method cannot be overridden in java?

801


How to restrict a member of a class from inheriting by its sub classes?

1079


What makes a function well defined?

771


Can an interface have a class?

759


How do I get 64 bit java?

716


Is age a discrete variable?

735


Why parsing is done?

740


How to change value in arraylist java?

751