The return type for a method that doesn’t return anything.
Answer: What is void?
The order of the 3 color values
What are Red, Green, and Blue?
What the keyword public does
Why does public make the class, method, or variable accessible by all other classes?
The call used to get the size of the array
What is arrayName.length;?
What the following code prints
String str = “rylee”;
System.out.println(str.substring(2));
What is "lee"?
A method header for a method that takes in the name of an object and age (in full years) and returns the age multiplied by the length of the name.
What is public int anyName(String name, int age)?
The range of the values in color
What is the range 0 to 255?
Why you would add static to a method or a variable
When do you want a variable to contain a value shared by all instances of the class?
How is a method that belongs to the class different than any specific instances of the class?
The message thrown when you try to access an unreachable index in an array
What is an ArrayIndexOutOfBoundsException?
What the following code prints
String str = “tungtungtungsahur”;
str.toUpperCase();
System.out.println(str);
What is "tungtungtungsahur"?
The other name for getter and setter methods.
What are accessors and modifiers?
The color combination for yellow
What is (255, 255, 0)?
A dog class needs to track what its name is. This code initializes that variable
What does private String name; do?
A line of code used to access the last index of an array when you do not know what the size is
What is arrayName[arrayName.length-1];?
What happens when you try to access an element at a String index that does not exist
What is a StringIndexOutOfBoundsException?
The reason the following code fails to compile:
public int makeIdTag(String name, int age, int number)
{//implementation not shown}
public int makeIdTag(String name, int expirationDate, int formerId)
{//implementation not shown}
What is when methods have the same name and the same parameter types in the same order (aka same method signature)?
The way to build a new color object
What is Color varName = new color (R, G, B);?
Explain private and public methods and when you would use each
Why is it that Private methods can be accessed only by that class, and public methods can be accessed by any class, keyword private are used when you only want methods to perform tasks specific to that class and keyword public are used when you want the classes function to be accessible from outside the class?
The result of running this code
String[] arr = { “Five”, “pie”, “ten”, “hi”, “elf”, “seven”};
for (int x = 0; x < arr.length; x+=2)
{System.out.print(arr[x]+” “);}
What is "Five ten elf";
What the compareTo() method does
Why does it return an int where if the strings are equal it's 0? If the instance is “smaller” than the passed parameter then it returns a negative number. If the instance is “larger” than the passed parameter then it returns a positive int.
When a method header has the same name as another method but takes in different parameters.
What is an overloaded method?
The 5 color methods
What are the methods getRed();, getBlue();, getGreen();, brighter();, and darker();?
Why field variables are private
Why do programmers make it so that a variable won’t be affected by other things outside of the class?
The result of the following code
int[] arr = {5, 2, 7, 1};
for(int x = 1; x < arr.length; x++)
{arr[x] += arr[x-1];}
System.out.print(arr[3]);
What is "15"?
What the following code returns
String str = “dogdograwrruffruffmeowcatdograwr”;
int index = str.indexOf(“rawr”);
return index;
What is 6?