SYNTAX, MAIN METHOD & PRINTLN Flashcards
Which method is needed in all Java programs?
THE ‘main ()’ METHOD
What is a class?
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
What is a method?
A SEQUENCE OF COMMANDS WHICH LETS OPERATIONS BE PERFORMED
ACTION PERFORMERS: SET BEHAVIOURAL RULES FOR CLASSES AND MANIPULATE DATA
What is an Object?
AN INSTANCE (RUNNING COPY) OF A CLASS
What happens when code is put inside the main () method?
IT WILL BE EXECUTED
THE CODE WILL RUN
What does a pair of curly brackets ‘{}’ indicate?
A BLOCK OF CODE
What is a block of code?
A GROUP OF PROGRAMMING STATEMENTS THAT IS TREATED AS A SINGLE UNIT
WHAT ARE THE FOUR ACCESS MODIFIERS IN JAVA?
- PRIVATE
- PROTECTED
- DEFAULT
- PUBLIC
PRIa-PUrsued-the-DEntist’s-PROgnosis
Pri-Pu Po-De
What does the ‘main () method’ look like?
public static void main(String[] args)
What does the print line method consist of?
{ System.out.println(“___ “); }
What is difference between the outputs of the ‘Println()’ and ‘Print()’ method?
THE ‘Print()’ METHOD DOES NOT ALLOW THE OUTPUTS TO BE EXPRESSED ON SEPERATE LINES.
What are attributes within a class?
Variables store the state of the objects