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. Widening byte: _________ - to int - to long - to float - to double






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






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






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






5. The one that is invoked






6. 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:






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






8. ______________ operators have higher precedence






9. Elements of input






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






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






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






13. Returns the character at the specified index.






14. A ________________ is immutable.






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






16. Instance data should be defined with what________ visibility






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






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






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






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






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






22. Sets the scanner's delimiting pattern.






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






24. Delimited by double quotation characters






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






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






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






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






29. When a variable is declared inside a method






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






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






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






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






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






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






36. The Scanner class is part of ___________________






37. _____ expression evaluated first






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






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






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






41. Before you use a variable __________it






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






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






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






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






46. All wrapper classes are defined in ___________






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






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






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






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