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. The order in which statements are executed in a running program






2. 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






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






4. 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.






5. Defined and then used as the type of a variable when it is declared; establishes all possible values of a variable of that type by listing - or enumerating - them.






6. They clarify the role a certain number has in the program.






7. Control access to the members of a class. the reserved words public and private are visibility modifiers that can be applied to the variables and methods of a class.






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






9. 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






10. We use an object when we have a _________ to it






11. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.






12. Expressed in a Java program with single quotes






13. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type






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






15. Three ways in which Java conversions occur: _________ conversion - promotion - casting






16. All wrapper classes are defined in ___________






17. White space characters such as space characters - tabs - and new lines that separate the elements of input






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






19. Constructor: creates a new pseudorandom number generator.






20. Declared in a class but not inside any particular method






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






22. Two floating data types: float - _______






23. Returns the number of characters in this stirng.






24. Constructors do not even _______; therefore they cannot return a value.






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






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






27. All numeric types are _______ - meaning both positive and negative values can be stored in them






28. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight






29. Protection and management of an object's info. this implies that the object should be self-governing. the only changes made to the state of the object should be accomplished by that object's methods. other objects should not be able to "reach in" to






30. Cast operator has _________ precedence to division






31. ______________ operators have higher precedence






32. Returns the next input token as a character string.






33. Returns all input remaining on the current line as a character string.






34. Provide various methods related to the management of the associated primitive type. Used when we create an object that serves as a container to hold various types of other objects - and we want the object to hold a simple integer value. In this case






35. In the header of a method specifies he types of the values that are passed and the names by which the called method will refer to those values.






36. How classes are created from other classes. the definition of one class can be based on another class that already exists. inheritance is a form of software reuse - capitalizing on the similarities between various kinds of classes that we want to cre






37. 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






38. Part of the standard Java class library - provides convenient methods for reading input values of various types. the input can come from various sources - including data typed interactively by the user or data stored in a file; the Scanner class can






39. Count++; count--






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






41. When a variable is declared inside a method






42. 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 -






43. Instance data should be defined with what________ visibility






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






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






46. An object in Java - defined by the class String






47. Represents either a primitive value or an object






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






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






50. A ________________ is immutable.