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. 



The error message reads:
Did you multiply two integers?
Remember, integers are whole numbers only.

What's a whole number? 1, 3, 70, but not 3.5

21 comments:

  1. Thanks for sharing informative article on java application development. Your post helped to understand the career in Java.Java Training in Chennai

    ReplyDelete
  2. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training Core Java 8 Training in Chennai java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

    ReplyDelete
  3. Nice post. Very interesting to read. Thank you for Sharing.
    erp software in chennai

    ReplyDelete
  4. 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.


    Java Training in Bangalore|
    Java Training in Chennai|
    Java Training in Bangalore|

    ReplyDelete
  5. Hi, This is Ankit from Delhi. I have read your blog and I got some knowledgeable information through this blog. Really useful blog. Keep update your blog.
    http://saptraininginstitutedelhi.in/

    ReplyDelete
  6. Thanks for sharing this unique and informative content which provided me the required information.
    Sap BW Training

    ReplyDelete
  7. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.

    Java Training in Bangalore

    ReplyDelete
  8. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site. rprogramming training in bangalore

    ReplyDelete
  9. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
    big data training in chennai|

    ReplyDelete
  10. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.

    java training in bangalore

    ReplyDelete
  11. 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

    ReplyDelete
  12. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    data science training in chennai

    ReplyDelete
  13. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    oracle training in Bangalore

    ReplyDelete
  14. Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site. java training in bangalore

    ReplyDelete
  15. Incredible post. Keep it up. Thank you such a great amount for sharing your profitable blog.. Inventory Audit | Customer Reconciliation

    ReplyDelete
  16. February 23, 2011 at 3:42 pm
    Great article, and some good comments too. I agree that commenting on a comment helps both dialogue and traffic, as does visiting the comment's site, I’ve found several good sites that way.
    Best Graphics DesigningTraining Institute in Chennai | Photoshop Training Institute in Chennai

    ReplyDelete
  17. Great one,You have done a great job by sharing this content,Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.

    Python Training in Chennai
    Python Training

    ReplyDelete

Getting Started Coding Amazon Alexa Skills for Developers

Getting Started First read our blog post on how to get started with Alexa Skill building or watch our youtube video on the topic Blog...