What is a default package ?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is the purpose of assert keyword used in jdk1.4.x?
How big is a 32 bit integer?
What is a pointer and does java support pointers?
Explain the difference between transient and volatile in java?
What is an object class?
Which is better stringbuilder or stringbuffer?
What is "finally" keyword?
Tell me about your ability to work under pressure
Can you explain the cs option of java interpreter?
What are the 3 types of control structures?
How can we make sure main() is the last thread to finish in java program?
Explain restrictions on using enum?