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

What is a class component?

0 Answers  


What is the advantage of preparedstatement over statement?

0 Answers  


What is the use of inner class?

0 Answers  


What is meant by Servelet? What are the parameters of service method?

2 Answers  


Which variables are stored in heap?

0 Answers  






What is a jagged array in java?

0 Answers  


How to find the given number is a prime number or not by getting input from the user

0 Answers  


What defines function?

0 Answers  


Which sort is best in java?

0 Answers  


What is the difference between preemptive scheduling and time slicing in java programming?

0 Answers  


Can a class declared as private be accessed outside it’s package?

0 Answers  


How java is similar to c?

0 Answers  


Categories