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 are the differences between stringbuffer and stringbuilder?

547


How many bytes is a unicode character?

515


What do you mean by object?

554


Can we use String with switch case?

675


What is a text string?

631






What is static data type in java?

547


What is nextint java?

551


Why can't we use static class instead of singleton?

505


What is the advantage of functional interface in java 8?

531


What is the basic of java?

575


Why constructor has no return type?

640


Are global variables initialized to zero?

517


What are different types of constants?

525


What is a lambda expression ? What's its use ?

569


What is the method overriding?

624