‹ Back to the paper
Question 50
2 marks
Computer ScienceISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024)Case basedProgramming in Java (Review of Class XI Sections B and C)
Answer the following questions.
State the purpose of the following keywords in Java: package import
State the purpose of the following keywords in Java:
(a)[1]
package
(b)[1]
import
Answer
Answer (a)
package: it groups related classes and interfaces together under one namespace, making them easier to organise, locate, reuse and avoid naming conflicts.
Answer (b)
import: it is used to bring a class (or all classes) of a package into a program so that its members can be used without writing the fully qualified name each time.