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 is a method in java?

745


There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?

1261


How do you check if a number is a perfect square?

765


What is method reference in java?

830


What is the symbol for line break?

872


What is variable declaration and definition?

773


Name four container classes.

769


Can we inherit inner class?

750


How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?

819


How do you read and print a string in java?

740


What is a Transient Object?

847


Explain about class in java?

864


How many techniques can be employed to create a string object?

814


Differentiate between overriding and overloading cases?

821


What are the legal parameters?

730