Professional Documents
Culture Documents
Computer Application
Choose the correct options:
1. The property which does not allow the data and its functions to be used as
public interface is known as:
a) Inheritance b) Polymorphism
c) Data Hiding d) Class
Page 1 of 3
8. Analyze the following program segment and state the output and determine how
many times the body of the loop will be executed:
int p=200;
while(true)
{
if ( p < 100)
break;
p=p-20;
}
System.out.println ( p );
a) Output- 12, Runs 2 times b) Output- 10, Runs 2 times
c) Output- 12, Runs 3 times d) Output- 10, Runs 3 times
9. State the output of the following program segment:
double x=2.9, y=2.5;
System.out.println(Math.min (Math.floor(x), y));
System.out.println(Math.max (Math.ceil(x), y));
a) 3.0 b) 2.0
2.0 2.0
c) 2.5 d) 2.0
3.0 3.0
10. What type of conversion showing by the following code:
char c= (char) 120;
a) Implicit type conversion b) Explicit type conversion
c. both a & b. d) None of the above
11. Observe the following code and state the value of i and j before any object is
created?
Page 2 of 3
13. The following program returns the reverse of the number n. Choose the write
expression for the blank, so that the program will execute successfully.
a) rev*10+num/10 b) rev+num%10
c) rev *10+num%10 d) None of the above
14. Analyze the given code and determine how many times does the inner loop
execute?
for (int i=3; i<=4; i++)
{
for (int j=2; j< i; j++)
{
System.out.println(“ “);
}
}
a) 2 times b) 3 times
c) infinite d) 4 times
15. What is the final value of c after the iteration process given below:
a) 12 b) 13
c) 15 d) None of the above
Page 3 of 3