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






2. A method that returns a value must have a _________






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






4. Constructor: creates a new string object with the same characters as str.






5. Expressed in a Java program with single quotes






6. Before you use a variable __________it






7. sides=10;






8. Returns true if the scanner has anotehr token in its input.






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






10. Two floating data types: float - _______






11. Returns the character at the specified index.






12. Making it difficult - if not impossible - for code outside of a class to "reach in" and chnage the value of a variable that is declared inside that class.






13. Instance data should be defined with what________ visibility






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






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






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






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






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






19. Two categories of statements that control the flow of executing through a method: __________ and loops






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






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






22. Constants are ______ because the can't be changed once you use the final modifier






23. All wrapper classes are defined in ___________






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






25. ______________ operators have higher precedence






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






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






28. Boolean type conversions are ___________






29. Methods in the Math class are ______






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






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






32. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.






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






34. Variables that don't contain any data






35. The names of the parameters in the header of the method declaration






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






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






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






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






40. Only two valid values: true and false; can indicate whether a particular condition is true - but can also be used to represent any situation that has two states - such as a light bulb being on or off






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






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






43. Variables and constants can be referenced in any method of the class by declaring at the _________






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






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






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






47. ++count; -- count






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






49. The one that is invoked






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