36.5k views
5 votes
If var = keyboard.nextInt(); var must be defined as which of the following types? *

User Asara
by
7.6k points

1 Answer

7 votes

keyboard.nextInt(); This is an example of using the scanner class to get input from the user. The nextInt(); function means that you're getting an integer from the user.

var must be defined as an int.

User Romnick Susa
by
8.6k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.