Best Regards for me

Best Regards for me Interview Questions and Answers

Updated 16 Oct 2022

Q1. Q1.What is constructor? Q2What is encapsulation? Q3Which r parameter abstraction?

Ans.

A constructor is a special method used to initialize objects in a class.

  • Constructors have the same name as the class they belong to.

  • They are automatically called when an object is created.

  • Constructors can have parameters to initialize object properties.

  • They can be overloaded to provide multiple ways of object initialization.

Q2. 1.What is overriding? 2What are overloading?

Ans.

Overriding is when a subclass provides a different implementation of a method that is already defined in its superclass.

  • Overriding is used to achieve runtime polymorphism.

  • The method in the subclass must have the same name, return type, and parameters as the method in the superclass.

  • The overridden method in the superclass must be marked with the 'virtual' or 'abstract' keyword.

  • Example: Inheritance where a subclass overrides a method from its superclass.

Are these interview questions helpful?
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

4.2
 • 995 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Best Regards for me Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter