SYNTAX, MAIN METHOD & PRINTLN Flashcards

1
Q

Which method is needed in all Java programs?

A

THE ‘main ()’ METHOD

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

What is a class?

A

A TYPE DEFINITION THAT DEFINES BEHAVIOUR (VIA METHODS) AND STORES DATA AS ATTRIBUTES

TEMPLATE FOR OBJECTS THAT BELONG TO IT HAS 2 THINGS: ACTIONS & FEATURES

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

What is a method?

A

A SEQUENCE OF COMMANDS WHICH LETS OPERATIONS BE PERFORMED

ACTION PERFORMERS: SET BEHAVIOURAL RULES FOR CLASSES AND MANIPULATE DATA

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

What is an Object?

A

AN INSTANCE (RUNNING COPY) OF A CLASS

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

What happens when code is put inside the main () method?

A

IT WILL BE EXECUTED

THE CODE WILL RUN

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

What does a pair of curly brackets ‘{}’ indicate?

A

A BLOCK OF CODE

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

What is a block of code?

A

A GROUP OF PROGRAMMING STATEMENTS THAT IS TREATED AS A SINGLE UNIT

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

WHAT ARE THE FOUR ACCESS MODIFIERS IN JAVA?

A
  • PRIVATE
  • PROTECTED
  • DEFAULT
  • PUBLIC

PRIa-PUrsued-the-DEntist’s-PROgnosis

Pri-Pu Po-De

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

What does the ‘main () method’ look like?

A

public static void main(String[] args)

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

What does the print line method consist of?

A

{ System.out.println(“___ “); }

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

What is difference between the outputs of the ‘Println()’ and ‘Print()’ method?

A

THE ‘Print()’ METHOD DOES NOT ALLOW THE OUTPUTS TO BE EXPRESSED ON SEPERATE LINES.

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

What are attributes within a class?

A

Variables store the state of the objects

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