Java Questions Part2 - OOPS Concept, Constructors, Static keyword

  1. What are OOPS concepts?
  2. Provide real time examples for each and every OOPS concepts?
  3. What is inheritance? Types of inheritance? Does multiple inheritance allowed in java. If not, why?
  4. Does an interface implements or extends another interface
  5. Can multiple inheritances support in Interface?
  6. Examples of Abstract and Interface used in selenium project?
  7. Can we extend multiple interfaces
  8. What are abstract classes and methods in Java?
  9. What is an Abstract Class? Write an example code?
  10. diff between abstract and interface
  11. Can we use private and protect access modified inside a Interface?
  12. What is polymorphism? How we can achieve it? 
  13. Explain run time polymorphism and compile time polymorphism with examples?
  14. Difference between method overloading and method over riding?
  15. Can we achieve method overloading when two methods have only difference in return type.
  16. Method overloading and overriding examples in Selenium project?
  17. What is encapsulation?
  18. What is IS-A and HAS-A relation in java With examples?
  19. Explain runtime polymorphism and compile time with examples?
  20. Can we overload main method?
  21. Can final methods be overloaded?
  22. Can static methods be overloaded?
  23. Can static methods be overridden?
  24. Class a { } class b extends a { } A a= new A(); B b=new B(); A a= new B(); B a=new A(); Which is valid and invalid?
  25. Suppose i have 100 methds in my interface i want to implement only 2 methods in my class.. how to do?
  26. Class A has 100 funcations and class B wants to use 20 functions, how to use without inheritance?
  27. Create a custom class which contains an interface in it and custom class should be responsible for performing operations. Which type of interface will you use to create such a custom class?
  28. What is a Constructor? Types of Constructor?
  29. When will you use this and super in a constructor?
  30. What is the purpose of using ‘this’ keyword in Java?
  31. Can a constructor be private?
  32. Can you make the constructor of a class static?
  33. If you want to call a constructor from parent class, what will you do?
  34. What is the purpose of using Constructors in Java?
  35. How Constructors are different from Methods in Java?
  36. Is Overriding applicable for Constructors in Java?
  37. what is static block in java
  38. What is instance block at class level and method level?
  39. What are static and non static methods and why will you create static and non static methods? 
  40. What are static variables and methods?
  41. diff between static and non- static
  42. What is final and super keyword? Difference between them?
  43. Can we execute a class without a main method?
  44. if static is for memory management then why to use non static?
  45. What is the difference between static and instance variable in Java?
  46. What is the difference between static and non-static methods in Java?
  47. Explain the difference between static and instance methods in Java?
  48. Can final/Static method be overloaded?
  49. Can final/Static methods be overridden?

No comments:

Post a Comment