0% found this document useful (0 votes)
37 views3 pages

Java Important Questions & Bits

This pdf has some important questions and objective questions that can be useful for Java subject for the engineering freshmen

Uploaded by

najeema172
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)
37 views3 pages

Java Important Questions & Bits

This pdf has some important questions and objective questions that can be useful for Java subject for the engineering freshmen

Uploaded by

najeema172
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
You are on page 1/ 3

Java Important Questions for MID-I Examination

1. Discuss about OOPS Principles and JVM?


2. Explain about the operators in detail?
3. Explain how this Keyword can be used? Discuss about Type Casting?
4. Describe Constructor ? Explain Different types of Constructor’s with Examples?
5. What is a class? Explain Different types of Access Modifiers for classes using sample
programs?
6. What is a Method? Explain Method Overloading with Sample Program?
7. Explain the Conditional statements and Iterative Statements?
8. Illustrate Recursive Methods and Nesting of Methods with Sample Program

Objective type Questions


1. Acquiring the Properties from Parent class to the child class is known as [ B ]
a) Dynamic Binding b) Inheritance
c) Method Overriding d) Method Overloading
2. allocates memory for an object during run time [ B ]
a) class b) new c) super d) All
3. can be used inside any method to refer to the current object [ C ]
a) new b) super c) this d) extends
4. In java, access modifiers are [ D ]
a) public b) private c) protected d) All
5. main() is declared as because it must be called before any objects exist [ D ]
a) public b) private c) protected d) static
6. Java was initially called as [ A ]
a) Oak b) Java b) Ok d) none
7. The output of java compiler is [ B ]
a) source code b) byte code c) machine code d) All
8. Which method is used to find the index position of a String [ C ]
a) main() b) const() c) charAt() d) strcmp()
9. In Java the size of long data type is bytes [ D ]
a) 2 b) 4 c) 6 d) 8
10. Casting also known as type conversion [C]
a) implicit b) explicit c) Both (a) and (b) d) None
11. is not Java keyword [D]
a.abstract b) package c) implements d) main
12. Java language comments are [ D]
a) multiline comments b) documentation comments
c) single-line comments d) All ]
13. is the mechanism that binds together code and data [ A
a) encapsulation b) inheritance c) polymorphism d) abstraction ]
14. is the process in which one object acquires the properties of another object [ A
a) inheritance b) encapsulation c) polymorphism d) abstraction ]
15. is an instance of a class [ A
a) object b) sub class c) method d) member ]
16. language does not support or allow pointers c
[
a) C b) C++ c) Java d) All
17. Right Shift operator symbol is [ A ]
a) >> b) << c) <= d) >=
18. Java supports two iterative statements are [ C ]
a) while b) for c) Both (a) and (b) d) None
19. In java the Jump statements are [ D
]
a) break b) continue c) return d) All
20. In java statement can be used to terminate a loop [ C ]
a) return b) continue c) break d) case

21. Which of the following is NOT a basic concept of OOP? [C ]


A. Classes B. Objects C.Functions D.Inheritance
22.Which concept of OOP encapsulates the properties (data) and behaviors (methods) of a real-world
object into a single entity? [B]
A. Polymorphism B. Encapsulation C.Inheritance D. Abstraction
23The concept of hiding the internal implementation details of a class and showing only its functionality
is known as: [B]
A. Encapsulation B. Abstraction C. Polymorphism D. Inheritance
24. In OOP, an "object" is: [ A ]
A. An instance of a Class B. A type of data structure C.A programming
technique
D. A method definition
25.If a class Car has a method drive () that requires no arguments, which of the following calls is
correct after creating a Car object named myCar? [ B ]
A. Car.drive() B. myCar.drive() C.drive(myCar) D. Car().drive
26.In the context of OOP, what does a class provide? [ A ]
A. A blueprint for objects B. A specific data type C. A method implementation
D.A programming pattern
27.How do objects in OOP communicate with each other? [ B ]
A. Through global functions B. By calling methods on each other
C.Using special OOPcommunication operators D. By accessing each other's memory directly
28. Given the following Java code, what is the output?
class Box {
int width;
Box(int w)
{ width = w;
}
}
public class Test {
public static void main(String[] args)
{ Box myBox = new Box(5);
System.out.println(myBox.width);
}
} [ A ]
A.5 B. 0 C. Error D. None
29. What is the value of the expression 5+2 == 7 && 4>3 in java? [ A ]
A. True B. False C.0 D. 1
30.What is the value of the expression 6>4 ? 10: 20 in java? [ C ]
A.6 B. 4 C.10 D. 20
31.What is the size of float and double in java? [ A ]
A. 32 and 64 B.32 and 32 C.64 and 64 D. 64and32
32. Which of the following is not a decision making statement? [ D ]
A. if B. if-else C. switch D. do-while
33. What is a loop statement? [ A ]
A. An statement, which is executed repeatedly B. An statement, which is executedonce
C. An statement, which is never executed D. None
34. What is Java? [ C ]
A. A physical machine B. A software tool
C. A Platform Independent and a Popular programming language D. A tool which creates
software
35. Which of these Operators is used to allocate memory for an object? [ C ]
A. malloc B. alloc C. new D. none
36. Which of these access specifiers must be used for main() method? [ B]
a) private b) public c) protected d) none
37. What does the “void” keyword indicate in a method declaration? [ A ]
a) The method does not return any value b) The method is private
c) The method returns an integer value d) the method is static
38) Which of these data types is used to store command line arguments? [ C ]
a) Array b) Stack c) String d) Integer
39. What is the process of defining two or more methods within same class that have same name
but different parameters declaration? [ A ]
A. method overloading B. method overriding C. method hiding D. none
40. Standalone Applications are known as [ C ]
A. Distributed applications B. Server side applications or Web applications
C. Desktop applications or Window-based applications D. Android applications or Java
ME applications

You might also like