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
What is a method in java?
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?
How do you check if a number is a perfect square?
What is method reference in java?
What is the symbol for line break?
What is variable declaration and definition?
Name four container classes.
Can we inherit inner class?
How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?
How do you read and print a string in java?
What is a Transient Object?
Explain about class in java?
How many techniques can be employed to create a string object?
Differentiate between overriding and overloading cases?
What are the legal parameters?