Skip to content

PRO TIP Block youtube.com at the DNS level β€” Pi-hole, NextDNS or your hosts file β€” but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Math.pow Java Exponents Tutorial #21

86K views on YouTube

$1,500 OFF ANY Springboard Tech Bootcamps with my code ALEXLEE1500. See if you qualify for the JOB GUARANTEE! πŸ‘‰ https://bit.ly/3HX970h

This is the exact code you need to calculate exponents in java! βœ… Simply write Math.pow(a, b) and replace with the numbers you want.

πŸ‘‘Start practicing now with 10 free java programs – http://alexlorenlee.com/
πŸŒ… Source Code – https://github.com/alexlorenlee/JavaTutorialCode/blob/master/Numbers/Exponents.java

“a” is your base and “b” is your exponent. For example, 5^2 would be Math.pow(5, 2); Put that in a print statement like this: System.out.println(5 + 10); and you will see the addition printed to the screen.

This format of calculating java exponents can be tricky… They should just have a symbol for it! But Math pow isn’t too bad πŸ™‚ If you followed along, congrats! You learned-by-doing!

I hope you enjoyed this Math.pow java tutorial! I like to have a nice mix of tutorials and actual projects for you all πŸ™‚

Do you want to learn how to code from scratch, in Java? Check out my Java Tutorial For Beginners: https://youtu.be/woJb2hAfkO0

What are you using exponents in java for? –

Full Java Tutorial For Beginners Playlist: https://youtube.com/playlist?list=PL59LTecnGM1NRUyune3SxzZlYpZezK-oQ&si=6OSbyiJxFsTjqL_9
Free Tips: https://bit.ly/3U6HXcb

Disclosure: The Springboard link provided is linked to my affiliate account & supports the channel.

~

Alex Lee