• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/50

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

50 Cards in this Set

  • Front
  • Back

JDK

Java Development Kit

JRE

Java Runtime Environment

What are the 5 steps of creating and running a Java program?

1. Edit


2. Compile


3. Load


4. Verify


5. Interpret

How do you compile on the commandline?

javac *.java

How do you run a Java program from the commandline?

java classWithMainMethod.class

How do you create a Javadoc?

What are some common keywords/reserved words?

new


class


public


static


void


final


switch


break

What package is automatically imported?

java.lang

What is the convection for package naming?

lowercase


'.' seperated

What is a class' relationship to an object?

Class is a definition


Object is an instance

What is the naming convention for classes?

UpperCamelCase

What are the class access modifiers?

public, protected, and private

Modifier: abstract

requires override

Modifier: static

restricts to one instance

Modifier : final

prohibits value modification

What is the purpose of methods?

Code reuse

What is the difference between a function and a method?

Function - Not tied to a class




Method - Member of a class

What is the syntax for the main method?

public static void main ( String args[] )

What is the convention for naming methods?

lowercase verbs

What is the convention for naming constants?

ALL_CAPS

What are the 8 primitive data types?

boolean


char


byte


short


int


long


float


double

What are the 4 primitive data type categories?

Integer


Floating Point


Character


Boolean

What is a reference?

IT'S A POINTER!

What are the conventions for naming variables?

lowercase nouns

What is the output:


System.out.print ( "Sum: " + 5 + 3 ); ?

Sum: 53

What type is the result?


int/double


double/int

double


double

What package does String belong to?

java.lang

What does immutable mean?

Its state cannot change after it is constructed.

What is interning?

While the values of multiple variables are equal, they point to the same memory location.

What makes a class static?

a private default constructor

Name 2 static java classes.

Math




System

What is the difference?




String a, b;




1) a.compareTo ( b ) ;


2) a.equals ( b ) ;


3) a == b ;

1) lexicographic order


2) boolean (compare strings)


3) boolean (compare pointers)

What are the parts of a GUI?

Stage


Scene


Node


- Control


- Image View


- Shape


- Pane

What method initiates a GUI program?

The start method.

How is the coordinate system defined?

( 0, 0 ) is in the top left corner

What are the 6 options for printf ?

%b - boolean


%c - character


%d - decimal


%f - float


%e - scientific notation


%s - string

How do you declare a console Scanner?

Scanner myScanner = new Scanner ( System.in ) ;

How do you get input from a scanner?

.next ( ) //string


.nextInt ( ) //integer


.next ( ) //double, float, etc...

How do you declare a file Scanner?

Scanner myFileScanner =


new Scanner ( new FileReader ( fileName ) ) ;

How do you check if a Scanner has something to read?

.hasNext ( ) //string


.hasNextInt ( ) //integer


.hasNext ( ) //double, float, etc...

How do you declare a file writing PrintWriter?

PrintWriter myPrintWriter = new PrintWriter (


new FileOutputStream ( fileName, bool append ));

How do you print to a file?

myPrintWriter.print ( "Stuff" ) ;


myPrintWriter.println ( "Stuff" ) ;


myPrintWriter.printf ( "Stuff" ) ;

What are the types of Alerts?

Alert.AlertType.




INFORMATION


WARNING


ERROR


CONFIRMATION



What are the types of dialogs?

ChoiceDialog




TextInputDialog




Alert

What needs to extend the Application class?

Your Class that handles the GUI

What arguments does the start method take?

public void Start ( Stage primaryStage ) {




}

How do you display a dialog?

dialog.show ( )

How do you get input from a dialog?

Type return = dialog.showAndWait ( ) ;

How do you set the title of a dialog?

dialog.setTitle ( "title" ) ;

What are the five ways to handle events?

* anonymous inner class


* lambda function


* handle method


*


*