CISC 124 Lecture 4: Java Expressions

98 views2 pages

Document Summary

Binary arithmetic operators: +, -, *, /, % Java doesn"t have an exponentiation operator - use math. pow(x, y) Integer arithmetic: truncated answer, fractional parts are discarded. If one of them is not a string, it will convert it. Unary operators: operate on a single value (+ and -) Includes ++ and -- to increment or decrement a val by 1. Basic comparisons: ==, !=, >, =, <= Not: ! (reverses logic of whatever symbol it"s next to) Single will evaluate both sides of the expression. Double will only evaluate 1 side and stop. && stops if the left side is false. || stops if the left side is true. If the method is the same as the class, use the same name. If not, identify the object owning the method and obtain the method using the dot operator. If it is static, invoke the method without instantiating the class.

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