in Java retagged by
1 vote
1 vote

Which of the following is/are true about packages in Java? 

  1.  Every class is part of some package.
  2. All classes in a file are part of the same package.
  3. If no package is specified, the classes in the file go into a special unnamed package.
  4. If no package is specified, a new package is created with folder name of class and the class is put in this package.
  1. Only $1,2$ and $3$
  2. Only $1,2$ and $4$
  3. Only $4$
  4. Only $1$ and $3$
in Java retagged by

1 Answer

1 vote
1 vote
Except 4 rest all are correct. Package name is same as path name if its unspecified, it doesn't depend on class name.

So A is correct.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true