Test Series - oops

Test Number 76/78

Q: What are inbuilt classes?
A. The predefined classes in a language
B. The classes that are defined by the user
C. The classes which are meant to be modified by the user
D. The classes which can’t be used by the user
Solution: The classes that are already provided in a programming language for use are inbuilt classes. These classes provide some functions or objects that can be used by the programmer for easier code.
Q: Inbuilt class __________________________
A. Must be included before use
B. Are not necessary to be included for use
C. Are used by the compiler only
D. Can be modified by programmer always
Solution: The inbuilt classes must be included in the program. Whenever some functions are used, they must have a declaration before use. The same is the case with classes.
Q: What doesn’t inbuilt classes contain?
A. Function prototype
B. Function declaration
C. Function definitions
D. Objects
Solution: The classes contain the definitions of the special functions that are provided for the programmers use. Those functions can be used to make the programming easy and to reuse the already existing code.
Q: Which among the following not an inbuilt class in C++?
A. System
B. Color
C. String
D. Functions
Solution: There is no inbuilt class named function in java. The others are classes already provided in java. All those classes contain some special functions to be used in programming.
Q: What is the InputStream class meant for?
A. To handle all input streams
B. To handle all output streams
C. To handle all input and output streams
D. To handle only input from file
Solution: The InputStream is an inbuilt class which is used to handle all the tasks related to input handling. This class extends input from keyboard or file or any other possible input stream.
Q: Which statement is true for the Array class?
A. Arrays can have variable length
B. The length array can be changed
C. Each class has an associated Array class
D. Arrays can contain different type of values
Solution: The Array class is associated with all the other classes. This gives us the flexibility to declare an array of any type. The index goes from 0 to n, where n is some fixed size for array.
Q: What is the use of Math class?
A. To use the mathematical functions with strings
B. To use the mathematical functions
C. To suppress the use of mathematical functions
D. To complex the calculations
Solution: The Math class is provided with some special functions. These functions can be used to calculate and get result of some special and usual mathematical functions. We don’t have to write the code to calculate the trigonometric function results, instead we can use Math functions.
Q: DataInputStream is derived from ______________________
A. StreamingInput
B. StreamedInput
C. StreameInput
D. StreamInput
Solution: The DataInputStream is more specific class for operating on specific type of data inputs. This is used to read data of specific type. The same can be used to read data in a specific format.
Q: Which attribute can be used to get the size of an array?
A. Size.Array
B. Array.Size
C. Array_name.length
D. length.Array_name
Solution: The array name is given of which the length have to be calculated. The array length is stored in the attribute length. Hence we access it using dot operator.
Q: Number class can’t manipulate _____________
A. Integer values
B. Float values
C. Byte values
D. Character values
Solution: The Number class is used to work with all the number type of values. The integers, float, double, byte etc. are all number type values. Character is not a number value.

You Have Score    /10