PLZ HELP ASAP

1. What is Java SE?

A. Java Standard Edition
B. Java Software Editor
C. Java Scientific Edition
D. Java Software Emulator

2. Which of the following is the correct header for the main method of a Java program?

A. public static void main(String args)
B. public abstract void main(String[] args )
C. public static void main(String[] args )
D. public static int main(String[] args )

3. Which of the following statements creates a constant in Java?

A. int const = 5;
B. const int x = 5;
C. final int x = 5;
D. const x = 5;

4. Which of the following statements displays 17?

A. System.out.println (2*4+3*2+1);
B. System.out.println ((2*4+3)*2+1);
C. System.out.println (2*4+(3*(2+1)));
D. System.out.println (2*(4+3*2)+1);

If x is an int and the original value of x is 5, which of the following statements assigns an even value to x?

5.

A. x += 2;
B. x /= 3;
C. x %= 3;
D. x *= 3;

6. If x is an int, Which expression will always evaluate to true if x is evenly divisible by 5

A. x == 5
B. x % 2 == 5
C. x % 2 == 0
D. x % 5 == 0

7. Consider the following directions.

int y = 5;
int z = 10;

Which of the following expressions evaluates to true?

A. y > 5 && z >= 10
B. z / y >= 2 && y * 2 > z
C. y - z >0 || y * 4 == z * 2
D. y + z == z + y && z - y == y - z

8. Consider the following code.

int x = 2.
switch (x) {
case 1: x += 3;
case 2: x += 5;
case 3: x += 7;
default: x += 10;
}

After the switch statement, what is the value of x?

A. 2
B. 5
C. 7
D. 24

9. If y refers to an array of int values with seven elements, and all of those elements have been given a value of 5, which statement would change the last element of a 2?

A. y {7] = 2
B. y [6] = 2
C. y [2] = 6
D. y [2] = 7

10. Consider the following declaration.

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

Which arithmetic expression evaluates to a value of 8?

A. two[3] + two[2]
B. two[2] + two [1]
C. two[1] [3] + two[2] [2]
D. two[0] [2] + two[1] [1]

11. Consider the following method.

public static void print (int a, int ) {
System.out.println ("The sum is" + (a+b));
}

If the print method is in the same class as the main method and there are no other methods named print, which of the following statements, called from the main method, will not cause a compiler error?

A. System.out.println (print (2, 3));
B. System.out.println (print (2 + 3));
C. print (2, 3);
D. print (2 + 3);

12. Which of the following expressions correctly and most accurately calculates the area of a circle with radius r?

A. Math.pow (r, 2) * Math.PI
B. Math.power (r, 2) * Math.PI
C. Math.pow (2, r) * Math.PI
D. Math.exp (r, 2) * Math.PI

13. Consider the following code.

public class Amazing {
int x;
int y;
}

Which of the following shows a statement that will create an instance of class Amazing and assign its reference to a reference variable?

A. Amazing a = new Amazing;
B. Amazing a = new Amazing ();
C. Amazing a = Amazing ();
D. It is not possible to create an instance of class Amazing. It does not have a constructor.

14. Consider the following code.

public class Employee () {
private String firstName;
private String lastName;
private int empId;
}
Which of the following shows a constructor that, if added to class Employee, would allow a caller to create an object and pass in values from the call that will be assigned to its instance variables?

A. public Employee () {
firstName = “Fred”;
lastName = “Jones”;
empId = 101;
}

B. public Employee (String a, String b, int c) {
firstName = a;
lastName = b;
empId = c;
}

C. public Employee (“Fred”, “Jones”, 101) {
firstName = a;
lastName = b;
empId = c;
}

D. public Employee (String a, String b, int c) {
firstName = “Fred”;
lastName = “Jones”;
empId = 101;
}

15. What is the output of the following code?

String name1 = “Chris”;
String name2 = “Christine”;
boolean b = name1 . startsWith (name2);
boolean c = name1 . charAt (4) == name2 . CharAt (7);
System.out.println (b + “, ” + c);

A. true, true
B. true, false
C. false, true
D. false, false

did you get it

1. is java standard edition 2. C. public static void main (string{} args)

1. The correct answer is A. Java Standard Edition.

To find the answer, you can use a search engine and search for "Java SE definition" or "What is Java SE?". The first few search results should provide you with information about Java SE being the standard edition of Java.

2. The correct answer is C. public static void main(String[] args).

To know the correct header for the main method in a Java program, you can refer to the Java documentation or a Java programming guide. The main method in Java always has the specific signature of "public static void main(String[] args)".

3. The correct answer is C. final int x = 5.

To create a constant in Java, you can use the keyword "final" before the variable declaration. The "final" keyword makes the variable's value unable to be changed once assigned.

4. The correct answer is C. System.out.println(2*4+(3*(2+1))).

To determine which statement displays 17, you can simplify each expression and solve them. The expression in option C simplifies to (2 * 4 + (3 * (2 + 1))) = (8 + (3 * 3)) = (8 + 9) = 17.

5. The correct answer is A. x += 2.

To assign an even value to x, you can use the shorthand assignment operator "+=" to add 2 to the current value of x.

6. The correct answer is D. x % 5 == 0.

To check if x is evenly divisible by 5, you can use the modulo operator "%" to check if the remainder of the division of x by 5 is 0.

7. The correct answer is B. z / y >= 2 && y * 2 > z.

To determine which expression evaluates to true, you can evaluate each expression separately. In option B, (z / y >= 2) is true because 10 / 5 = 2, and (y * 2 > z) is also true because 5 * 2 = 10 which is greater than 10.

8. The correct answer is D. x += 10.

To determine the value of x after the switch statement, you need to trace the execution of the switch statement. Since the value of x is 2, it matches the case 2 and then continues executing the subsequent cases without any break statements. Therefore, the value of x is increased by 5 (case 2) + 7 (case 3) + 10 (default case) = 24.

9. The correct answer is B. y[6] = 2.

To change the last element of an array with seven elements, you can access the last element using the index 6 (since array indices start from 0) and assign a new value to it.

10. The correct answer is D. two[0][2] + two[1][1].

To evaluate an arithmetic expression that accesses elements in a two-dimensional array, you can use the specified indices to access the elements and perform the arithmetic operation.

11. The correct answer is C. print(2,3).

To call the print method without causing a compiler error, you need to provide the appropriate arguments based on the method signature. In option C, print(2,3) matches the method signature, and it should not cause a compiler error.

12. The correct answer is A. Math.pow(r, 2) * Math.PI.

To calculate the area of a circle with radius r, you can use the formula Math.pow(r, 2) to square the radius and then multiply it by Math.PI to get the area.

13. The correct answer is B. Amazing a = new Amazing().

To create an instance of a class and assign its reference to a reference variable, you need to use the "new" keyword followed by the class name and parentheses to invoke the constructor.

14. The correct answer is B. public Employee(String a, String b, int c).

To create a constructor in class Employee that allows a caller to pass in values and assign them to instance variables, you need to define a constructor with parameters that correspond to the instance variables and assign the passed values to them.

15. The correct answer is D. false, false.

To determine the output of the code, you need to understand the methods being used.

The startsWith method checks if the string name1 starts with the string name2. Since "Chris" does not start with "Christine", the value of b is false.

The charAt method returns the character at a specified index in a string. Comparing the characters at indices 4 and 7 in name1 and name2, respectively, yields false. Thus, the value of c is also false.

Therefore, the output is "false, false".