Coding Flashcards
(52 cards)
Import
import javax.swing.*;
Class
public class ________
{
}
Main Method
public static void main (String [] args)
{
}
System.out.println(____);
Allows the user to input string
String ____ = JOptionPane.showInputDialog(“_____”);
Variable WORDS
String _____ = “____”;
Variable INTEGER
int ______ = _______;
Allows users to input integer
int ____ = Integer.parseInt (JOptionPane.showInputDialog (“________”));
Variable REAL NUMBER
double _______ = _______;
Allows users to input real number
double ______ = Double.parseDouble(JOptionPane.showInputDialog(“_____”));
Addition
+
Subtraction
-
Multiplication
*
Division
/
String -> int
String a = “______”;
int i = Integer.parseInt(a);
int -> double
int i = ____;
double d = i;
char -> int (ASCII value)
char c = ‘___’;
int i = (int)(c);
int -> String
int i = ___;
String num = i + “”;
String -> char
String name = “___”;
char c = name.charAt(___);
char -> double
char r = ‘___’;
int i = (int) (r);
double d = i;
Give char value for what the user inputs
char ____ = JOptionPane.showInputDialog(“___”).charAt(__);
Prints specific letters from words in char
System.out.println(___.charAt(___));
If statement numbers & true and false
if (ask == true)
{
}
If (ask == false)
{
}
Boolean
boolean ask = Boolean.parseBoolean(JOptionPane.showInputDialog(“_______”));