Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Section - A

( Attempt all questions from this section )

1. what package is a part of the wrapper class which is


imported by default into all java programs.
a) java.util
b) java.lang
c) java.awt
d) none of the above

2. conversion of a primitive value into an object of the


corresponding wrapper class called.
a) autoboxing
b) unboxing
c) type casting
d) all of the above

3. An OOP feature that allows all members of a class to


be a member of another class.
a) Encapsulation
b) Abstraction
c) Inheritance
d) Polymorphism

4. Which access specifier allows accessibility of a


member only within the same class where it is declared ?
a) public
b) private
c) protected
d) default

5. Where is the value of an array stored ?


a) function
b) memory
c) input
d) output
6. Things which are required to declare one
dimensional array.
a) datatype
b) array name
c) size
d) all of these

7. Which function is used to clculate the length of an


array ?
a) length
b) length()
c) get()
d) sizeof()

8. Which function is used to compare two string objects


for their equality.
a) equals()
b) Equals()
c) isEqual()
d) Isequal()

9. Which of the following is not a wrapper class ?


a) Byte
b) Int
c) Long
d) Float

10. if a [ ] = { 6,8,9,12 } is an array . Find a [ 1 + 1 ]


+ a [ 1+ 2 ].
a) 12
b) 17
c) 23
d) 21
Section - B
( solve any 5 question )

1. Write a program to take an array of int type as


input of size 10 . find and print the sum of all even
numbers from array .

2. Perform binary search on the given array . print


"number not found" if number is not present in the
array.
[ 34 , 36 , 39 , 53 , 56 , 63 , 67 , 71 , 75 , 78 ]

3. Take an array as an input from the user of size


10 . find and print the largest number from the
array.

4. Write a program to input a string. Count and


print no of vowels in it.

5. Write a program to input a sentence and count


no of 'A' or 'a' in it .

6. Write a program to take name as a input and


then print the initials of it.
example - input --> Rudra Pratap Singh
output --> R.P.S

You might also like