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

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -