Test your basic knowledge |

Object Oriented Programming

Subject : it-skills
Instructions:
  • Answer 50 questions in 15 minutes.
  • If you are not ready to take this test, you can study here.
  • Match each statement with the correct term.
  • Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.

This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. Constructor: creates a new pseudorandom number generator.






2. A ____________ and definition always give the parameter list in parentheses after the method name. if there are no parameters - an empty set of parentheses is used






3. After an object has been instantiated - we set the _________ to access its methods






4. A set of classes that supports the development of programs






5. The classes of the Java standard class library are grouped into __________.






6. This declaration creates a Scanner object that reads input from the keyboard






7. The values it stores internally - which may be represented as primitive data or as other objects. for example - a bank account object can store a floating point number (a primitive value) that represents the balance of the account. it can also contai






8. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.






9. Also called a selection statement b/c it allows us to choose which statement will be executed next.






10. A special method that has the same name as the class. After the "new" operator creates the object it is invoked to help set it up initially






11. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)






12. A value that is passed into a method when it is invoked






13. Specifies the packages and classes that will be used in a program so that the fully qualified name is not necessary with each reference.






14. Delimited by double quotation characters






15. Each piece of data that we send to a method






16. Changes a particular value - e.g.setX - where X is the value they are setting.






17. The one that is invoked






18. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.






19. Methods in the Math class are ______






20. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.






21. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;






22. A Java operator that is specified by a type name in parentheses; truncates rather than rounds; useful in division if u want an integer to be treated as a float or double






23. When a variable is declared inside a method






24. The location at which a variable is declared defines its scope - which is the area within a program in which the variable can be referenced.






25. Two floating data types: float - _______






26. Part of the java.util class; picks a number at random out of a range of values.






27. _____ expression evaluated first






28. Returns the int corresponding to the value stored in the specified string






29. Since an object ref var holds the address of the object - it can be thought of as a ____ to the location in memory where the object is held






30. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.






31. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked






32. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________






33. Expressed in a Java program with single quotes






34. Widening byte: _________ - to int - to long - to float - to double






35. Instructs the compiler to reserve a portion of main memory space large enough to hold a particular type of value and indicates the name by which we refer to that location






36. Returns the next input token as the indicated type.






37. A group of programming statements that is given a name. when a method is invoked - its statements are executed. a set of methods is associated with an object and defines its potential behaviors. to define the ability to make a deposit into a bank acc






38. The declarations of object variables have a similar structure to the declaration of _______________






39. A name for a location in memory used to hold a data value.






40. System.out object represents an output device or file; we send the println message to the System.out object to request that some text be printed






41. Return type specified in the method header can be a primitive type - class name or the ________; when a method does not return any value - void is used as the return type - as is always done with the main method.






42. A variable that refers to an object must be __________






43. The blueprint of an object. establishes the kind of data an object of that type will hold and defines the methods that represent the behavior of such objects. however - a class contains no space to store data. each object has space for its own data -






44. Modifier>type/void>identifier>parameters>method body






45. When two variables contain the same address and therefore refer to the same object; one important implication of _________ is that when we use one ref to change an object - it is also changed for the other reference because there is really only one o






46. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.






47. New memory space is reserved for that variable every time an instance of the class that is created.






48. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.






49. Four integer data types: byte - short - int - _____






50. Returns a new string consisting of this string concatenated with str.