A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

21. Standard output variable ‘out’ is defined in which class?
a. Void
b. Process
c. Runtime
d. System
View Answer Report Discuss Too Difficult!
Answer: (d).System

22. Which of these class can encapsulate an entire executing program?
a. Void
b. Process
c. Runtime
d. System
View Answer Report Discuss Too Difficult!
Answer: (b).Process

23. Which of the following is method of System class is used to find how long a program takes to execute?
a. currenttime()
b. currentTime()
c. currentTimeMillis()
d. currenttimeMillis()
View Answer Report Discuss Too Difficult!
Answer: (c).currentTimeMillis()

24. Which of these class holds a collection of static methods and variables?
a. Void
b. Process
c. Runtime
d. System
View Answer Report Discuss Too Difficult!
Answer: (d).System

25. What is the output of this program?
    class Output 
    {
        public static void main(String args[]) 
        {
            long start, end;   
            start = System.currentTimeMillis();
            for (int i = 0; i < 10000000; i++);
            end = System.currentTimeMillis();
            System.out.print(end - start);
        }
    }
a. 0
b. 1
c. 1000
d. System Dependent
View Answer Report Discuss Too Difficult!
Answer: (d).System Dependent

26. What is the output of this program?
    class Output 
    {
        public static void main(String args[]) 
        {
            byte a[] = { 65, 66, 67, 68, 69, 70 };
            byte b[] = { 71, 72, 73, 74, 75, 76 };  
            System.arraycopy(a , 0, b, 0, a.length);
            System.out.print(new String(a) + " " + new String(b));
        }
    }
a. ABCDEF ABCDEF
b. ABCDEF GHIJKL
c. GHIJKL ABCDEF
d. GHIJKL GHIJKL
View Answer Report Discuss Too Difficult!
Answer: (a).ABCDEF ABCDEF

27. Which of these class is a superclass of all other classes?
a. Math
b. Process
c. System
d. Object
View Answer Report Discuss Too Difficult!
Answer: (d).Object

28. Which of these method of Object class can generate duplicate copy of the object on which it is called?
a. clone()
b. copy()
c. duplicate()
d. dito()
View Answer Report Discuss Too Difficult!
Answer: (a).clone()

29. What is the value of double consonant ‘E’ defined in Math class?
a. approximately 3
b. approximately 3.14
c. approximately 2.72
d. approximately 0
View Answer Report Discuss Too Difficult!
Answer: (c).approximately 2.72

30. Which of these method is a rounding function of Math class?
a. max()
b. min()
c. abs()
d. all of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (d).all of the mentioned

Page 3 of 22