answersLogoWhite

0

The diff between int integer

Updated: 8/17/2019
User Avatar

Sravans

Lvl 1
15y ago

Best Answer

In Java, an int is a primitive type and an Integer is a class. Basically, an Integer is just an int primitive wrapped up in a class. Mainly this is used for the generics introduced in Java 1.5. Primitive types cannot be used as generic types, so there was a need for classes to wrap around all primitive types so that you can declare things such as List<Integer>.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: The diff between int integer
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Would you explain diff between int and integer?

In Java, int is a primitive data type that is used to hold numeric values. for example an int variable can be used to hold your age in a Java program. Integer is the Wrapper class for the int data type. In Java there are a lot of in built features that work only on objects. under such circumstances we can wrap the primitive data type in its wrapper and use it. For example: int x = 10; Integer xObj = newInteger(x); if you want to know the value contained in xObj, then we use the method intValue(). xObj.intValue() would return the value 10 contained in it.


What is triple pointer?

Example: int x; -- integer int *px= &amp;x; -- pointer to integer int **ppx= &amp;px; -- pointer to pointer to integer int ***pppx= &amp;ppx; -- pointer to pointer to pointer to integer


What is the abbrevations for int?

"int" is the abbreviation for an integer data type. In Java an int is specifically a 32-bit signed integer.


How do declare function pointer having two integer parameters and returning integer pointers?

// declare a function int* function(int, int); or int* (function)(int, int); // declare a pointer to a function int* (*pointer_to_function)(int, int);


What is a int in java?

int is integer which means datatype


To find the addition and subtraction of 2 integer using call by refernce?

void math(int*, int*, int*, int*) void main() { int a, b, c, d; puts("ENTER VALUES TO A &amp; B"); math(&amp;a,&amp;b,&amp;c,&amp;d); printf("sum= %d \n diff= %d", c,d); getch(); } void math( int*a, int*b, int*c, int*d) { *c= *a+*b; *d= *a-*b; }


What is the data type int?

Data-type (short for integer).


What is the INT functions?

The INT function is to convert something into an integer. An integer is a number that goes out two decimal places.


Who are INT and CSM?

integer for int csm is a distrebuted programming language


Is int a statistical function?

No, 'int' is short for 'integer' (or 'integral' etc).


What is the BNF for integer literal?

* &lt;int&gt;-&gt;


What is java's keyword for the integer data type?

"int" is the keyword for integer