05/03/25 ----------- Q)What is autoboxing? =>Implicit conversion of primitive type to wrapper type is known as autoboxing. Q)What is auto-unboxing? =>Implicit conversion of wrapper type to primitive type is known as auto-unboxing. Note:- JDK 1.5 onwards autoboxing and auto-unboxing feature introduced. For eg. class AutoBoxingUnboxing{ static int x(Integer i){ int sum=10+i;//auto-unboxing return sum; } public static void main(String[] args) { int a=40; System.out.println(x(a));//autoboxing } } Q)What is a package in Java? =>A package is a grouping mechanism in which, related class files are grouped and made available to other applications or other parts of the same application. Note:- A package in Java is equivalent to folder/directory in OS's file system. =>Always a Java class file(class/interface) should belong to a package. =>We have two kinds of packages. 1)user defined packages(Our own project's class files are grouped here) 2)built-in packages(library class files are grouped here) =>Some examples of built-in packages. 1)java.sql 2)java.io 3)java.util 4)java.lang etc. =>A realtime Java project is divided to some partitions(layers). For eg. 1)data access layer(database communication classes) 2)service layer (data processing classes) Note:- Each layer's java classes are grouped into a user defined package. For eg. com.hdfc.dao com.hdfc.service com.hdfc.exception Q)How to create a user defined package in Eclipse IDE? =>by using package statement. for eg. package in.ashokit.exception; public class AccountNotFoundException extends Exception{ } Q)How to make a class available to a Java application? =>by using import statement. For eg. package in.ashokit.service; import in.ashokit.exception.AccountNotFoundException; public class Account{ public void withdraw() throws AccountNotFoundException{ } } Note:- package statement should be the first non comment statement in a Java source file.