


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This document from OSU CSE introduces the concepts of operators, expressions, statements, and control flow in programming. It covers common operators, expressions examples, statement examples, assignment statements, compound statements, and control flow statements. Best practices for boolean expressions are also provided.
Typology: Study notes
1 / 34
This page cannot be seen from the preview
Don't miss anything!



























String boolean char int double
Best Practice : do not use == or != with Strings, but rather the equals method; details later.
String boolean char int double
Operators for or (||) and and (&&) use short- circuit evaluation.
String boolean char int double
Best Practice : do not check double s for equality; details later.
n == 0 new SimpleWriter1L()
What is the type of each of these expressions?
n == 0 new SimpleWriter1L()
This fragment creates a new object of type SimpleWriter1L, and its value is a reference to that object; details later.
This is the same as j = j + 7;
The scope of variable s is just the block in which it is declared.
We will normally use these, but you may use a switch statement if you like; details later.