COSC 236 Study Guide - Midterm Guide: Study Guide, Boolean Expression, Switch Statement

199 views5 pages

Document Summary

Exam 1 study guide (java fundamentals & decision structures) *must have a java class: public class (name) Must have a method: public static void main(string[] args, code goes between curly braces { } Statements: end in , system. out. printin prints output to the screen. Console output: printin: enters after the string text, print: strings printed on same line. Variables: a named storage box" located in the computer"s memory. How you are able to store data into memory locations: declaring the variable actually creates it (reserves a box in memory for it, assigning the variable actually puts value or something into the box. Value = 5 (value gets 5: literal a value that is written into the code of a program, if two word variable, second word gets capitalized. The +" operator: used two ways. A concatenation operator (puts two things next to each other) Classes, methods, and variables: cannot be java keywords, rules: