AP Review Terms, Graded Quiz 1

21 Questions | Total Attempts: 36

SettingsSettingsSettings
AP Quizzes & Trivia

Basic concepts for the AP exam.


Questions and Answers
  • 1. 
    This item:
    • is  a constant
    • holds the largest value for the int data type
  • 2. 
    This item:
    1. is a constant
    2. holds the smalles value for the int data type
  • 3. 
    This item:
    • is a variable that is connected to the whole class, not individual objects
    • all variables of the one class can share this variable
    • with the keyword final, it is used to create a constant
  • 4. 
    This item:
    • is the keyword used to make a variable a constant
  • 5. 
    This item:
    • is a resizable array
    • uses the List interface
    • only holds objects
    • built-in methods for inserting, deleting
    • can use the for-each loop or a for loop
  • 6. 
    Int x = 9; x = x/2; What does x equal?
  • 7. 
    String s = "tomboy"; what is: s.substring(1,4);
  • 8. 
    Int x = 25 % 6; what is x?
  • 9. 
    Which is correct? A.  int x = (double)4.5; B.  int x = (int) 4.5; C. int x = 4.5;
  • 10. 
    String w = "ans: "+4+5; What is w?
  • 11. 
    This item:
    • implements  the Comparable interface
    • includes the following methods:  toString(), toUpperCase(), toLowerCase()
  • 12. 
    What are: A.  \\ B.  \n C.  \"
  • 13. 
    Java doesn't always test both halves of a boolean operation. && - if the first part is false, the whole thing will be false || - if the first part is true, the whole thing will be true
  • 14. 
    What is output from this loop? for(int a=0;a<10;a++) {    for(int b=a;b<10;b+-a)      System.out.print(b);   System.out.println(); }
  • 15. 
    Why is it best to use .equals instead of == with objects (check all that apply)
    • A. 

      == only does a test for equality on primitives

    • B. 

      == tests only for the values of the objects

    • C. 

      .equals tests the memory address of objects

    • D. 

      .equals tests the primitives located at the memory address of objects

  • 16. 
    This Java principle allows for the following: many methods in the same class can have the same name Java can tell the methods apart using the signature the signature of the method must have different parameters
  • 17. 
    Wrapper class that holds ints Used to store ints in an ArrayList
  • 18. 
    An arracy can hold primitive or class types all elements are of the same type not resizable
  • 19. 
    Creates a reference to an object in memory Calls the constructor 
  • 20. 
    Builds an object in memory Sets up all the variables in the object has the same name as the class
  • 21. 
    Means a method does not return a value