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. A method that returns a value must have a _________






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






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






4. Returns a string containing the specified number formatted according to this object's pattern.






5. ____________ is instantiated in the traditional way using the new operator.






6. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar






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






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






9. Attempts to find the next occurence of the specified pattern - ignoring delimiters






10. Elements of input






11. ______________ operators have higher precedence






12. An object has behaviors - which are defined by the ________ associated with that object.






13. Represents either a primitive value or an object






14. Boolean type conversions are ___________






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






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






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






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






19. sides=10;






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






21. Returns the number of characters in this stirng.






22. A class usually provides services to access and modify __________






23. declaration that creates a String variable that holds a reference to a String object; an object variable doesn't hold an object itself - it holds the address of an object






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






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






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






27. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.






28. Constructor: creates a new pseudorandom number generator.






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






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






31. The idea that we can refer to multiple types of related objects over time in consistent ways. it gives us the ability to design powerful and elegant solutions to problems that deal with multiple objects.






32. Returns the character at the specified index.






33. Expressed in a Java program with single quotes






34. A null reference indicates that a variable does not refer to an object






35. The Scanner class is part of ___________________






36. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.






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






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






39. format for constants: all upper-case; separated by ________






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






41. ++count; -- count






42. Occurs when a value of one type is assigned to a variable of another type during which the value is converted to the new type.






43. Instance data should be defined with what________ visibility






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






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






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






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






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






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






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