0
What is the meaning of "new" in "Scanner myVar = new" ?
5 Respostas
+ 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...
+ 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
0
to create new variable because you are calling the myVar
0
"Scanner myVar = new" isn't correct
0
Thank you so much 👍🏼😁 Tomer Sim