Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
18 views

Some Java Questions

Java question

Uploaded by

Samridhii
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Some Java Questions

Java question

Uploaded by

Samridhii
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Some Java Questions

1. What do you mean by Object Oriented Programming?


2. Discuss the features of Java.
3. What do you mean by Abstraction, encapsulation, data hiding?
4. What is the purpose of JVM.
5. Why java is platform independent.
6. What is the need of both interpreter and the compiler in java?
7. How many types of Comment you can use in java. Explain them.
8. What is token, reserved words, identifiers, operators, ternary operator, separator, literals?
Explain with examples.
9. Write down the rules for naming the tokens.
10. Write down the conventions for naming the tokens.
11. What is PATH and CLASSPATH? Distinguish between them with examples.
12. What is escape Sequence. Explain with examples. Give at least 5 examples.
13. Discuss all the data types of the java. Mention the size of each data type.
14. What is implicit and explicit type conversion? Explain with examples.
15. What is type casting? What is the need of it?
16. What do you mean by instant variable, class variable, and local variable?
17. What are the default values of the instant variable, class variable, and local variable?
18. What do you mean by Scope of the variable? Explain with examples.
19. What do you mean by instantiation?
20. What is static variable, static methods, and static block? Explain all using a program with
output. What are the needs of these?
21. What is ‘this’. Explain with example.
22. Write down the rules/ restriction related with static?
23. Why we cannot use this in static method?
24. Discuss the following operators with examples
a. Relational
b. Logical / short circuit
c. Increment- Decrement
d. Conditional / Ternary
e. Bitwise
f. Shift
25. How to create and How to initialize the followings
a. Single dimension array
b. Double dimensional array with regular and irregular shape.
c. Multidimensional array
26. Discuss the switch-case, break, continue, labeled break, labeled continue.
27. What is class and object? How to create class and object? What is the reference of the
object and the object? What is the need of new?
28. What do you mean by Polymorphism?
29. What is method overloading? What is the need of it? What is the advantage of method
overloading?

Some Java Questions © Sudip Kumar De Page 1


30. In case of method overloading when direct matching does not happen then how java handle
the situation?(Hints: type promotion happen).
31. Can the object be passed to and returned from a method? Explain with examples.
32. Show, with example, that object is passed by reference.
33. What is constructor and what is its utility.
34. Discuss the rules related with the Constructor.
35. What is constructor overloading? What is the need of it?
36. What is constructor chaining? Explain with example.
37. What are default constructor, parameterized constructor, non- parameterized constructor,
Zero argument Constructor, and Copy constructor. Explain with example(s).
38. What is Inheritance? How important it is in Java. Explain with examples.
39. Discuss about “public static void main(String args[])”
40. What is the need of inheritance?
41. Discuss the different types of inheritance.
42. Why java does not support multiple inheritance in class level? Discuss it with example.
43. Discuss the different types of Access specifiers (public, default, protected, private).
44. In case of Inheritance how the constructor of different classes are called?
45. Discuss the usage of super keyword.
46. What is method overriding?
47. What is the difference between method overloading and method overriding?
48. What do you mean by method signature?
49. What is runtime or dynamic polymorphism? Explain with example.
50. What is the need of final keyword?
51. Discuss the different usage of final keyword.
52. What do you mean by abstract class? What is the need or purpose of it? Explain it with
example.
53. What is Interface? What is the need of it? Explain with example.
54. “One interface can be inherited from another interface”- Comment on this statement.
55. “One interface can be inherited from another class”- Comment on this statement.
56. Is the multiple inheritance possible in interface level? Explain with example.
57. Write down the difference between abstract class and interface.
58. What is the need of interface when abstract class is present? Explain you answer.
59. What is Package? What is the need of it? How to create Package? How to use the classes
within the package. (How to compile & how to run the program which uses package(s)).
Which package is automatically imported?
60. What is an exception? What is the need of it?
61. What is checked and unchecked Exception?
62. What is the difference between Exception and Error?
63. Give the name of three sub-classes of Exception and Error.
64. What is try- catch block? Explain with examples.
65. Is it possible to write multiple try-catch blocks within the code? Explain with example.
66. Is it possible to write multiple catch blocks against a try block? Explain with example.
67. Is it possible to declare nested try catch blocks? Explain with example.
68. What is User defined Exception? Explain with example.
69. What is the difference between throw and throws?
70. What is finally block? What is the need of it? Explain with example.

Some Java Questions © Sudip Kumar De Page 2


71. Why String is immutable? What is the difference between == and equals() method.
72. Discuss all the constructors of String classes. Explain with examples.
73. Discuss the following String methods with examples:
charAt() , compareTo(), equals(), equalsIgnoreCase(), indexOf(), length() , substring(),
toCharArray() , toLowerCase(), toString(), toUpperCase() , trim() , valueOf()
74. What is StringBuffer classes? What is the difference between String and StringBuffer Class?
75. Discuss the following StringBuffer methods with examples:
append(), capacity(), charAt(), delete(), deleteCharAt(), ensureCapacity(), getChars(),
indexOf(), insert(), length(), setCharAt(), setLength(), substring(), toString()
76. What is the difference between length() and capacity() method of StringBuffer class?
77. What is the difference between path and classpath ?
78. What is import and static import?
79. What do you mean by Garbage collection? What is the need of it?
80. In java how garbage collector collects the garbage?
81. Compare and contrast the terms final, finally and finalize method.
82. How to create and initialize single, and multi dimensional array of primitive data type?
83. How to create array of objects?
84. What is Inner class, Nested Class? What is the difference between them?
85. What is Anonymous class? What is the need of it? Explain with example.
86. What is Adapter class? What is the need of it? Explain with examples.
87. What is Wrapper Class? Discuss few methods of some Wrapper classes with examples.
88. What are a thread and a process? What is the difference between them?
89. Write down the life cycle of a java thread.
90. What are the different approaches are there in java to create java thread? Explain with
examples.
91. What are the differences between the methods sleep() and wait()?
92. What is API?
93. What is the thread priority? What is the default priority of java thread?
94. What is an applet? How does applet differ from applications?
95. What are the attributes of Applet tags? Explain the purposes.
96. Explain how to read information from the applet parameters
97. Write down the life cycle of Applet.
98. Write an Applet Program to show Event Handling.
99. Explain how to play sound in an Applet.
100. What is a JAR & WAR file?

Some Java Questions © Sudip Kumar De Page 3

You might also like