Java Certification Test! Programming Trivia Questions Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Catherine Halcomb
C
Catherine Halcomb
Community Contributor
Quizzes Created: 1428 | Total Attempts: 5,929,496
Questions: 95 | Attempts: 704

SettingsSettingsSettings
Java Certification Test! Programming Trivia Questions Quiz - Quiz

Are you reading to get your java certification test? There are different things that you need to understand to ensure you do not fail the test properly, and the programming trivia questions quiz below will help you get a clue of what they are. How about you give it a shot and get to see if you actually know enough to sit for the test or need more study hours.


Questions and Answers
  • 1. 

    Given the code fragment: nums1[] =1. Given the code fragment: int nums1[] = new int[3]; int nums2[] = {1,2,3,4,5}; nums1 = nums2; for (int x : nums1) { System.out.print(x + ": "); } What is the result? new int[3]; int nums2[] = {1,2,3,4,5}; nums1 = nums2; for (int x : nums1) { System.out.print(x + ": "); } What is the result?

    • A.

      An ArrayIndexOutOfBoundsException is thrown in runtime.

    • B.

      Compilation fails.

    • C.

      1: 2: 3: 4: 5:

    • D.

      1: 2: 3:

    Correct Answer
    C. 1: 2: 3: 4: 5:
    Explanation
    The result of the code fragment is "1: 2: 3: 4: 5:". The code creates two arrays, nums1 and nums2. nums1 is initially an empty array with a length of 3. nums2 is an array with 5 elements. The line "nums1 = nums2;" assigns the reference of nums2 to nums1, meaning that both arrays now refer to the same memory location. The for-each loop then iterates over the elements of nums1, printing each element followed by a colon and a space. Since nums1 now refers to the elements of nums2, the output is "1: 2: 3: 4: 5:".

    Rate this question:

  • 2. 

    Which three statements describe the object-oriented features of the java language? (Choose three)

    • A.

      A main method must be declared in every class.

    • B.

      A package must contain more than one class.

    • C.

      A subclass can inherit from a superclass.

    • D.

      Objects cannot be reused.

    • E.

      Object can share behaviors with other objects.

    • F.

      Object is the root class of all other objects.

    Correct Answer(s)
    C. A subclass can inherit from a superclass.
    E. Object can share behaviors with other objects.
    F. Object is the root class of all other objects.
    Explanation
    A subclass can inherit from a superclass: This statement describes one of the key features of object-oriented programming in Java, which is the ability for a subclass (a derived class) to inherit the properties and behaviors of its superclass (a base class).

    Object can share behaviors with other objects: This statement highlights another important feature of object-oriented programming, which is the ability for objects to share behaviors through methods and inheritance. This allows for code reuse and promotes modular and organized programming.

    Object is the root class of all other objects: This statement refers to the fact that in Java, the Object class is the ultimate parent class of all other classes. Every class in Java is either directly or indirectly derived from the Object class, which provides basic functionalities and methods that are common to all objects.

    Rate this question:

  • 3. 

    Which three are advantages of the Java exception mechanism? (Choose three)

    • A.

      Improves the program structure because exceptions must be handled in the method in which they occurred.

    • B.

      Provides a set of standard exceptions that covers all the possible errors.

    • C.

      Improves the program structure because the error handling code is separated from the normal program function.

    • D.

      Improves the program structure because the programmer can choose where to handle exceptions.

    • E.

      Allows the creation of new exceptions that are tailored to the program being created.

    Correct Answer(s)
    C. Improves the program structure because the error handling code is separated from the normal program function.
    D. Improves the program structure because the programmer can choose where to handle exceptions.
    E. Allows the creation of new exceptions that are tailored to the program being created.
    Explanation
    The Java exception mechanism provides several advantages. Firstly, it improves the program structure by separating the error handling code from the normal program function. This makes the code more organized and easier to read and maintain. Secondly, it allows the programmer to choose where to handle exceptions, giving them flexibility in deciding how to handle different types of errors. Lastly, it allows the creation of new exceptions that are specifically tailored to the program being created, enabling more precise error handling and customization.

    Rate this question:

  • 4. 

    Given the following class: class CheckingAccount{ public int amount; //line n1 } And given the following main method, located in another class: public static void main (String [] args){ CheckingAccount acct = new CheckingAccount(); //line n2 } Which three pieces of code, when inserted independently, set the value of amount to 100?

    • A.

      At line n1 insert: public CheckingAccount(){ acct.amount = 100; }

    • B.

      At line n1 insert: public CheckingAccount(){ this.amount = 100; }

    • C.

      At line n1 insert: public CheckingAccount(){ amount = 100; }

    • D.

      At line n2 insert: acct.amount = 100;

    • E.

      At line n2 insert: amount = 100;

    Correct Answer(s)
    B. At line n1 insert: public CheckingAccount(){ this.amount = 100; }
    C. At line n1 insert: public CheckingAccount(){ amount = 100; }
    D. At line n2 insert: acct.amount = 100;
    Explanation
    At line n1, inserting "this.amount = 100;" or "amount = 100;" will set the value of the "amount" variable to 100. This is because both "this.amount" and "amount" refer to the "amount" variable within the current instance of the CheckingAccount class.

    At line n2, inserting "acct.amount = 100;" will set the value of the "amount" variable in the "acct" object to 100. This is because "acct" is an instance of the CheckingAccount class and "acct.amount" refers to the "amount" variable within that instance.

    Rate this question:

  • 5. 

    public static void main(String[] args) { int [] arr = {1, 2, 3, 4}; int i = 0; do { System.out.print(arr[i] + " "); i++; } while (i<arr.length -1); } Given the code fragment: What is the result?

    • A.

      1 2 3 4 followed by an ArrayIndexOutBoundsException

    • B.

      1 2 3

    • C.

      1 2 3 4

    • D.

      Compilations fails.

    Correct Answer
    B. 1 2 3
    Explanation
    The given code fragment uses a do-while loop to print the elements of the array "arr". The loop iterates until the value of "i" is less than the length of the array minus 1.

    In the given array, {1, 2, 3, 4}, the length is 4. The loop starts with "i" as 0 and prints the element at index 0, which is 1. Then, it increments "i" by 1 and checks if it is less than 4-1=3. Since it is, the loop continues and prints the element at index 1, which is 2. This process repeats for the elements at index 2 and 3, resulting in the output "1 2 3".

    Therefore, the correct answer is "1 2 3".

    Rate this question:

  • 6. 

    public class Test{ void readCard(int cardNo) throws Exception{ System.out.println("Reading Card"); } void checkCard(int cardNo) throws RuntimeException{ // line n1 System.out.println("Checking Card"); } public static void main(String[] args) { Test ex = new Test(); int cardNo = 12344; ex.checkCard(cardNo); //line n2 ex.readCard(cardNo); //line n3 } } Given the code fragment: What is the result?

    • A.

      Reading Card Checking Card

    • B.

      Compilation fails only at line n1.

    • C.

      Compilation fails only at line n3.

    • D.

      Compilation fails at both line n2 and line n3.

    Correct Answer
    C. Compilation fails only at line n3.
    Explanation
    The code compiles successfully and there are no syntax errors. The method `checkCard` throws a `RuntimeException`, which is a type of unchecked exception and does not need to be declared in the method signature. However, the method `readCard` throws a checked exception `Exception`, which needs to be declared in the method signature or handled using a try-catch block. Since the method `readCard` does not declare or handle the exception, the code fails to compile at line n3 where the method is called.

    Rate this question:

  • 7. 

    Given: class App{ public static void main(String[] args) { int i = 10; int j = 20; int k = j += i / 5; System.out.print(i + " : " + j + " : " + k); } } What is the result?

    • A.

      10 : 30 : 5

    • B.

      10 : 22 : 22

    • C.

      10 : 22 : 20

    • D.

      10 : 22 : 5

    Correct Answer
    B. 10 : 22 : 22
    Explanation
    In this code, the value of `i` is 10 and the value of `j` is 20. The expression `j += i / 5` is equivalent to `j = j + (i / 5)`. Since `i` is an integer and the division is integer division, `i / 5` evaluates to 2. Therefore, `j += i / 5` becomes `j = j + 2`, which means `j` is incremented by 2. So, the value of `j` becomes 22. The value of `k` is assigned the value of `j`, which is 22. Therefore, the result is "10 : 22 : 22".

    Rate this question:

  • 8. 

    Given the code fragment: public static void main(String[] args) { int [][]arr = new int[2][4]; arr [0] = new int[]{1, 3, 5, 7}; arr [1] = new int[]{1, 3}; for (int[] a : arr) { for (int i : a) { System.out.print(i + " "); } System.out.println(); } } What is the result?

    • A.

      1 3 5 7 1 3

    • B.

      1 3 1 3

    • C.

      1 3 1 3 0 0

    • D.

      Compilation fails.

    • E.

      1 3 Followed by an ArrayIndexOutOfBoundsException.

    Correct Answer
    A. 1 3 5 7 1 3
    Explanation
    The code creates a 2-dimensional array called "arr" with 2 rows and 4 columns. The first row is initialized with the values 1, 3, 5, and 7, while the second row is initialized with the values 1 and 3.

    The nested for loop is used to iterate over each element in the array. The outer loop iterates over each row, and the inner loop iterates over each element in the row.

    The print statement prints each element followed by a space. After printing all the elements in a row, a new line is printed.

    Therefore, the output will be:
    1 3 5 7
    1 3

    Rate this question:

  • 9. 

    Given: class Test { public static void main(String[] args) { int x = 1; int y = 0; if(x++ > ++y){ System.out.print("Hello "); } else{ System.out.print("Welcome "); } System.out.print("Log " + x + ": "+ y); } } What is the result?

    • A.

      Welcome Log 1: 0

    • B.

      Welcome Log 2: 1

    • C.

      Hello Log 2: 1

    • D.

      Hello Log 1: 0

    Correct Answer
    B. Welcome Log 2: 1
    Explanation
    The result is "Welcome Log 2: 1". In the if statement, the expression "x++ > ++y" is evaluated. Since x is initially 1 and y is initially 0, the expression becomes "1 > 1" after the post-increment of x and pre-increment of y. This expression evaluates to false, so the else block is executed. "Welcome" is printed, followed by the string "Log 2: 1" which represents the values of x and y after the if statement.

    Rate this question:

  • 10. 

    Given: MyString.java: package p1; class MyString{ String msg; public MyString(String msg) { this.msg = msg; } } And Test.java: package p1; class Test{ public static void main(String[] args) { System.out.println("Hello " + new StringBuilder("Java SE 8")); System.out.println("Hello " + new MyString("Java SE 8")); } } What is the result?

    • A.

      Hello Java SE 8 Hello Java SE 8

    • B.

      Hello java.lang.StringBuilder@<<hashcode>> Hello p1.MyString@<<hashcode2>>

    • C.

      Hello Java SE 8 Hello p1.MyString@<<>hashcode>

    • D.

      Compilation fails at the Test class.

    Correct Answer
    C. Hello Java SE 8 Hello p1.MyString@<<>hashcode>
    Explanation
    The first line of the output is "Hello Java SE 8" because when concatenating a string literal with a StringBuilder object, the toString() method of the StringBuilder class is automatically called, which returns the string representation of the StringBuilder object.

    The second line of the output is "Hello p1.MyString@" because when concatenating a string literal with a MyString object, the toString() method of the MyString class is not overridden, so it uses the default toString() method from the Object class, which returns the class name followed by the hashcode of the object.

    Rate this question:

  • 11. 

    Given: MainTest.java public class MainTest{ public static void main(int[] args) { System.out.println("int main " + args[0]); } public static void main(Object[] args) { System.out.println("Object main " + args[0]); } public static void main(String[] args) { System.out.println("String main " + args[0]); } } And commands: javac MainTest.java java MainTest 1 2 3 What is the result?

    • A.

      String main 1

    • B.

      Int main 1

    • C.

      Object main 1

    • D.

      Compilation fails.

    • E.

      An exception is thrown at runtime.

    Correct Answer
    A. String main 1
    Explanation
    The result of the given commands is "String main 1". This is because when the Java program is executed, it looks for a main method with the signature "public static void main(String[] args)". In this case, the main method with the String[] args parameter is present and it is the one that gets executed. The value "1" is passed as the first argument, so it gets printed along with the "String main" message. The other main methods with different parameter types are not considered as the entry point for the program.

    Rate this question:

  • 12. 

    Given the code snippet from a compiled Java source file: public class MyFile{ public static void main(String[] args) { String arg1 = args[1]; String arg2 = args[2]; String arg3 = args[3]; System.out.println("Arg is "+ arg3); } } Which command-line arguments should you pass to the program to obtain the following result? Arg is 2

    • A.

      Java MyFile 0 1 2 3

    • B.

      Java MyFile 1 3 2 2

    • C.

      Java MyFile 1 2 2 3 4

    • D.

      Java MyFile 2 2 2

    Correct Answer
    B. Java MyFile 1 3 2 2
    Explanation
    The correct answer is "java MyFile 1 3 2 2". This is because the code snippet accesses the third command-line argument (args[3]) and assigns it to the variable arg3. Therefore, in order to obtain the result "Arg is 2", the value 2 must be passed as the third command-line argument.

    Rate this question:

  • 13. 

    Given the code fragment: import java.util.ArrayList; import java.util.Arrays; import java.util.List; class D { public static void main(String[] args) { String[] arr = {"Hi", "How", "Are", "You"}; List<String> arrList = new ArrayList(Arrays.asList(arr)); if (arrList.removeIf((String s) -> {return s.length() <= 2;})){ System.out.println(s + " removed"); } } } What is the result?

    • A.

      An UnsupportedOperationException is thrown at runtime.

    • B.

      Hi removed

    • C.

      Compilation fails.

    • D.

      The program compiles, but it prints nothing.

    Correct Answer
    C. Compilation fails.
    Explanation
    The code fails to compile because the lambda expression used in the `removeIf` method is missing the parameter name. The correct syntax for the lambda expression should be `(String s) -> {return s.length()

    Rate this question:

  • 14. 

    Which three statements are true about exception handling? (Choose tree)

    • A.

      All subclasses of the Exception class except the RuntimeException class are checked exceptions.

    • B.

      The parameter in a catch block is of Throwable type.

    • C.

      All subclasses of the RuntimeException class are recoverable.

    • D.

      All subclasses of the RuntimeException class must be caught or declared to be thrown.

    • E.

      All subclasses of the Error class are checked exceptions and are recoverable.

    • F.

      Only Unchecked exceptions can be rethrown.

    Correct Answer(s)
    A. All subclasses of the Exception class except the RuntimeException class are checked exceptions.
    B. The parameter in a catch block is of Throwable type.
    C. All subclasses of the RuntimeException class are recoverable.
    Explanation
    All subclasses of the Exception class except the RuntimeException class are checked exceptions: This statement is true. Checked exceptions are exceptions that must be either caught or declared to be thrown.

    The parameter in a catch block is of Throwable type: This statement is true. The catch block can catch exceptions of any type that is a subclass of the Throwable class.

    All subclasses of the RuntimeException class are recoverable: This statement is true. RuntimeExceptions are unchecked exceptions that typically occur due to programming errors and are not expected to be recovered from.

    Rate this question:

  • 15. 

    Given: String stuff = "TV"; String res = null; if(stuff.equals("TV")){ res = "Walter"; }else if(stuff.equals("Movie")){ res = "White"; }else{ res = "No Result"; } Which code fragment can replace the if block, and it has the same effect?

    • A.

      Stuff.equals("TV") ? res = "Walter" : stuff.equals("Movie") ? res = "White": res = "No Result";

    • B.

      Res = stuff.equals("TV") ? "Walter" else stuff.equals("Movie") ? "White": "No Result";

    • C.

      Res = stuff.equals("TV") ? stuff.equals("Movie") ? "Walter" : "No Result";

    • D.

      Res = stuff.equals("TV") ? "Walter" : stuff.equals("Movie") ? "White": "No Result";

    Correct Answer
    D. Res = stuff.equals("TV") ? "Walter" : stuff.equals("Movie") ? "White": "No Result";
    Explanation
    The given code fragment can replace the if block because it uses the ternary operator to achieve the same effect. It checks if "stuff" equals "TV", and if so, assigns "Walter" to "res". If not, it checks if "stuff" equals "Movie", and if so, assigns "White" to "res". Otherwise, it assigns "No Result" to "res". This is the same logic as the original if-else if-else statement.

    Rate this question:

  • 16. 

    Given: class Tests2{ int a1; public static void doProduct(int a) { a = a * a; } public static void doString(StringBuilder s) { s.append(" "+ s); } public static void main(String[] args) { Tests2 item = new Tests2(); item.a1 = 11; StringBuilder sb = new StringBuilder("Hello"); Integer i = 10; doProduct(i); doString(sb); doProduct(item.a1); System.out.println(i+ " "+ sb + " " +item.a1); } } What is the result?

    • A.

      10 Hello Hello 121

    • B.

      10 Hello 11

    • C.

      10 Hello 12

    • D.

      10 Hello Hello 11

    Correct Answer
    D. 10 Hello Hello 11
    Explanation
    The code defines a class Tests2 with three methods: doProduct, doString, and main. In the main method, a new instance of Tests2 is created and the variable a1 is assigned the value 11. A StringBuilder object sb is also created with the initial value "Hello". An Integer object i is created with the value 10.

    The doProduct method takes an integer parameter and multiplies it by itself, but it does not modify the original value. The doString method takes a StringBuilder object and appends a space and the string representation of the object to itself.

    In the main method, the doProduct method is called with the i variable as an argument, but since it is an Integer object, it is passed by value and the original value of i is not modified. The doString method is called with the sb variable, which modifies the sb object by appending a space and itself to it. Finally, the doProduct method is called with the item.a1 variable, which modifies the value of item.a1 by squaring it.

    The result of the program is then printed, which is "10 Hello Hello 11".

    Rate this question:

  • 17. 

    Given: class Vehicle{ String type ="4W"; int maxSpeed = 100; Vehicle(String type, int maxSpeed) { this.type = type; this.maxSpeed = maxSpeed; } } class Car extends Vehicle{ String trans; Car() { //line n1 this.trans = trans; } public Car(String trans) { super("4W", 150); this.trans = trans; } Car(String type, int maxSpeed,String trans) { super(type, maxSpeed); this.trans = trans; //line n2 } } And given the code fragment: 7. Car c1 = new Car("Auto"); 8. Car c2 = new Car("4W", 150 , "Manual"); 9. System.out.println(c1.type + " " + c1.maxSpeed + " "+ c1.trans); 10. System.out.println(c2.type + " " + c2.maxSpeed + " "+ c2.trans); What is the result?

    • A.

      4W 150 Manual 4W 150 Auto

    • B.

      Compilation fails in line n1.

    • C.

      4W 150 Auto 4W 150 Manual

    • D.

      Compilation fails in line n2.

    Correct Answer
    B. Compilation fails in line n1.
    Explanation
    The code fails to compile at line n1 because the default constructor in the Car class does not initialize the "trans" variable. The "trans" variable is then used in line n1 without being initialized, causing a compilation error.

    Rate this question:

  • 18. 

    Given the code fragment: import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; class R { public static void main(String[] args) { LocalDateTime dt = LocalDateTime.of(2014, 7, 31, 1, 1); dt.plusDays(30); dt.plusMonths(1); System.out.println(dt.format(DateTimeFormatter.ISO_DATE)); } } What is the result?

    • A.

      2014-09-30

    • B.

      2014-07-31

    • C.

      07-31-2014

    • D.

      An exception is thrown at runtime.

    Correct Answer
    B. 2014-07-31
    Explanation
    The code creates a LocalDateTime object with the date and time set to July 31, 2014, 1:01 AM. The code then calls the plusDays(30) and plusMonths(1) methods on the LocalDateTime object, which returns a new LocalDateTime object with the specified number of days and months added. However, the code does not assign the new LocalDateTime objects to any variable, so the original dt object remains unchanged. Finally, the code prints the date in ISO_DATE format, which is "yyyy-MM-dd". Therefore, the result is "2014-07-31".

    Rate this question:

  • 19. 

    Given the code fragment: class CCMask{ public static String maskCC(String creditCard) { String x = "XXXX-XXXX-XXXX-"; //line n1 } public static void main(String[] args) { System.out.println(maskCC("1234-5678-9101-1121")); } } You must ensure that the maskCC method returns a string that hides all digits of the credit of except the four last digits (and the hyphens that separate each group of the four digits). Which two code fragments should you use at line n1, independently to achieve this required?

    • A.

      StringBuilder sb = new StringBuilder(x); sb.append(creditCard, 15, 19); return sb.toString();

    • B.

      StringBuilder sb = new StringBuilder(creditCard); sb.subString(creditCard, 15, 19); return x + sb;

    • C.

      return x + creditCard.substring(15, 19);

    • D.

      StringBuilder sb = new StringBuilder(creditCard); StringBuilder s = sb.insert(0, x); return s.toString();

    Correct Answer(s)
    A. StringBuilder sb = new StringBuilder(x); sb.append(creditCard, 15, 19); return sb.toString();
    C. return x + creditCard.substring(15, 19);
    Explanation
    The first code fragment creates a StringBuilder object with the initial value of "XXXX-XXXX-XXXX-". It then appends a substring of the creditCard string, starting from index 15 and ending at index 19 (which represents the last four digits of the credit card number). Finally, it returns the resulting string.

    The second code fragment directly concatenates the "XXXX-XXXX-XXXX-" string with a substring of the creditCard string, starting from index 15 and ending at index 19. It then returns the resulting string.

    Both code fragments achieve the required result of hiding all digits of the credit card number except the last four digits.

    Rate this question:

  • 20. 

    Which two statements are true?

    • A.

      Error class is unextendible.

    • B.

      Error is a RuntimeException.

    • C.

      Error is an Exception.

    • D.

      Error is a Throwable.

    • E.

      Error class is extendable.

    Correct Answer(s)
    D. Error is a Throwable.
    E. Error class is extendable.
    Explanation
    The given answer is correct because Error is a subclass of Throwable, which means it is a type of throwable object that can be thrown and caught in Java. Additionally, the Error class is extendable, meaning it can be subclassed to create new error classes with specific functionalities.

    Rate this question:

  • 21. 

    You are asked to create a method that accepts an array of integers and returns the highest value from that array. Given the code fragment: class Test{ public static void main(String[] args) { int numbers[] = {12, 13, 42, 32, 15, 156, 23, 51, 12}; int max = findMax(numbers); } /* line n1*/{ int max = 0; /*code goes here*/ return max; } } Which method signature do you use at line n1?

    • A.

      Static int[] findMax(int max)

    • B.

      Static int findMax(int[] numbers)

    • C.

      Final int[] findMax(int [] a)

    • D.

      Public int findMax(int[] numbers)

    Correct Answer
    B. Static int findMax(int[] numbers)
    Explanation
    The correct method signature to use at line n1 is "static int findMax(int[] numbers)". This is because the method is expected to accept an array of integers as a parameter and return an integer value, which matches the method signature "int[] numbers".

    Rate this question:

  • 22. 

    Which two statements are true about a Java class?

    • A.

      The main method can be overloaded.

    • B.

      A class must be kept in a package to compile and run successfully.

    • C.

      A class must contain at least an instance variable declaration and an empty constructor.

    • D.

      The Object class is the root of the class hierarchy.

    • E.

      A main method must be declared in the class.

    • F.

      A top-level class can be declared with the access modifiers private, public or protected.

    Correct Answer(s)
    A. The main method can be overloaded.
    D. The Object class is the root of the class hierarchy.
    Explanation
    The main method can be overloaded, which means that multiple main methods can exist in a Java class with different parameter lists. This allows for flexibility in how the main method is used.

    The Object class is the root of the class hierarchy in Java. This means that all other classes in Java are either directly or indirectly derived from the Object class. This hierarchy allows for the inheritance and polymorphism features in Java.

    Rate this question:

  • 23. 

    Given the code fragment: public static void main(String[] args) { int [] stack = {10,20,30}; int size = 3; int idx = 0; /*line n1*/ System.out.println("The Top element: "+ stack[idx]); } Which code fragment, inserted at line n1, prints the Top element: 30?

    • A.

      while (idx <= size - 1){ idx++; }

    • B.

      do { idx++; } while (idx <= size);

    • C.

      while (idx < size) { idx++; }

    • D.

      do { idx++; } while (idx >= size);

    • E.

      do { idx++; } while (idx < size -1);

    Correct Answer
    E. do { idx++; } while (idx < size -1);
    Explanation
    The code fragment "do { idx++; } while (idx < size -1);" will print the top element as 30. This is because the code initializes the index variable "idx" to 0 and then increments it by 1 inside the do-while loop until it reaches the value of "size - 1" (which is 2 in this case). Since the index of the element 30 in the array is 2, this loop will continue until idx is incremented to 2, and then it will exit the loop. Finally, the value at the index 2 in the "stack" array will be printed, which is 30.

    Rate this question:

  • 24. 

    Given: class Equal{ public static void main(String[] args) { String str1 = "Java"; String [] str2 = {"J", "a", "v", "a"}; String str3= ""; for (String str : str2) { str3 = str3 + str; } boolean b1= (str1 == str3); boolean b2= (str1.equals(str3)); System.out.print(b1+ ", "+b2); } } What is the result?

    • A.

      True, true

    • B.

      True, false

    • C.

      False, true

    • D.

      False, false

    Correct Answer
    C. False, true
    Explanation
    The result of the code is false, true. This is because the == operator in Java compares the references of two objects, not their content. In this case, str1 and str3 are two different objects, even though their content is the same. Therefore, b1 is false. On the other hand, the equals() method compares the content of two objects. Since str1 and str3 have the same content ("Java"), b2 is true.

    Rate this question:

  • 25. 

    Given the following class: public class Rectangle{ private double length; private double height; private double area; public void setLength(double length) { this.length = length; } public void setHeight(double height) { this.height = height; } public void setArea() { this.area = length * height; } } Which two changes would encapsulate this class and ensure that the area field is always equals to length * height whenever the Rectangle class is used?

    • A.

      Change the setArea methods to private.

    • B.

      Change the area field to public.

    • C.

      Call the setArea method at the beginning of the setLenght method.

    • D.

      Call the setArea method at the end of the setLenght method.

    • E.

      Call the setArea method at the beginning of the setHeight method.

    • F.

      Call the setArea method at the end of the setHeight method.

    Correct Answer(s)
    D. Call the setArea method at the end of the setLenght method.
    F. Call the setArea method at the end of the setHeight method.
    Explanation
    The correct answer is to call the setArea method at the end of the setLength method and at the end of the setHeight method. This ensures that whenever the length or height of the rectangle is set, the area is automatically updated to be equal to the product of the length and height. By calling the setArea method at the end of both setLength and setHeight, we guarantee that the area is always calculated correctly and encapsulated within the class.

    Rate this question:

  • 26. 

    Given the code fragment: import java.time.LocalDate; class Date{ public static void main(String[] args) { LocalDate date = LocalDate.of(2012, 01, 32); date.plusDays(10); System.out.println(date); } } What is the result?

    • A.

      A DateTimeException is thrown at runtime.

    • B.

      Compilation fails.

    • C.

      2012-02-10

    • D.

      2012-02-11

    Correct Answer
    A. A DateTimeException is thrown at runtime.
    Explanation
    The code attempts to create a LocalDate object with the date 2012-01-32, which is an invalid date. This will result in a DateTimeException being thrown at runtime. The code then calls the plusDays() method on the date object, but since LocalDate objects are immutable, the method does not modify the original date object. Therefore, the output will still be the invalid date 2012-01-32.

    Rate this question:

  • 27. 

    Given the code fragment: class TestA{ static int count = 0; int i = 0; public void changeCount(){ while(i < 5){ i++; count++; } } public static void main(String[] args) { TestA check1 = new TestA(); TestA check2 = new TestA(); check1.changeCount(); check2.changeCount(); System.out.println(check1.count + " : "+ check2.count); } } What is the result?

    • A.

      5 : 5

    • B.

      10 : 10

    • C.

      5: 10

    • D.

      Compilation fails.

    Correct Answer
    B. 10 : 10
    Explanation
    The result is 10 : 10 because the variable "count" is declared as static, which means it is shared among all instances of the TestA class. Both check1 and check2 call the changeCount() method, which increments the "count" variable by 5 each time. Therefore, the final value of "count" is 10 for both check1 and check2.

    Rate this question:

  • 28. 

    Given the code fragment: class Z{ public static void main(String[] args) { int ii = 0; int jj = 7; for ( ii = 0; ii < jj - 1; ii = ii +2) { System.out.println(ii + " "); } } } What is the result?

    • A.

      2 4

    • B.

      0 2 4 6

    • C.

      0 2 4

    • D.

      Compilations fails.

    Correct Answer
    C. 0 2 4
    Explanation
    The code fragment initializes ii to 0 and jj to 7. The for loop condition checks if ii is less than jj - 1, which is true since 0 is less than 6. Inside the loop, ii is incremented by 2. So, the loop will execute with ii values of 0, 2, and 4. The println statement prints the value of ii followed by a space. Therefore, the result will be "0 2 4".

    Rate this question:

  • 29. 

    Given the code fragment: public static void main(String[] args) { int array[] = { 0, 20, 30, 40, 50}; int x= array.length; /*line n1*/ } Which two code fragments can be independently inserted at line n1 enable the code to print the elements of the array in reverse order? (Choose two)

    • A.

      while (x >= 0) { System.out.print(array[x]); x--; }

    • B.

      do { x--; System.out.print(array[x]); } while ( x >= 0);

    • C.

      do { System.out.print(array[x]); --x; } while (x >= 0);

    • D.

      while(x > 0) { x--; System.out.print(array[x]); }

    • E.

      while (x > 0 ) { System.out.print(array[--x]); }

    Correct Answer(s)
    D. while(x > 0) { x--; System.out.print(array[x]); }
    E. while (x > 0 ) { System.out.print(array[--x]); }
    Explanation
    The two code fragments that can be independently inserted at line n1 to print the elements of the array in reverse order are:

    1. while(x > 0) {
    x--;
    System.out.print(array[x]);
    }

    This code fragment uses a while loop to decrement the value of x and print the element at index x of the array. It continues until x becomes 0.

    2. while (x > 0 ) {
    System.out.print(array[--x]);
    }

    This code fragment also uses a while loop, but it decrements the value of x and then immediately uses the updated value to print the element at index x of the array. It continues until x becomes 0.

    Rate this question:

  • 30. 

    Given the code fragment: public static void main(String[] args) { int data[] = {2010, 2013, 2014, 2015, 2014}; int key = 2014; int count = 0; for (int e : data) { if(e!= key){ continue; count++; } } System.out.print(count+ " Found"); } What is the result?

    • A.

      Compilations fails.

    • B.

      0 Found

    • C.

      1 Found

    • D.

      3 Found

    Correct Answer
    A. Compilations fails.
    Explanation
    The code will not compile because there is a syntax error in the line "System.out.print(count+ " Found");" The quotation marks are not properly closed, causing a compilation error.

    Rate this question:

  • 31. 

    Given: A.java: class A{ public void test(){ System.out.println("A "); } } B.java: class B extends A{ public void test(){ System.out.println("B "); } } C.java: class C extends A{ public void test(){ System.out.println("C "); } public static void main(String[] args) { A b1 = new A(); A b2 = new C(); b1 = (A) b2; //line n1 A b3 = (B) b2; //line n2 b1.test(); b3.test(); } } What is the result?

    • A.

      Compilations fails at line n2.

    • B.

      Compilations fails at line n1.

    • C.

      Throw a ClassCastException at Runtime at line n2.

    • D.

      Throw a ClassCastException at Runtime at line n1.

    • E.

      A A

    • F.

      A C

    Correct Answer
    C. Throw a ClassCastException at Runtime at line n2.
    Explanation
    The code compiles without any errors. However, at line n2, a ClassCastException is thrown at runtime because b2 is an instance of class C and cannot be cast to class B.

    Rate this question:

  • 32. 

    Given the code fragment: class TT{ public static void main(String[] args) { String names[] = {"Thomas", "Peter", "Joseph"}; String pwd[] = new String[3]; int idx = 0; try { for (String n : names) { pwd[idx] = n.substring(2, 6); idx++; } } catch (Exception e) { System.out.println("Invalid Names"); } for (String p : pwd) { System.out.println(p); } } } What is the result?

    • A.

      Invalid Names omas null null

    • B.

      Invalid Names

    • C.

      Invalid Names omas

    • D.

      Omas

    Correct Answer
    A. Invalid Names omas null null
    Explanation
    The code attempts to assign substrings of length 4 from each name in the "names" array to corresponding positions in the "pwd" array. However, the substring method is called with indices 2 and 6, which is out of bounds for the names "Thomas" and "Joseph". This causes an exception to be thrown and the catch block is executed, printing "Invalid Names". Since the exception is caught, the code continues to execute and the "pwd" array remains uninitialized, resulting in null values being printed for the remaining elements.

    Rate this question:

  • 33. 

    Given the code fragment: int wd = 0; String days[] = {"sun", "mon", "wed", "sat"}; for(String s: days){ switch (s) { case "sun": wd -= 1; break; case "mon": wd++; case "wed": wd +=2; } } System.out.println(wd); What is the result?

    • A.

      Compilation fails.

    • B.

      -1

    • C.

      4

    • D.

      3

    Correct Answer
    C. 4
    Explanation
    The code fragment initializes the variable "wd" to 0 and creates an array of strings named "days". It then uses a for-each loop to iterate through each string in the "days" array.

    Inside the loop, there is a switch statement that checks the value of each string. If the string is "sun", it subtracts 1 from "wd". If the string is "mon", it adds 1 to "wd" and falls through to the next case. If the string is "wed", it adds 2 to "wd".

    Since the loop iterates through all the strings in the "days" array, the switch statement will execute for each string. Therefore, the final value of "wd" will be 4.

    Rate this question:

  • 34. 

    Given: class TestB{ int x,y; public TestB(int x, int y){ initialize(x,y); } public void initialize(int x, int y){ this.x = x * x; this.y = y * y; } public static void main(String[] args) { int x =3,y =5; TestB obj = new TestB(x,y); System.out.println(x+ " "+ y); } } What is the result?

    • A.

      3 5

    • B.

      9 25

    • C.

      0 0

    • D.

      Compilation fails.

    Correct Answer
    A. 3 5
    Explanation
    The result is 3 5 because the main method initializes variables x and y with the values 3 and 5 respectively. Then, a new object of the TestB class is created with these values. The initialize method of the TestB class assigns the square of x (9) to the instance variable x and the square of y (25) to the instance variable y. However, the print statement in the main method prints the original values of x and y, which are 3 and 5 respectively.

    Rate this question:

  • 35. 

    Given: class Test{ public static void main(String[] args) { int numbers[]; numbers = new int[2]; numbers[0] = 10; numbers[1] = 20; numbers = new int[4]; numbers[2] = 30; numbers[3] = 40; for (int x : numbers) { System.out.print(" " + x); } } } What is the result?

    • A.

      Compilation fails.

    • B.

      10 20 30 40

    • C.

      0 0 30 40

    • D.

      An exception is thrown at runtime.

    Correct Answer
    C. 0 0 30 40
    Explanation
    The code creates an array of integers called "numbers" with a length of 2. It then assigns values to the first two elements of the array. However, it then reassigns the "numbers" variable to a new array with a length of 4. This means that the previous values assigned to the array are lost. The code then assigns values to the third and fourth elements of the new array. Finally, it uses a for-each loop to print out the elements of the array. Since the first two elements were not assigned new values, they remain as the default value of 0. Therefore, the result is "0 0 30 40".

    Rate this question:

  • 36. 

    Given: import java.util.ArrayList; import java.util.List; class Patient{ String name; public Patient(String name) { this.name = name; } } And the code fragment: class Test{ public static void main(String[] args) { List ps = new ArrayList(); Patient p2 = new Patient("Mike"); ps.add(p2); //insert code here if(f>=0){ System.out.println("Mike found"); } } } Which code fragment, when inserted at line 14, enables the code to print Mike found?

    • A.

      Int f = ps.indexOf(new Patient("Mike"));

    • B.

      Int f = ps.indexOf(Patient("Mike"));

    • C.

      Patietn p = new Patient("Mike"); int f = ps.indexOf(p);

    • D.

      Int f = ps.indexOf(p2);

    Correct Answer
    D. Int f = ps.indexOf(p2);
    Explanation
    The correct answer is "int f = ps.indexOf(p2);" because it assigns the index of the object "p2" in the list "ps" to the variable "f". This allows the code to check if "Mike" is found in the list by checking if "f" is greater than or equal to 0. If "f" is greater than or equal to 0, it means that "Mike" is found in the list and the code will print "Mike found".

    Rate this question:

  • 37. 

    Which two class definitions fail to compile?

    • A.

      final abstract class A5{ protected static int i; void doStuff(){} abstract void doIt(); }

    • B.

      abstract class A3{ private static int i; public void doStuff(){} public A3(){} }

    • C.

      final class A1{ public A1(){} }

    • D.

      public class A2{ private static int i; private A2(){} }

    • E.

      class A4{ protected static final int m; private void doStuff(){} }

    Correct Answer(s)
    A. final abstract class A5{ protected static int i; void doStuff(){} abstract void doIt(); }
    E. class A4{ protected static final int m; private void doStuff(){} }
    Explanation
    The first class definition fails to compile because a class cannot be both final and abstract at the same time. The second class definition fails to compile because a final variable must be initialized when it is declared, but the variable "m" is not initialized.

    Rate this question:

  • 38. 

    Given the code from the Greeting.java file: public class Greeting{ public static void main(String[] args) { System.out.println("Hello "+ args[0]); } } Which set of commands prints Hello Duke in the console?

    • A.

      Javac Greeting java Greeting Duke

    • B.

      Javac Greeting.java Duke java Greeting

    • C.

      Javac Greeting.java java Greeting Duke

    • D.

      Javac Greeting.java java Greeting.class Duke

    Correct Answer
    C. Javac Greeting.java java Greeting Duke
    Explanation
    The set of commands "javac Greeting.java" compiles the Greeting.java file into bytecode, and "java Greeting Duke" executes the compiled bytecode, resulting in the output "Hello Duke" printed in the console.

    Rate this question:

  • 39. 

    Given the code fragments: interface Exportable{ void export(); } class Tool implements Exportable{ protected void export(){ //line n1 System.out.println("Tool::export"); } } class ReportTool extends Tool implements Exportable{ public void export(){ //line n2 System.out.println("Rtool::export"); } public static void main(String[] args) { Tool aTool = new ReportTool(); Tool bTool = new Tool(); callExport(aTool); callExport(bTool); } public static void callExport(Exportable ex){ ex.export(); } } What is the result?

    • A.

      Compilation fails at both n1 and line n2.

    • B.

      Compilation fails at line n1.

    • C.

      Compilation fails at line n2.

    • D.

      Rtool::export

    • E.

      Tool::export

    Correct Answer
    B. Compilation fails at line n1.
    Explanation
    The code fails to compile at line n1 because the method "export" in the "Tool" class is declared as protected, which means it can only be accessed within the same package or by subclasses. However, in the "ReportTool" class, which is a subclass of "Tool", the "export" method is declared as public. This violates the rule of overriding methods, where the access level of the overridden method must be the same or more accessible than the original method. Therefore, the code fails to compile at line n1.

    Rate this question:

  • 40. 

    Given the following code: public static void main(String[] args) { String[] planets = {"Mercury", "Venus", "Earth", "Mars"}; System.out.println(planets.length); System.out.println(planets[1].length()); } What is the output?

    • A.

      4 21

    • B.

      4 5

    • C.

      5 4

    • D.

      3 5

    • E.

      4 4

    • F.

      4 4

    • G.

      4 7

    • H.

      4 7

    Correct Answer
    B. 4 5
    Explanation
    The code initializes an array named "planets" with four elements: "Mercury", "Venus", "Earth", and "Mars". The first line of output prints the length of the array, which is 4. The second line of output prints the length of the element at index 1 of the array, which is "Venus". The length of "Venus" is 5, so the output is 4 and 5.

    Rate this question:

  • 41. 

    Which statement will empty the contents of a StringBuilder variable named sb?

    • A.

      Sb.deleteAll();

    • B.

      Sb.delete(0,sb.length());

    • C.

      Sb.delete(0,sb.size());

    • D.

      Sb.removeAll();

    Correct Answer
    B. Sb.delete(0,sb.length());
    Explanation
    The correct answer is sb.delete(0,sb.length()). This statement will delete all the characters in the StringBuilder variable named sb by specifying the range from index 0 to the length of the StringBuilder.

    Rate this question:

  • 42. 

    Given the code fragment: public static void main(String[] args) { double discount = 0; int qty= Integer.parseInt(args[0]); //line n1 } And given the requirements: * if the value of the qty variable is greater than or equal to 90 discounts = 0.5 * if the value of the qty variable is between 80 and 90 discounts = 0.2 Which two code fragments can be independently placed at line n1 to meet the requirements?

    • A.

      if (qty >= 90){ discount = 0.5; } if (qty > 80 && qty <90){ discount = 0.2; }

    • B.

      discount = (qty >= 90) ? 0.5 : 0 ; discount =(qty > 80) ? 0.2 : 0;

    • C.

      discount = (qty >=90 )? 0.5 : (qty > 80)? 0.2 : 0;

    • D.

      if(qty > 80 || qty <90){ discount = 0.2; }else{ discount = 0; } if(qty >= 90){ discount = 0.5; } else{ discount = 0; }

    Correct Answer(s)
    A. if (qty >= 90){ discount = 0.5; } if (qty > 80 && qty <90){ discount = 0.2; }
    C. discount = (qty >=90 )? 0.5 : (qty > 80)? 0.2 : 0;
    Explanation
    The first code fragment checks if the value of qty is greater than or equal to 90, and if it is, it sets the discount to 0.5. The second code fragment checks if the value of qty is between 80 and 90, and if it is, it sets the discount to 0.2. Both of these code fragments independently meet the requirements specified in the question. The third code fragment is also correct as it uses a ternary operator to set the discount based on the value of qty.

    Rate this question:

  • 43. 

    Given the code fragment: public static void main(String[] args) { boolean opt = true; //line 5 switch (opt) { case true: // line 7 System.out.print("True");; break; //line 9 default: System.out.print("***");; } System.out.print("Done"); } Which modification enables the code fragment to print TrueDone?

    • A.

      Replace line 5 with String opt = "true"; Replace line 7 with case "true":

    • B.

      Replace line 5 with String opt = 1; Replace line 7 with case 1:

    • C.

      At line 9, remove the break statement.

    • D.

      Remove the default section.

    Correct Answer
    A. Replace line 5 with String opt = "true"; Replace line 7 with case "true":
    Explanation
    The code fragment is using a switch statement to check the value of the boolean variable "opt". In order for the code to print "TrueDone", the value of "opt" needs to be a string "true" instead of a boolean true. Therefore, replacing line 5 with String opt = "true" will enable the code fragment to print "TrueDone". Additionally, replacing line 7 with case "true": ensures that the switch case matches the string value of "opt".

    Rate this question:

  • 44. 

    Given: class Vehicle{ int x; Vehicle(){ this(10); //line n1 } Vehicle(int x){ this.x = x; } } class Car extends Vehicle{ int y; Car(){ super(); this(20); //line n2 } Car(int y){ this.y = y; //line n3 } public String toString(){ return super.x + " : " + this.y; } } And given the code fragment: Vehicle y = new Car(); System.out.println(y); What is the result?

    • A.

      10 : 0

    • B.

      0 : 0

    • C.

      Compilation fails on line n1.

    • D.

      Compilation fails on line n2.

    • E.

      Compilation fails on line n3.

    Correct Answer
    D. Compilation fails on line n2.
    Explanation
    The code will fail to compile on line n2 because the constructor in the Car class is calling both the default constructor of the superclass (Vehicle) using the super() keyword and another constructor in the Car class using this(20). This is not allowed as per the Java language rules. The super() call should be the first statement in the constructor.

    Rate this question:

  • 45. 

    Given: class TestString { public static int stVar = 100; public int var = 200; @Override public String toString() { return var + ": " + stVar; } } And given the code fragment: public static void main(String[] args) { TestString t1 = new TestString(); t1.var = 300; System.out.println(t1); TestString t2 = new TestString(); t2.stVar = 300; System.out.println(t2); } What is the result?

    • A.

      200: 300 200: 300

    • B.

      300: 0 0: 300

    • C.

      300: 300 200: 300

    • D.

      300: 100 200: 300

    Correct Answer
    D. 300: 100 200: 300
    Explanation
    The code creates two instances of the TestString class, t1 and t2.

    In the first instance, t1, the var variable is assigned a value of 300.

    When the toString() method is called on t1, it returns the value of var (300) followed by a colon and the value of the static variable stVar (100).

    In the second instance, t2, the static variable stVar is assigned a value of 300.

    When the toString() method is called on t2, it returns the value of var (200) followed by a colon and the value of the static variable stVar (300).

    Therefore, the result is "300: 100" for t1 and "200: 300" for t2.

    Rate this question:

  • 46. 

    Given the code fragment: public static void main(String[] args) { String myStr = "Hello World "; myStr.trim(); int i1 = myStr.indexOf(" "); System.out.println(i1); } What is the result?

    • A.

      An exception is thrown at runtime.

    • B.

      -1

    • C.

      5

    • D.

      0

    Correct Answer
    C. 5
    Explanation
    The code fragment initializes a string variable "myStr" with the value "Hello World ". The trim() method is called on "myStr", which removes any leading or trailing whitespace from the string. However, the result of the trim() method is not assigned to any variable, so the original value of "myStr" remains unchanged. The indexOf() method is then called on "myStr" to find the index of the first occurrence of a space character. Since the space character is at index 5 in the original string, the result of the indexOf() method is 5. Therefore, the correct answer is 5.

    Rate this question:

  • 47. 

    Given: class C2{ public void displayC2(){ System.out.print("c2"); } } interface I{ public void displayI(); } class C1 extends C2 implements I{ public void displayI(){ System.out.println("c1"); } } And given the code fragment: C2 obj1 = new C1(); I obj2 = new C1(); C2 s = obj2; I t = obj1; t.displayI(); s.displayC2(); What is the result?

    • A.

      C2c2

    • B.

      C1c2

    • C.

      Compilations fails.

    • D.

      Thrown an exception at runtime.

    Correct Answer
    C. Compilations fails.
    Explanation
    The code will fail to compile because the reference variable 's' of type C2 cannot access the method displayC2() since it is not defined in the interface I.

    Rate this question:

  • 48. 

    Given: class Student{ String name; public Student(String name) { this.name = name; } } class TestS{ public static void main(String[] args) { Student[] students = new Student[3]; students[1] = new Student("Richard"); students[2] = new Student("Donald"); for (Student s : students) { System.out.println("" + s.name); } } } What is the result?

    • A.

      Thrown an exception at runtime.

    • B.

      Richard Donald

    • C.

      Null Richard Donald

    • D.

      Compilation fails.

    Correct Answer
    A. Thrown an exception at runtime.
    Explanation
    The code will throw a NullPointerException at runtime. This is because the array students is declared with a size of 3, but only two elements are initialized. The first element remains null, so when the for loop tries to access the name of the first element, it throws a NullPointerException.

    Rate this question:

  • 49. 

    Given: public class App{ int count; public static void displayMsg() { count++; // line n1 System.out.println("Welcome "+ "Visit Count: "+count); // line n2 } public static void main(String[] args) { App.displayMsg(); // line n3 App.displayMsg(); // line n4 } } What is the result?

    • A.

      Welcome Visit Count: 1 Welcome Visit Count: 2

    • B.

      Welcome Visit Count: 1 Welcome Visit Count: 1

    • C.

      Compilation fails at line n1 and line n1 and line n2.

    • D.

      Compilation fails at line n3 and line n3 and line n4.

    Correct Answer
    C. Compilation fails at line n1 and line n1 and line n2.
    Explanation
    The code fails to compile because the variable "count" is not declared as static. The "displayMsg" method is a static method, meaning it can be called without creating an instance of the class. However, the non-static variable "count" cannot be accessed from a static context. To fix this, the "count" variable should be declared as static.

    Rate this question:

  • 50. 

    Given: class Test{ public int MIN = 1; public static void main(String[] args) { Test t = new Test(); int x = args.length; if (t .checkLimit(x)){ //line n1 System.out.println("Java SE"); } else{ System.out.println("Java EE"); } } public boolean checkLimit(int x) { return (x >= MIN ) ? true : false; } } And given the commands: javac Test.java java Test What is the result?

    • A.

      A NullPointerException is thrown at runtime.

    • B.

      Java EE

    • C.

      Java SE

    • D.

      Compilation fails at line n1.

    Correct Answer
    B. Java EE
    Explanation
    The code first creates an instance of the Test class. Then, it retrieves the length of the args array and assigns it to the variable x. The checkLimit() method is called with x as the argument. If x is greater than or equal to the MIN variable (which is 1), the method returns true. In this case, since the length of the args array is not specified when running the program, x will be 0. Therefore, the checkLimit() method will return false. As a result, the program will print "Java EE" to the console.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 09, 2018
    Quiz Created by
    Catherine Halcomb
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.