Difference between Integer and int in java

Explain the difference between Integer and int in java.

The following are the differences:

- Integer is a wrapper class, where as int is a primitive data type.

- Integer can be used as an argument to a method which requires an object, where as int can be used as an argument to a method which requires an integer value, that can be used for arithmetic expression.

- The variable of int type is mutable, unless it is marked as final. Integer class contains one int value and are immutable.

Explain the difference between Integer and int in java.

int is one of the primitive datatype in Java. The Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int.
What is javap?
The javap is a command that disassembles a class file. It prints out the package.....
Explain the processes performed by java virtual machine, i.e. loading, linking, initialization
The Java virtual machine dynamically loads, links, and initializes classes and interfaces...
Difference between StringBuilder and StringBuffer class
StringBuffer class is contained in java.lang package. This class is mutable means the character string in a string buffer gets changed....
Post your comment