Unit 1 - Primitive Types Flashcards
What are block comments?
All text between / and / that will be ignored by the compiler when in a program
What is a class declaration?
Identifies the name, start, and end of class Encapsules all lines of code between { and }
What is the main Method?
Controls all of action in a program
What is System.out?
Object that generates output to the console
System.out.print vs System.out.println
System.out.print displays whatever is in the () on the screen but wait at the end of line for more information to display
System.out.println displays whatever is in the () on the screen, then move cursor to the next line
What is a string literal?
Exact sequence of characters (letters, numbers, or symbols) which are enclosed between two quotation marks
What is a syntax error?
An error that occurs when the syntax in the program was created incorrectly
Program will not compile while these errors are present
Identify the syntax error in each line
System.ot.print (“Hi”);
system.out.print(“Hello);
Line one- out spelled ot
Line two- Uncapitalized system and missing second quotation mark
What is an exception?
Program attempts to divide a number by zero
Occurs while the program is running
Will cause the program to terminate abnormally
What is a logical error?
Programmer accidently uses the wrong symbol for an operation such as using minus instead of plus to find sum of two numbers
Detected when actual output differs from anticipated output
What are primitive data types?
Automatically part of the Java program which does not need to be created by a programmer
What are non-primitive data types?
Methods created by programmer to perform actions that primitive types can’t
Is String a primitive or non-primitive type?
Primitive data type
What is boolean?
Outputs “true” or “false”
Smallest data type at one bit
What is int?
Refers to whole numbers
Medium data type at 32 bits