Thanks to visit codestin.com
Credit goes to www.scribd.com

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

3rd Sem Java

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

3rd Sem Java

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

Here are the corrected and numbered questions:

### 2 Marks Questions:

1. **Define type conversion.**


2. **What is the scope of a variable?**
3. **Why is Java called an architectural neutral?**
4. **What is the purpose of the byte stream?**
5. **What is the use of the ‘final‘ keyword?**
6. **Define class and object.**
7. **What is the use of a package?**
8. **What is inheritance?**
9. **What is the use of the ‘try‘ block?**
10. **What is dynamic binding?**

11. **List out Java keywords.**


12. **Write about any one of the SELECTION statements in Java.**
13. **List advantages of static variables.**
14. **Write about the ‘NEW‘ operator.**
15. **List out thread properties.**
16. **List out some of the sources of errors in programming.**
17. **What is bytecode in Java?**
18. **Define an applet.**
19. **What is a package?**
20. **What is the class path?**

---

### Multiple Choice Questions:

21. **The new operator**


(i) returns a pointer to a variable
(ii) creates a variable called new
(iii) obtains memory for a new variable
(iv) tells how much memory is available

22. **Command to execute a compiled Java program is**


(i) ‘javac‘
(ii) ‘java‘
(iii) ‘run‘
(iv) ‘execute‘

23. **The order of the three top-level elements of the Java source file is**
(i) Import, Package, Class
(ii) Class, Import, Package
(iii) Package, Import, Class
(iv) Random order

24. **Which one of the following is not supported by OOP?**


(i) Abstraction
(ii) Polymorphism
(iii) Encapsulation
(iv) Global variables

25. **From the following statements, which is a disadvantage of a Java array?**


(i) An array can hold primitive type data.
(ii) An array has its size that is known as array length.
(iii) An array knows only its type that it contains. Any type is checked at compile time.
(iv) An array holds only one type of data.

26. **Which method is used to change the name of a thread?**


(i) ‘Public String getName()‘
(ii) ‘Public void setName(String name)‘
(iii) ‘Public void getName()‘
(iv) ‘Public String setName(String name)‘

27. **Which is used for reading streams of raw bytes such as image data and for reading streams of
characters, consider using FileReader?**
(i) FileInputStream
(ii) FileOutputStream
(iii) Both (i) and (ii)
(iv) None of the above

28. **An exception is an event, which occurs during the execution of a program that disrupts the normal
flow of the program’s instructions?**
(i) True
(ii) False

29. **A package can be renamed without renaming the directory in which the classes are stored.**
(i) True
(ii) False

30. **Which exception occurs when a class is not found while dynamically loading a class using the class
loader?**
(i) ‘ClassNotFoundException‘
(ii) ‘ClassFoundException‘
(iii) ‘NoClassDefFoundError‘
(iv) ‘ClassDefFoundError‘

---

### Short Answer Questions:

31. **Literal can be of which of these data types?**


32. **Which of these cannot be used for a variable name in Java?**
33. **Decrement operator ‘--’ decreases the value of a variable by what number?**
34. **What is the output of relational operators?**
35. **Which of these operators is used to allocate memory for an object?**
36. **Which of the following is a method having the same name as that of its class?**
37. **What will s2 contain after the following lines of code?**
‘‘‘java
String s1 = "one";
String s2 = s1.concat("two");
‘‘‘
38. **Which of these keywords is used to define interfaces in Java?**
39. **When do exceptions in Java arise in code sequence?**
40. **Which of these functions is called to display the output of an applet?**

---
### Long Answer Questions:

41. **List various Literals in Java.**


42. **Explain Bytecode concept of Java.**
43. **State the purpose of break and continue statements in Java.**
44. **Define an applet.**
45. **Define an interface.**
46. **What is class path?**
47. **List the applet classes in Java.**
48. **List the advantages of exceptions.**
49. **List any three methods of the Frame class in Java.**
50. **List the different AWT components in Java.**

---

### 4 Marks Questions:

51. **Write a program to find the sum of the digits of the number entered by the user.**
52. **Explain array list and iterator methods of collections.**
53. **Write a Java program to implement the ‘Runnable‘ interface with an example.**
54. **How are threads synchronized?**
55. **Contrast overloading and overriding methods.**

56. **Define an array and explain one-dimensional array in Java with an example.**
57. **Define a class in Java.**
58. **Explain the use of command-line arguments.**
59. **Explain about deadlock.**
60. **Explain thread priority.**

---

### 12 Marks Questions:

61. **Explain briefly about the string class and discuss various methods in the string class with
examples.**
62. **Discuss the various levels of access protection available for packages and their implications.**
63. **What is an exception? Explain how an exception can be handled in Java. Also list the benefits of
exception handling.**
64. **Explain the byte stream class in detail. Differentiate between the input stream class and reader
class.**
65. **Differentiate between applet and application. Explain the applet lifecycle with a suitable diagram.**

66. **Explain the concept of dynamic method dispatch with an example program.**
67. **Explain the following:**
(a) Try and catch
(b) Throw
(c) Finally

68. **Define method overloading. Write a program using the concept of method overloading.**
69. **Explain the lifecycle of an applet.**
70. **Define inheritance. Give various forms of inheritance and write a Java program on single
inheritance.**

71. **Explain the concepts of object-oriented programming as supported by Java.**


72. **What is the role of ‘finally‘ in exception handling? Explain with an example.**
73. **Discuss in detail about the Applet lifecycle.**
74. **What is an array? How are arrays created in Java, and arrays accessed? Explain with an
example.**
75. **Differentiate method overloading with method overriding with example.**

---

### Additional Questions:

76. **What are the different OOP concepts?**


77. **Difference between object-oriented and object-based programming languages.**
78. **What do you mean by operator? Discuss different types and precedence.**
79. **Write a Java program to swap contents of two numbers using Bitwise XOR.**
80. **What are different ways to compare Java Strings? Explain any two.**
81. **Write a program in Java to implement binary search.**
82. **How to catch exceptions in Java? Explain with example.**
83. **Write an applet program to display a moving banner.**
84. **What do you mean by reading & writing files in Java?**
85. **What do you mean by directories in Java? How to create and list directories? Demonstrate using a
program.**

86. **Explain about abstract classes and abstract methods.**


87. **Explain the lifecycle of a Thread.**
88. **Explain about try-catch functionality in Exception Handling.**
89. **Explain various Stream Classes of Java.**
90. **Define Inheritance. Give various forms of inheritance and write a Java program on single
inheritance.**

---

I hope this helps! Let me know if you need more clarification or additional questions.

You might also like