Ajay Chaudhary Classes Being Brilliant:-Computer Test 2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Ajay Chaudhary Classes

Being Brilliant:-
Computer test 2:
Question 1.
(a) Which of the following are valid comments? [2]
(i) /* comment */
(ii) /*comment
(iii) //comment
(iv) */ comment */
(b) What is meant by a package? Name any two Java Application Programming Interface packages. [2]
(c) Name the primitive data type in Java that is:
(i) a 64-bit integer and is used when you need a range of values wider than those provided by int.
(ii) a single 16-bit Unicode character whose default value is ‘\u0000′ [2]
(d) State one difference between floating point literals float and double. [2]
(e) Identify the statements listed below as assignment, increment, method invocation or object
creation statements. [2]
(i) System.out.println(“Java”);
(ii) costPrice = 457.50;
(iii) Car hybrid = new Car();
(iv) petrolPrice++;

Question 2.
a) What is meant by precedence of operators? [2]
b) What is a literal? [2]
c) What are the types of casting shown by the following examples? [2]
i) double x =15.2;
int y =(int) x;
ii) int x =12;
long y = x;
(d) (i) Why is an object called an instance of a class?
(ii) What is the use of the keyword import? [2]
e)Find x:- b=10;d=8;x=2;[2]
x%=b++ / d-- + --b %[7- ++d – {100% --b + --x+(72 * ++x)-2}-1}

3.Display the pattern and series:-

 12345
11234
11123
11112
11111

 2+5+10+17+26---------------n

Computer by-Aman Saxena

You might also like