8. Separate methods and logical operators Flashcards
What are the values of the following expressions?
1) 3 < 4 && ( 7 > 10 || 19 == 20)
2) 3 < 4 && ( 7 > 10 || 19 != 20)
3) 3 < 4 || ( 7 > 10 && 19 == 20)
4) 3 < 4 || ( 7 > 10 && 19 != 20)
5) 3 < 4 && 7 > 10 || 19 == 20
6) 3 < 4 && 7 > 10 || 19 != 20
7) 3 < 4 || 7 > 10 && 19 == 20
8) 3 < 4 || 7 > 10 && 19 != 20
ss
Why are methods called methods?
ss
When should methods have private visibility?
ss
What two attributes does a method parameter have at compile time? How many parameters can a method have?
ss
What is the difference between method arguments and method parameters?
ss
Can a void method have parameters? What (else) can it not have?
ss
What statement is used to produce the result from a method? How do we know what kind of result can be produced?
ss
What is the name for the mechanism for passing arguments to methods in Java? What is the significance of the approach?
ss
How do we print an int value with space padding up to twelve characters?
ss
How do we get an int value printed with zero padding up to twelve characters?
ss
What does the following code do?
int y = 100;
for (int x = 0; x < y; x++, y–)
System.out.println(x + y);
ss
Why is boolean type called boolean?
ss
Why do text data strings need to be members of a type?
ss
How do we stop two methods having variables of the same name?
ss
What other term is used for local variables?
ss