reading-notes

Java

Java Primitive Type

Java has 8 primitive types and the are :

these data types holds a raw values and not objects, However every objects has a single primitive type, which will lead us to the fact that the usage of object will take more memory than the primitive types and will be slower.

To use an object we have to consider some conditions such as the amount memory we want to use, the amount of memory we have and the application.

What Is an Exception?

An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program’s instructions.

When an error appears inside a method, the method will create an object and give it to the system called exception object, this object will have the error type and information. after that the system will handle the error and tries to solev it.

Java has a way to catch the error by using the try statement this will deliver the exception to the handler to deal with it.