• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Java | Packages | Question 1

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. 

(A)

Only 1, 2 and 3

(B)

Only 1, 2 and 4

(C)

Only 4

(D)

Only 1 and 3

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments