What character goes at the end of every statement?
Why do we use variables in java?
To refer to stored data values.
How do you declare the main method?
public static void main(String[] args) {
}
How do you print "Hello World!" to the console?
System.out.println("Hello World!");
What is the format for declaring a variable?
type variableName = value;
What are the two things wrong with this statement
public class Maine { static void myMethod() { System.out.println("Cobb Corp Goons!"); }
public static void main(String[] args) { myMethod(); }
}
// Goal Output "I just got executed!"
What is "public class Maine"
And
"System.out.println("Cobb Corp Goons!");
Does not match the goal output
What symbol marks the start and end of each block of code?
What is "{}"
How do you declare the variable (name) with the value "John"
String name = "John";
When a parameter is passed to the method it is called?
What is An "Argument"?
What kind of error is in this line of code?
And How would you fix it?
System.out.println(ElijahCobbCorporate)
What is a syntax error?
System.out.println(ElijahCobbCorporate);
Which multiple variable initialization is correct?
A. int x, y, z;
x = y = z = 50;
B. int x, y, z;
x == y == z == 50;
A.
int x, y, z;
x = y = z = 50;
which string method returns the position of the first found occurrence of specified characters in a string?
indexOf()
What command reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files
What is wrong about this.
int myNum = 5;
float myFloatNum = BowserVideo;
char myLetter = 'D';
boolean myBool = true;
String myText = "Hello"
float myFloatNum = BowserVideo;
is the wrong datatype for "BowserVideo"
How would create an object called carsArray that returns the ArrayList "cars" as an array?
(Hint: use the toArray() method)
Object[] carsArray = cars.toArray();