Java is using java.lang as the default package.All the basic functionality for writing a simple java program are there written in the form of classes and interfaces and also designed some of the possible and probable exception and error raised while compiling and executing programs. Here i am categorizing all the exception, error , abstract class , final classes, interfaces etc....

Classes in java.lang packages


List of Abstract Interfaces (1)

CharSequence

List of Abstract classes (5)

AbstractStringBuilder

ClassLoader

Enum

Number

Process

List of Final classes (18)

Boolean 

Byte

Character

Class

ConditionalSpecialCasing

Double

Float

Integer

Long

Math

ProcessBuilder

ProcessEnvironment

ProcessImpl

Short

String

StringBuilder

StringBuffer

System


List of Classes (18)

CharacterData00

CharacterData01

CharacterData02

CharacterData0E

CharacterDataLatin1

CharacterDataPrivateUse

CharacterDataUndefined

Error

Exception

Object

Runtime

SecurityManager

Shutdown

StringCoding

Thread

ThreadGroup

ThreadLocal

Throwable

List of Exception Classes (25)

ArithmeticException

ArrayIndexOutOfBoundsException

ArrayStoreException

ClassCastException

ClassNotFoundException

CloneNotSupportedException 

EnumConstantNotPresentException

IllegalAccessException

IllegalArgumentException

llegalMonitorStateException

IllegalStateException

IllegalThreadStateException

IndexOutOfBoundsException

InstantiationException

InterruptedException

NegativeArraySizeException

NoSuchFieldException

NoSuchMethodException

NullPointerException

NumberFormatException

RuntimeException

SecurityException

StringIndexOutOfBoundsException

TypeNotPresentException

UnsupportedOperationException


List of Error Classes (18)

AbstractMethodError

AssertionError

ClassCircularityError

ClassFormatError

ExceptionInInitializerError

IllegalAccessError

InstantiationError

InternalError

LinkageError

NoClassDefFoundError

NoSuchFieldError

NoSuchMethodError

StackOverflowError

UnknownError

UnsatisfiedLinkError

UnsupportedClassVersionError 

VirtualMachineError

VerifyError 



Java Packages is the collection of pre-defined classes interfaces and thus all these classes contains both the implemented and non-implemented methods. Java is using java.lang package as the default package. Below are the list of some of the packages in java.

java.lang package

java.util package

java.io package

java.math package

java.rmi package

java.sql package

A java package is the collection of similar types. After Writing all the required pre-defined classes in java, those are being categorized in different categories and hence are termed as packages. For ex-

java.lang packages contains all the basic operations which are required for writing a simple java application and hence is the default package for any java class. Like that ,

java.io packages contains all the required classes and functionality for doing input and output operations using file and console.

As the java vendors has categorized the different classes in different packages, the same we can do while developing our own java application, which makes us to say that packages can be used to search and locate the classes and interfaces. Best practice is to always keep the classes in a packages which must be followed by three dots naming convention.

For ex-  com.def.core ---> A package name , followed with three dots.

Note: Package must always be the first statement of any java class and can be only one package statement in each java file.

package is the keyword used before declaring any package name in the java source file.
For ex-    package  com.def.core.* ;

In the above statement .* indicate we are supposed to use all the classes defined in the com.def.core package.








Ads 468x60px

.

Ads

.

Featured Posts

Popular Posts

Like Us On FaceBook

Total Pageviews

Online Members

Live Traffic