Java Flashcards
Which method used to start Java?
main
Which method is use to not returned values?
void
Which method is use to run without a class that include the method main?
static
How do we print “I love programming” in java?
class MyClass { public static void main(String[ ] args) { System.out.println("I love programming"); } }
What the difference between a multi-line comment and documentation comment?
They generate external documentation of your source code and the symbol. Multi-line comments are /* */ and documentation comment are /** */.
What are the variables?
int, float, long, double, boolean, short, byte, and char.
int[ ][ ] sample = { {9,18,5}, {8, 7, 11} };
int x = sample[1][1];
System.out.println(x);
What the output?
7
int[ ][ ] sample = { {37,25,43}, {62,71} {64, 92, 88} };
int x = sample[2][1];
System.out.println(x);
What the output?
92
int x = 10; if(x < 99) { System.out.println("Hi"); } else(x>99) { System.out.println("Welcome!"); } What would the system print out?
Welcome
for(int x=0; x<=100; x=x+10) {
System.out.println(x);
What numbers would the system print out?
0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100