Your byte size news and commentary from Silicon Valley the land of startup vanities, coding, learn-to-code and unicorn billionaire stories.

Ad

Tuesday, February 9, 2016

Codecademy Learn Java tutorial walkthrough 8 : Math +,-,*,/

In this exercise 8/12, Codecademy requires you to do some basic arithmetics using Java. Use the plus symbol + for addition, the minus symbol - for subtraction (it's a very short dash like the in the word "half-life"), the asterisk or the multiply symbol * for multiplication, the forward slash or the divide symbol / for division (the backward flash is \).

In this case, you just have to multiply two whole numbers and store the result in a variable that can hold an integer. And that's exactly what line 4 does

int myNumber = 5 * 6;

Don't forget the semicolon or ; at the end of the line. That's how Java knows a line has ended. Or else it will get confused when trying to execute line 4 and line 5 together and throw a nasty error message. This error message is Codecademy specific and can be confusing. If you included the semicolon correctly but still got this message check if you really multiply two integers and stored it successfully in a variable that int holds integers and the variable is called myNumber.

It has been just unfathomably liberal with you to give straightforwardly what precisely numerous people would've promoted for an eBook to wind up making some money for their end, basically given that you could have attempted it in the occasion you needed.

Thanks a lot very much for the high your blog post quality and results-oriented help. I won’t think twice to endorse to anybody who wants and needs support about this area. hadoop training in bangalore