Professional Documents
Culture Documents
SECTION A
(v) variables are the variables that contain the state of an object.
(a) Class (b) Object (c) Instance (d) Hybrid
(vi) The modifier states that the method is accessible to other classes.
(vii) Primitives that are fields in a class are automatically initialized to:
(xv) Which keyword is used to include the classes of the package in the program?
(a) Export b) Import (c) Include (d) Exclude
(xvi) Which of the following are the fields of the class whose values are the same in all instances of the class?
(a) Static (b) Private (c) Protected (d) Final
(xvii) Name the class which is the superclass for all the classes in Java.
(a) Class itself (6) Object class
(c) Library (d) Package
(xvii) What are the values stored in variables rl and r2?
double rl = M a t h . a b s (Math.min ( - 2.83, -5.83))
(a) rl= 5.83, r2=4.0 (b) rl= 2.83, 12=4.0 (c) rl= 5.83, r2=3.0 (d) rl= 3.83, r2=6.0
(xix) Which of the following is/are primitive data type?
(a) boolean (b) char (c) Both (a) and (b) (d) None of these
(xx) Which of the following isare the correct way of declaring an array?
(a) String[] difficult Words; (b) int temps[ ]:
(c) both (a) and (b) (d) none of these
Question 2
be used and to test for digit, isDigit() can be used. Is
() To find whether the character is a letter, isLetter() can
there any function that combines these two functions, i.e.
checks whether the character is a letter or a digit? [2
of the its the below linc will always return what value? 12
(ii) Irrespective alphabet or case,
a.intValue ();
the
method definition before you. How will you deduce
the last statement executed in
(vii) Suppose you have a
2
method?
same word.
21
(ix) Fill in the blank in the two sentences below with the
method belongs to the class rather than object
of a class.
A
creating instance ofa class.
be invoked without the need for
an
A method can
data types.
121
Give the names for the wrapper classes of these primitive
(x) (d) short
(c) double
(a) boolean (b) char
SECTIONB
this Section)
(Answer any four questions from
environment or any
the programs in either Bluel
The answers in the section should consist of
environment with java as the base.
program
description/memonic codes so that logic of the
written using variable
Each program should be
program is clearly depicted.
not required.
Flowcharts and algorithms are
15
Question 3 for some integer n. For example:
is number that can be written in the form of n.(nt1)/2,
A triangular number
a
3.4/2 6.
6 is a triangular number, as smaller than this
m, and prints out all positive integral integers
class that takes as input an integer
Define a
For example:
10 (as input)
are all triangular and smaller.
1, 3,
|15
Question4 which contain an integer in it. For example:
5 strings. Print out the strings
Take as input
Devendra 99
Kapugedara
Smit23h
Ten1Odulkar
Vir18T
Smit23h the outputsS)
Ten1Odulkar Vir18T (This line are
Question 5 15
to input set of 20 letters, Convert each letter into upper
case. Fina and display the numher
er
CProgram a
the following:
Question 7 [15
Write a program to bubble sort the following set of values in ascending order:
5, 3, 8, 4, 9, 2, 1, 12, 98, 16
Question 8 [15
Overload the print) function so that:
Write a program in Java to accept a name containing three words and display the surname first, followed by
the first and middle names.