JAVA EXAMPLE PROGRAMS

JAVA EXAMPLE PROGRAMS


Question: What is the difference between preemptive scheduling and time slicing?


Answer:
Preemptive scheduling: The highest priority task executes until it enters
the waiting or dead states or a higher priority task comes into existence.

Time slicing: A task executes for a predefined slice of time and then reenters
the pool of ready tasks. The scheduler then determines which task should execute
next, based on priority and other factors.
<< Previous Question | Next Question >>
blog comments powered by Disqus

List Of Interview Questions:

  1. Can Java thread object invoke start method twice?
  2. Give the list of Java Object class methods.
  3. Can we call servlet destory() from service()?
  4. Can we override static method?
  5. Can you list serialization methods?
  6. What is the difference between super() and this()?
  7. How to prevent a method from being overridden?
  8. Can we create abstract classes without any abstract methods?
  9. How to destroy the session in servlets?
  10. Can we have static methods in interface?
  11. What is transient variable?
  12. Incase, there is a return at the end of try block, will execute finally block?
  13. What is abstract class or abstract method?
  14. What is default value of a boolean?
  15. When to use LinkedList or ArrayList?
  16. What is daemon thread?
  17. Does each thread in java uses seperate stack?
  18. What is the difference between Enumeration and Iterator?
  19. Find out switch statement output.
  20. Does system.exit() in try block executes finally block?
  21. What is fail-fast in java?
  22. What is final, finally and finalize?
  23. In java, are true and false keywords?
  24. What are the different session tracking methods?
  25. What is the purpose of garbage collection?
  26. What are the types of ResultSet?
  27. What is difference between wait and sleep methods in java?
  28. What is servlet context?
  29. What happens if one of the members in a class does not implement Serializable interface?
  30. What is race condition?
  31. How to get current time in milli seconds?
  32. How can you convert Map to List?
  33. What is strictfp keyword?
  34. What is System.out in Java?
  35. What is difference between ServletOuptputStream and PrintWriter?
  36. What is java static import?
  37. When to use String and StringBuffer?
  38. What is difference between StringBuffer and StringBuilder?
  39. What is wrapper class in java?
  40. Is Iterator a Class?
  41. What is java classpath?
  42. Can a class in java be private?
  43. Is null a keyword in java?
  44. What is the initial state of a thread when it is started?
  45. What is the super class for Exception and Error?
  46. What is Class.forName()?
  47. Can interface be final?
  48. What is the difference between exception and error?
  49. What is default value of a local variables?
  50. What is local class in java?
  51. Can we initialise uninitialized final variable?
  52. Can we declare abstract method as final?
  53. Can we have finally block without catch block?
  54. What is pass by value and pass by reference?
  55. Can we declare main method as private?
  56. What is the difference between preemptive scheduling and time slicing?
  57. Can non-static member classes (Local classes) have static members?
  58. What are the environment variables do we neet to set to run Java?
  59. Can you serialize static fields of a class?
  60. What is the difference between declaring a variable and defining a variable?
  61. Where can we use serialization?
  62. What modifiers are allowed for methods in an Interface?
  63. What is the purpose of Runtime and System class?
  64. Which one is faster? ArrayList or Vector? Why?
  65. What is the difference between static synchronized and synchronized methods?
  66. What is the order of catch blocks when catching more than one exception?
  67. What is the difference between the prefix and postfix forms of the increment(++) operator?
  68. What is hashCode?
  69. What is the difference between Hashtable and HashMap?
  70. What are the restrictions when overriding a method?
  71. What is the use of assert keyword?
  72. What is adapter class?
  73. What is difference between break, continue and return statements?
  74. What is the difference between while and do-while statements?
  75. When does the compiler provides the default constructor?
  76. Difference between C++ and Java.
  77. Usages of java packages.
  78. What is dynamic class loading?
  79. What happens if you do not provide a constructor?
  80. Difference between shallow cloning and deep cloning of objects?
  81. Can we have interfaces with no defined methods in java?
  82. What is the difference between “==” and equals() method?
  83. How can you create an immutable class in java?
  84. What are access modifiers?
  85. Can we have private constructor in java?
  86. Why do we need generics in java?
  87. What is the difference between a product and a project?
  88. How does substring() method works on a string?
  89. What is the difference between a Java Library and a framework?
  90. Next set of java interview questions
Knowledge Center
What is OOPs?
Object oriented programming organizes a program around its data, i.e. , objects and a set of well defined interfaces to that data. An object-oriented program can be characterized as data controlling access to code.

About Author

My name is Nataraja Gootooru, programmer by profession and passionate about technologies. All examples given here are as simple as possible to help beginners. The source code is compiled and tested in my dev environment.

If you come across any mistakes or bugs, please email me at java2novice@gmail.com or you can comment on the page.

Most Visited Pages

Other Interesting Sites

Reference: Java™ Platform Standard Ed. 6 - API Specification | Java is registered trademark of Oracle.
Privacy Policy | Copyright © 2014 by Nataraja Gootooru. All Rights Reserved.