What is a default package ?

Answers were Sorted based on User's Feedback



What is a default package ?..

Answer / niranjanravi

java.lang

Is This Answer Correct ?    15 Yes 4 No

What is a default package ?..

Answer / nithya

A default package is the package which is included
automatically when the class is created. One such example is
java.lang package.

Is This Answer Correct ?    11 Yes 2 No

What is a default package ?..

Answer / vishwanath

A default package is the package, which a java class
belongs to, when theres no explicit package statement like

package foo;

----------
eg:

This class below is set to belong to the default package.
class Foo
{

}

-------------
Design considerations:

Its not a good design choice though to have it this way,
a java class belonging to the default package

Reason:
1) Bad modularizing
2) problems with access specifiers arise
etc...

Is This Answer Correct ?    9 Yes 0 No

What is a default package ?..

Answer / praveen

The default java package is java.lang

Is This Answer Correct ?    5 Yes 4 No

What is a default package ?..

Answer / ravikiran(aptech mumbai)

java.lang

Is This Answer Correct ?    5 Yes 7 No

What is a default package ?..

Answer / indresh

java.lang is the default java package

Is This Answer Correct ?    3 Yes 5 No

What is a default package ?..

Answer / kanchan bangar

package is a collection of classes.
And default package is package in which classes are
included already.
we need not create the new package.
If we are enter only package name then all the classes in
that default package we can used.
example:-
default package:-java.lang

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More Core Java Interview Questions

in a constructor what happen if u call super and this in the same class? i know that it is not possible to call both in the same one? if we call what will happen?

10 Answers   ITC Infotech,


How many characters is 2 bytes?

0 Answers  


Is the milky way in a void?

0 Answers  


What is string in java is it a data type?

0 Answers  


What are parsing rules?

0 Answers  






jdbc drivers?

8 Answers   Wipro,


What is onClassLoader in java?

5 Answers   Cap Gemini,


What is the purpose of the main method?

0 Answers  


What is the abstract class?

0 Answers  


What is OOPS Concept?

1 Answers   Cap Gemini,


StringBuilder s = new StringBuilder("Hello Mom");s.append(",I mean,Mother"); Response.Write(s.ToString()); String s = "Hello Mom"; s+ = ",I mean Mom"; Response.Write(s); Which is faster ? which uses the most memory?

6 Answers   HCL,


Can a class have 2 constructors?

0 Answers  


Categories