0% found this document useful (0 votes)
6 views4 pages

Computer Operator

The document contains a series of questions and programming tasks related to computer science concepts, specifically focusing on objects, classes, and operators in Java. It includes identification of statements, differences between operators, and programming exercises that require writing Java code. The questions assess knowledge on object-oriented programming principles and syntax in Java.

Uploaded by

Aswini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Computer Operator

The document contains a series of questions and programming tasks related to computer science concepts, specifically focusing on objects, classes, and operators in Java. It includes identification of statements, differences between operators, and programming exercises that require writing Java code. The questions assess knowledge on object-oriented programming principles and syntax in Java.

Uploaded by

Aswini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 4

COMPUTER

OBJECTS AND CLASSES

OPERATORS

Marks:

Q1. Identify the statements listed below as assignment, 2 marks


increment, method invocation or object creation

a. System.out.println("Java");
b. cp=45.50;
c. gp++;
d. Car hybrid=new Car();

Q2. Difference between unary and binary operator 2 marks

Q3. Which operator must be used to invoke the methods of an 2 marks


object?
Q4. Why are classes called Abstract Data Types (ADT)? 2 marks
Q5. Name the three types of operators? Give examples for each. 2 marks
Q6. What is the difference between an object and a class? 2 marks
Q7. What is the significance of new keyword? 2 marks
Q8. Identify which of the following can be classified as an object. 2 marks
Printer, Monitor, Show image on screen, Mouse, Double
clicking the mouse
Q9. How are objects implemented in software terms? 2 marks
Q10. Why is class called as an object factory? 2 marks
Q11. Write an expression in java for z=5x3+ 2yx + y 2 marks
Q12. If a=4, b=3 find the value of c= a++*6+++b*5+10 2 marks
Q13. What will be the output of the following code? 2 marks
Int k=5,j=9;
K+=k++ - ++j + k;
System.out.println(“k=”+k);
System.out.println(“j=” + j);
Q14. Rewrite using ternary operator 2 marks

If(x%2==0)
System.out.println(“even”);
Else
System.out.println(“odd”);

15. Write a java expression for ut+ ½ at2 2 marks


16. An -------- is an identifiable entity with some characteristics 1 mark
and behaviour.

a) Object
b) thing
c) Class
d) none of these
17. Objects interact with each other through 1 mark
a)signals
b)methods
c) titles
d) none of these
18. An object has 1 mark

a) Behaviour
c) state
b) attributes
d) all of these
19. A class shares common 1 mark

a) Behaviour
b) properties
c) relationship
d) all of these
20. A class name must begins with______ letter 1 mark

a) Capital
b) small
c) ASCII
d) none of these
21. _______ keyword is used to create class 1 mark

a) new
b) class
c) dot
d) all of these
22. If m,n,p are three integers, then which of the following holds 1 mark
true?
If(m==n) && (n!=p)?
a)m and n are not equal
b)n and p are equal
c)m and p are equal
d) m and p are not equal
23. . A Class is also known as ..............data types. 1 mark
a. User-defined
c. Pre-defined
b. Abstract
d. None
24. Minhas is writing an OOP code for items like car, truck, bus 1 mark
etc. These items under the class vehicle are called...
a. Items
c. Methods
b. Attributes
d. Objects
25. When the value of a variable is increased by one before the 1 mark
result of the expression is evaluated, it is called
a.Postfix increment
b. Prefix decrement
C. Prefix increment
d. Postfix decrement

SECTION B
(Variable table is compulsory)
1. Write a program to display the multiplication of any 15
given number. marks
2. Write a program in java to print your address details 15
in the following format: marks
House number:
Street name:
Landmark:
City:
State:
Mobile number:
3. The daily wages paid to a labourer is 100/day. He 15
works 1 day in first week, 3 days in second week, 4 markd
days in third and 7 days in fourth week. Write a
program of class name gross pay and compute the
payment he gets in the month.
4. Write a program to input two numbers a, b and if 15
display the square of a, otherwise square of b, using marks
ternary operator

You might also like