0

What is the 'new' in scanner line? What is its purpose?

15th Jul 2019, 10:12 AM
Anjali S
Anjali S - avatar
4 Réponses
0
Scanner is the class, so you make a Scanner object by using the new keyword.
15th Jul 2019, 10:28 AM
Airree
Airree - avatar
0
Okay so instead of new, I can put any word since its only an object? Like scanner ip = object1 scanner(system.in)?
15th Jul 2019, 10:44 AM
Anjali S
Anjali S - avatar
0
Oh okay. What is the object name then?
15th Jul 2019, 10:59 AM
Anjali S
Anjali S - avatar
0
Well it's not my fault that they didn't mention which word was exactly was for. I know c/c++ so you really don't need to think of me as dumb. Thank you for your help.
15th Jul 2019, 11:15 AM
Anjali S
Anjali S - avatar