Java Flashcards

1
Q

Which method used to start Java?

A

main

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which method is use to not returned values?

A

void

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which method is use to run without a class that include the method main?

A

static

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do we print “I love programming” in java?

A
class MyClass {
  public static void main(String[ ] args) {
    System.out.println("I love programming");
  }
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What the difference between a multi-line comment and documentation comment?

A

They generate external documentation of your source code and the symbol. Multi-line comments are /* */ and documentation comment are /** */.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the variables?

A

int, float, long, double, boolean, short, byte, and char.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

int[ ][ ] sample = { {9,18,5}, {8, 7, 11} };
int x = sample[1][1];
System.out.println(x);
What the output?

A

7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

int[ ][ ] sample = { {37,25,43}, {62,71} {64, 92, 88} };
int x = sample[2][1];
System.out.println(x);
What the output?

A

92

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
int x = 10;
if(x < 99) {
   System.out.println("Hi");
} else(x>99) {
   System.out.println("Welcome!");
}
What would the system print out?
A

Welcome

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

for(int x=0; x<=100; x=x+10) {
System.out.println(x);
What numbers would the system print out?

A

0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly