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






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






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






4. A ________________ is immutable.






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






6. A set of classes that supports the development of programs






7. System.out object represents an output device or file; we send the println message to the System.out object to request that some text be printed






8. The Scanner class is part of ___________________






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






10. The automatic conversion between a primitive value and a corresponding wrapper object.






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






12. Cast operator has _________ precedence to division






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






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






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






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






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






18. sides=10;






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






20. Instance data should be defined with what________ visibility






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






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






23. Methods in the Math class are ______






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






25. Returns the number of characters in this stirng.






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






27. Constructor: creates a new pseudorandom number generator.






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






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






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






31. Sets the scanner's delimiting pattern.






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






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






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






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






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






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






38. Modifier>type/void>identifier>parameters>method body






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






40. Expressed in a Java program with single quotes






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






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






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






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






45. A Java operator that is specified by a type name in parentheses; truncates rather than rounds; useful in division if u want an integer to be treated as a float or double






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






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






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






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






50. Returns the int corresponding to the value stored in the specified string