0

What is the meaning of "new" in "Scanner myVar = new" ?

7th Aug 2018, 10:24 AM
Kavya R
Kavya R - avatar
5 Antworten
+ 1
new tells your computer to allocate memory for creating a variable which is type Scanner in this case, you can call any type of class like that. int test = new int(); and such on...
7th Aug 2018, 11:04 AM
Tomer Sim
Tomer Sim - avatar
+ 2
the new keyword, is used to create / instantiate objects of a class. Scanner myVar = new ... simply tells Java to create an object myVar from the Scanner class
7th Aug 2018, 10:56 AM
Dlite
Dlite - avatar
0
to create new variable because you are calling the myVar
7th Aug 2018, 10:51 AM
Andrew Labada
Andrew Labada - avatar
0
"Scanner myVar = new" isn't correct
7th Aug 2018, 10:55 AM
ReimarPB
ReimarPB - avatar
0
Thank you so much 👍🏼😁 Tomer Sim
7th Aug 2018, 11:12 AM
Kavya R
Kavya R - avatar