Section 1

Preview this deck

Variable assignment

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (65)

Section 1

(50 cards)

Variable assignment

Front

looks like initialization but occurs afterwards

Back

What classes are in the util package?

Front

Scanner, ArrayList, Random

Back

What classes are in the lang package?

Front

String, Double, Character, Math, Integer, and System

Back

How to raise double num to the power of double num2

Front

Math.pow(num,num2);

Back

format specifier for doubles to two decimal places

Front

%.2f

Back

Variable declaration

Front

int n;

Back

What is the only variable type that words for the pow(); method?

Front

double

Back

How to re-assign n as n+8?

Front

n+=8;

Back

What logical operator means and?

Front

&&

Back

What logical operator means or?

Front

||

Back

What is used to find remainder?

Front

%

Back

format specifier for strings

Front

%s

Back

What is used to divide?

Front

/

Back

What is used to multiply?

Front

*

Back

How to add one to n?

Front

n++;

Back

Method to turn String word into an integer?

Front

Integer.parseInt(word);

Back

When to use printf?

Front

With format specifiers

Back

How to re-assign n as n-3?

Front

n-=3;

Back

How to subtract one from n?

Front

n--;

Back

Method to make the number in char c into an integer?

Front

Character.getNumericValue(c);

Back

What goes at the first line?

Front

import java.util.*;

Back

How to make a word be all lower case

Front

word=word.toLowerCase();

Back

What should strings always be in?

Front

" "

Back

What goes after any variable declaration/initialization?

Front

Scanner in=new Scanner(System.in);

Back

format specifier for char

Front

%c

Back

How to create a substring of the first two letters of a word?

Front

String substring=word.substring(0,2);

Back

Array declaration with six spots

Front

int [] intArray=new int[6];

Back

What should chars always be in?

Front

' '

Back

What number will be given if the character of the indexOf() method is not in the word?

Front

-1

Back

How to determine where a space is for a word and store it as the integer space

Front

int space=word.indexOf(' ');

Back

What goes on the second line?

Front

public class info {

Back

How to calculate circumference

Front

double circumf=2radiusMath.PI;

Back

What are the two packages that I know?

Front

util and lang

Back

What is the parameter for println();

Front

String

Back

How to take a square root of a double dNum

Front

Math.sqrt(dNum);

Back

What to put in between in.nextInt and in.nextLine?

Front

in.nextLine();

Back

Variable initialization

Front

n=3;

Back

What logical operator means not?

Front

!

Back

What causes enter to be pressed in a printf?

Front


Back

format specifier for integers

Front

%d

Back

Variable declaration and initialization

Front

int n=3;

Back

How to assign integer to whatever user inputs?

Front

n=in.nextInt();

Back

What line will give if the first letter of someone's name is b?

Front

name.charAt(0)=='b'

Back

What are Boolean variables?

Front

true/false statements

Back

Concatenation operator

Front

+

Back

When to use println?

Front

With concatenation operators

Back

Method to turn the String word into a double?

Front

Double.parseDouble(word);

Back

What goes on third line?

Front

public static void main(String[] args) {

Back

Array declaration and initialization

Front

int [] arr1={1,2,3,4,5};

Back

What are the relational operators?

Front

<, >, <=, >=, ==

Back

Section 2

(15 cards)

Method that turns String word into a char array?

Front

word.toCharArray();

Back

How to determine if "jared" is in the String ArrayList called signUpList?

Front

if(signUpList.contains("jared"))

Back

How to remove the third String from the String ArrayList called signUpList and store it in a String called s?

Front

String s=signUpList.remove(2);

Back

How to determine size of an ArrayList called numbers?

Front

numbers.size();

Back

How to declare an Integer ArrayList called numbers?

Front

ArrayList<Integer> numbers=new ArrayList();

Back

How to cast num as a double?

Front

(double) num

Back

How to cast num as an int?

Front

(int) num

Back

How to turn an integer into a String?

Front

Integer.toString(integer);

Back

How to add the name "jared" to a String ArrayList called signUpList?

Front

signUpList.add("jared");

Back

Where do you put try and catch?

Front

Inside a while loop.

Back

How to split by anything other than a number of a letter?

Front

split("\\W+")

Back

How to determine if name and word are equal?

Front

name.equals(word)

Back

What line should be the first line inside a method that generates a random number?

Front

Random r=new Random();

Back

How to have the program pick a number between 0 and 5 and store it in the int n?

Front

int n=r.nextInt(6);

Back

How to print the ith index of ArrayList numbers?

Front

System.out.println(numbers.get(i));

Back