0% found this document useful (0 votes)
6 views1 page

Java Data Types and Operators Quiz

The document contains a series of multiple-choice questions related to Java programming concepts, including data types, arithmetic expressions, object-oriented programming, and method definitions. Each question provides four answer options, testing knowledge on Java syntax and functionality. The content is aimed at students in Class XII studying computer science.

Uploaded by

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

Java Data Types and Operators Quiz

The document contains a series of multiple-choice questions related to Java programming concepts, including data types, arithmetic expressions, object-oriented programming, and method definitions. Each question provides four answer options, testing knowledge on Java syntax and functionality. The content is aimed at students in Class XII studying computer science.

Uploaded by

gav100286
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Class XII

1. How many basic data types are supported in Java?


a) 2 b) 8 c) 9 d) 16
2. What is the default data type of floating point literal?
a) Int b) long c) double d) float
3. Which character set is used for char data type in Java?
a) ASCII b) Unicode c) EBCIDIC d) all of these
4. Which of the following is not a basic data type in Java?
a) String b) long c) type d) char
5. What will be the result of arithmetic expression 7/2?
a) 3 b) 4.5 c) 3.5 d) 2.5
6. What will be the result off arithmetic expression -7%2?
a) -3 b) -1 c) 1 d) -3.5
7. What will be the result off arithmetic expression -7.5%2?
a) -3 b) -1.5 c) 1 d) error
8. What is the meaning of short hand operator a+ = b?
a) A+b=b b) a+b=a c) a=a+b d) b=a+b
9. What will be the output of (x = = 0)^ (x = = 0)?
a) True b) false c) error d) no output
10. ____ is not the example of character literal.
a) ‘S’ b) ‘#’ c) “SAN” d) ‘3’
11. X=6; y=4; x%y; will give ____ output.
a) 1 b) 2 c) 0 d) 3
12. Real Number Literal is called _____.
a) Floating point literal b) real number c) a and b d) none of these.
13. ___ is the basic unit in Object Oriented Programming.
a) Object b) class c) both a & b d) Method.
14. In Java, a class is of ____ type same as a data type.
a) Int & Boolean b) int & float c) Boolean & float d) none of these.
15. What is kept in heap?
a) Class address b) classes c) Object d) all of these
16. If we done use the argument in the declared object, then what is called by the empty parentheses?
a) -1 value b) predefined constructor c) zero value d) this not possible
17. _____ visibility is used to give appropriate form to different classes.
a) public b) package c) protected d) private
18. Accessor method is known as ______.
a) Acceter b) setter c) getter d) mutator
19. Mutator method is known as ______.
a) Acceter b) setter c) getter d) mutator
20. Which of the following defines attributes and methods?
a) Class b) object c) instance d) variables
21. Which of the following keyword is used to declare class variables and class methods?
a) Private b) static c) public d) package
22. Which of the following operator creates an object and returns its reference?
a) Dot b) colon c) new d) assignment
23. Which of the following refers more than one method having same name but different parameters?
a) Overloaded methods b) overridden methods c) duplicate methods d) all of the above
24. Which of the following is the keyword used to refer a superclass constructor in sub class constructor?
a) Super b) extends c) name of the superclass d) new
25. Which is the third object to create an object?
a) Declaration b) Instantiation c) Initialization d) comment

You might also like