tashaunalewis3682 tashaunalewis3682
  • 01-09-2020
  • Computers and Technology
contestada

can java scanner not take in a negative input?

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 02-09-2020

Answer:

It can take a negative input

Explanation:

When you declare a variable in Java and you get your input via Scanner library; the Scanner library will accept the input irrespective of whether it's negative or not.

Take for instance, the following segment

Scanner input = new Scanner(System.in);

int userinput = input.nextInt()

Irrespective of whether userinput is negative or positive, it'll accept it.

Answer Link

Otras preguntas

FIND THE X AND Y-INTERCEPT FROM THE EQUATION GIVEN BELOW Y=2X +4
What are the square roots of 256 144 ? 0 - 13 and 1 0-12 and 12 o and 1 11 and 12 O
Model 3 - Aquatic Plant Data Length of clipping (cm) Number Length of leaves on clipping Lamp power (watts) Percentage of light from lamp that oxygen but formed
why might the size of the Roman Empire be a problem for Roman administrators.
At Lucy's Beading Boutique, 40% of the 70 beads on clearance are plastic. How many plastic beads are there on clearance?
What is each civilization best known for (minimum of three)?
Is this right? Thank you
what is meant by emergency first responders
What is Lady Bruton's cause that she wants Richard and Hugh to help her with? a. Legalization of women in the Parliament c. Emigration to Canada b. Restoration
WILL GIVE BRAINLEST 100Pts ANSWER ALL QESTIONS PLS!!!!!!!!!!!!!!!! A.Write the algebraic expressions representing the length and with of Marlene's house. B.Writ