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. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;






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






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






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






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






6. Every object has two things: a state and a _____ of behaviors






7. A ________________ is immutable.






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






9. Instance data should be defined with what________ visibility






10. If the string object str holds the string "987" - the following line of code converts the string into the integer variable 987 and stores that value in the int variable num:






11. A combo of one or more operators and operands that usually perform a calculation; operands can be literals - constants - variables - or other sources of data






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






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






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






15. Constructor: creates a new pseudorandom number generator.






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






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






18. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)






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






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






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






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






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






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






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






26. Five steps of problem-solving: ____________ the problem - Designing a solution - Considering alternatives to the solution and refining the solution - Implementing the solution - Testing the solution and fixing any problems that exist






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






28. Returns the number of characters in this stirng.






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






30. Returns the character at the specified index.






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






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






33. When a variable is declared inside a method






34. Occurs automatically when certain operators need to modify their opeands in order to perform the operation






35. Variables that don't contain any data






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






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






38. Methods in the Math class are ______






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






40. Cast operator has _________ precedence to division






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






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






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






44. Boolean type conversions are ___________






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






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






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






48. The one that is invoked






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






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