DEV Community

Milena
Milena

Posted on

1/30 days of Java

In my first day of this challenge, I already found something that I did not know!

While I was coding and trying to solve this challenge, I did not know what was wrong, because it simply was not making any sense in my head. My problem was the following: I had to create three variable. One for an integer value, other for a double value and the last one, for a string. I also had inputs for all of the them. The problem was that, the compiler was not reading the last input (nextLine) and I discovered that, for some reason, when the compiler starts getting the values, it jumps the nextLine command and to solve this, we need to convert it.

I am still researching and learning about this to know why and how it works, but, pretty exciting thus far.

For curiosity, this is how I was doing:
Java code

And this is how it works:
Java code

Latest comments (1)

Collapse
 
mdsujan99 profile image
Md Sujan