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.

31. Which of these class contains only floating point functions?
a. Math
b. Process
c. System
d. Object
View Answer Report Discuss Too Difficult!
Answer: (a).Math

32. Which of these class encapsulate the runtime state of an object or an interface?
a. Class
b. Object
c. Runtime
d. System
View Answer Report Discuss Too Difficult!
Answer: (a).Class

33. What is the value of “d” after this line of code has been executed?

double d = Math.round ( 2.5 + Math.random() );
a. 2
b. 3
c. 4
d. 2.5
View Answer Report Discuss Too Difficult!
Answer: (b).3

34. What is the output of this program?
    class Output 
    {
         public static void main(String args[]) 
         {
             int x = 3.14;  
             int y = (int) Math.abs(x);
             System.out.print(y);
         }
    }
a. 0
b. 3
c. 3.0
d. 3.1
View Answer Report Discuss Too Difficult!
Answer: (b).3

35. What is the output of this program?
    class Output 
    {
         public static void main(String args[]) 
        {
            double x = 3.1;  
            double y = 4.5;
            double z = Math.max( x, y );
            System.out.print(z);
        }
    }
a. true
b. false
c. 3.1
d. 4.5
View Answer Report Discuss Too Difficult!
Answer: (d).4.5

36. What is the output of this program?
    class Output 
    {
         public static void main(String args[]) 
        {
            double x = 2.0;  
            double y = 3.0;
            double z = Math.pow( x, y );
            System.out.print(z);
        }
    }
a. 2.0
b. 4.0
c. 8.0
d. 9.0
View Answer Report Discuss Too Difficult!
Answer: (c).8.0

37. Which of these exceptions is thrown by methods of System class?
a. IOException
b. SystemException
c. SecurityException
d. InputOutputException
View Answer Report Discuss Too Difficult!
Answer: (c).SecurityException

38. Which of these methods initiates garbage collection?
a. gc()
b. garbage()
c. garbagecollection()
d. Systemgarbagecollection()
View Answer Report Discuss Too Difficult!
Answer: (a).gc()

39. Which of these methods loads the specified dynamic library?
a. load()
b. library()
c. loadlib()
d. loadlibrary()
View Answer Report Discuss Too Difficult!
Answer: (a).load()

40. Which of these method can set the out stream to OutputStream?
a. setStream()
b. setosteam()
c. setOut()
d. streamtoOstream()
View Answer Report Discuss Too Difficult!
Answer: (c).setOut()

Page 4 of 22