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

Explain the difference between extends thread vs implements runnable in java?

658


What is equlas() and hashcode() contract in java? Where does it used?

700


What is better - 'bit-shift a value' or 'multiply by 2'?

795


Which java ide is used the most?

602


What is the use of java?

623






What is the difference between overriding and overloading in OOPS.

661


What are computer functions?

582


What is oop in java?

611


What is preparedstatement in java?

664


State differences between C and Java?

756


What is instance means in java?

652


What are constants and how to create constants in java?

625


How do you add an element to a hashset in java?

574


Does isempty check for null?

665


What is the function of log?

627