FIRST TEST Flashcards
what is JAVA?
Object oriented programming
Static keyword
The static keyword denotes that a member variable, or method, can be accessed without requiring an instantiation of the class to which it belongs.
Main method
Is the method where all of the other methods are stored
Whats the syntax to import java classes
import packageName
or
import packageName.ClassName
PG 53
IMPORTANT LOOK AT IT
How do you create a Scanner object
Scanner sc = new Scanner(System.in)
next()
returns the next token stored in the scanner as a string object
nexInt()
returns the next token stored in the scanner as an int value
nextDouble()
returns the next token stored in the scanner as a double value
nextLine()
returns any remaining input on the current line as a string object and advances the scanner to the next line
eight primitive data types
byte 1 short 2 int 4 long 8 float 4 double 8 char 2 boolean 1
casting
converting one data type to another
byte –>short –>int –>long–>float–>double
implicit casting
byte –>double
explicit casting
double –>byte
Integer and double classes
also referred to as wrapper classes