OOPS and Core Java Interview Question and Answers

17. What is the impact of private constructor?
  Private constructors prevent a class from being explicitly instantiated by callers.
 
Your Name Your Email-ID
Your Answer
18. What is Pass by Value and Pass by Reference?
 
  • In Pass by Value the function or subroutine receives a copy of variable.
  • The function or the method cannot change variable values.
  • In Pass By Ref the function or subroutine receives a pointer of the variable. And any changes to variable value are also visible outside the function or subroutine.
 
Your Name Your Email-ID
Your Answer
19. Distinguish between process based multitasking and thread based multitasking?
 
  • Process based multitasking is the feature that allows a computer to run two or more programs concurrently.
  • In process based multitasking, a program is the smallest unit of dispatch able code.
  • In thread based multitasking, a single program can perform two or more tasks simultaneously.
  • In thread based multitasking, the thread is the smallest unit of dispatch able code.
  • Process based multitasking deals with the 'big picture', and thread based multitasking handles the details.
 
Your Name Your Email-ID
Your Answer
20. What is Recursion?
 
  • Recursion is the process of defining something in terms of itself.
  • In other words, a method that calls itself is said to be recursive.
  • The classic example of recursion is the computation of the factorial of a number.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 5 of 10