Conditional Operators and Statements

Descripción

Flashcards for conditional and relational operators/statements in java
nini798
Fichas por nini798, actualizado hace más de 1 año
nini798
Creado por nini798 hace más de 9 años
26
1

Resumen del Recurso

Pregunta Respuesta
== equals
<= smaller than or equals to
>= greater than or equal to
!= does not equal
< smaller than (exclusive)
> greater than (exclusive)
|| or
&& and
syntax of an if/else statement if(condition) { statements; } else { statements; }
Syntax of a switch & case statement switch(variable){ case value: statements; break; //optional case value: statements; ... }
Which 'if' will the 'else' pair up with? if(statement){ if(statement){ else{ } } } if(statement){ if(statement){ //this one else{ } } }
What data types will work with the variable creating a switch? int, byte, short, char, String (other types, but not very relevant to this class, are enumerated types and classes that "wrap" primitive data types, such as Integer, Byte, Short, Character)
else statements pair up with: the closest if statement that's available. (not available means that the if statement is locked outside of brackets of another, outer 'if' statement. See example below: if(statement){ //locking bracket if(statement){ } } //locking bracket else{ //outside of bracket }
Optional statements added after an 'if' statement else, else if
syntax for a nested 'if' statement if(condition){ if(condition){ } }
What is this equivalent to? !(A && B) !(A) || !(B)
What is this equivalent to? !(A || B) !(A) && (B)
De Morgan's Law not(A or B) == (not A) and (not B) as well as not(A and B) == (not A) or (not B)
break statement exits a switch statement
default statement used at the end of a switch statement, takes all values, implies that other cases weren't reached
case groups multiple cases that all run the same statement in a switch
Mostrar resumen completo Ocultar resumen completo

Similar

Java Week 5 Object Oriented Programming
Troy Bowlin
Conditional and Relational Operators/Statements
nini798
French Tense Endings
James Hoyle
Java Practice 1
Ummm No
foundation of economics
09serukenyahol
Spanish Tenses
Joe McElroy
Java Practice 2
Ummm No
Servion - Java Questionnaire
rohit.benedict
Java Core. Basics
Gadget
Chapter 3 & 4 Review
Shannon Anderson-Rush
Programming Review
Shannon Anderson-Rush