Fundamentals of Object-Oriented Programming Questions and Answers

Read tutorials from Fundamentals of Object-Oriented Programming


Question List:

1. What is computer?

2. List five major hardware components of a computer.

3. What unit is used to measure CPU speed?

4. What is a bit? What is a byte?

5. What is memory for? What does RAM stand for? Why is memory called RAM?

6. What unit is used to measure memory size?

7. What unit is used to measure disk size?

8. What is the primary difference between memory and a storage device?

9. What is a Java applet?

10. What programming language does Android use?

11. What is the Java language specification?

12. What is the statement to display the message "Hello world" in a message dialog box?

13. Why does the System class not need to be imported?

14. Are there any performance differences between the following two import statements?
import javax.swing.JOptionPane;
import javax.swing.*;

15. Reformat the following program according to the programming style and documentation guidelines. Use the end-of-line brace style.

16. Variables used in a switch statement can be used with which datatypes?

17. When parseInt() method can be used?

18. Why is String class considered immutable?

19. Why is StringBuffer called mutable?

20. What is the difference between StringBuffer and StringBuilder class?

21. Which package is used for pattern matching with regular expressions?

22. java.util.regex consists of which classes?

23. What is finalize() method?

24. What is an Exception?

25. What do you mean by Checked Exceptions?

26. Explain Runtime Exceptions?

27. Which are the two subclasses under Exception class?

28. When throws keyword is used?

29. When throw keyword is used?

30. How finally used under Exception Handling?

31. What things should be kept in mind while creating your own exceptions in Java?

32. Define Inheritance?

33. When super keyword is used?

34. What is Polymorphism?

35. What is Abstraction?

36. What is Abstract class?

37. When Abstract methods are used?

38. What is Encapsulation?

39. What is the primary benefit of Encapsulation?

40. Explain the usage of this() with constructors?

41. Explain the following line used under Java Program ? public static void main (String args[ ])

42. What is the difference between a Window and a Frame?

43. Which package has light weight components?

44. What is the difference between the paint() and repaint() methods?

45. What is the purpose of File class?

46. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

47. Which class should you use to obtain design information about an object?

48. What is the difference between static and non-static variables?

49. What is Serialization and deserialization?

50. What are use cases?

51. Explain the use of sublass in a Java program?

52. How to add menushortcut to menu item?

53. What is synchronization?

54. What is the Collections API?

55. What is the relationship between clipping and repainting under AWT?

56. What are ClassLoaders?

57. What will happen if static modifier is removed from the signature of the main method?

58. Can a top level class be private or protected?

59. Is it necessary that each try block must be followed by a catch block?

60. When a thread is created and started, what is its initial state?

61. What is the Locale class?

62. What are synchronized methods and synchronized statements?

63. What is runtime polymorphism or dynamic method dispatch?

64. What is Dynamic Binding(late binding)?

65. What are the advantages of ArrayList over arrays?

66. Why deletion in LinkedList is fast than ArrayList?

67. How do you decide when to use ArrayList and LinkedList?

68. What is a Values Collection View ?

69. What is dot operator?

70. Where and how can you use a private constructor?

71. What is type casting?

72. What is the difference between the >> and >>> operators?

73. Which method of the Component class is used to set the position and size of a component?

74. Define canvas?

75. Define Network Programming?

76. What is a Socket?

77. Advantages of Java Sockets?

78. Disadvantages of Java Sockets?

79. Which class is used by server applications to obtain a port and listen for client requests?

80. Which class represents the socket that both the client and server use to communicate with each other?

81. Why Generics are used in Java?

82. What environment variables do I need to set on my machine in order to be able to run Java programs?

83. If System.exit (0); is written at the end of the try block, will the finally block still execute?

84. When was C language developed?