java - Why does the Integer constructor method no longer require attributes? -



java - Why does the Integer constructor method no longer require attributes? -

when attempting compile next code:

public class inttest { public static void main(string[] args) { integer = new integer(5); } }

the next error occurs:

inttest.java:3: error: constructor integer in class integer cannot applied given types; integer = new integer(5); ^ required: no arguments found: integer reason: actual , formal argument lists differ in length 1 error

it hence follows can utilize new integer() initialize variable, , cannot add together number attribute, e.g. new integer(5).

why java using different constructor usual, doesn't take attribute beingness included new integer()?

you trying initialize on - passing i argument, not 5.

java compiler-errors

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -