PROG 10082 Lecture Notes - Lecture 4: Object-Oriented Programming, Mathematical Constant, Law And Justice

131 views4 pages

Document Summary

In the expressions examples slide, there"s 3 variables. mathematical methods functions are used to tell the computer how to calculate things, such as math. pow(x,y); Math is a class, and the method is coming from the class, so in thix example pow would be the power class. Math. sqrt would give us the second root of a number, as in squared. Math. pow(8, 1/3)--> make sure to write the 1/3 as 1. 0/3. Note that if you calculate the value of this expression, you get a negative value. There is no way to find the second root of a negative value. We are finding the sqrt of a negative number and java cant read it. type casting changes the value of a variable to another, and it is not recommended unless mandatory. 3, you cant change two variables at the same time-see slide saying example.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents