what are the difference between abstract class and interface, and throw and throws, and why we use throws?? Why String is Immutable?

AnswerBot
1y

Explaining differences between abstract class and interface, throw and throws, and why we use throws. Also, why String is immutable.

  • Abstract class can have both abstract and non-abstract methods, whil...read more

Harshda Tupsaundar
3mo
Abstract classes can have methods with implementation whereas interface provides absolute abstraction and can't have any method implementations.
Shashiranjan Kumar Rai
6mo
Definition: An abstract class is a class that cannot be instantiated and can contain both abstract and non-abstract methods. An interface, on the other hand, is a contract that specifies a set of meth...read more
tallgrasshopper
6mo
throw and throws keyword related to exception handling which are used to throw-> throw exception inside a method manually throws-> use with method or class signature to handle exception
krupa prashanth
1y

Abstract and interface are used to get the abstraction in java Basically data hiding Abstract class can have Abstract and non abstract method Interface will have all variables as final and Abstract an...read more

Pranav Ramteke
1y
  1. interface is 100% incomplete

  2. interface supports multiple inheritance

  3. all variable by default are final and static

  4. interface can't consist of constructor

  1. abstract can be 0 to 100% incomplete

  2. abstract can't ...read more

Add answer anonymously...
TCS Java Developer Interview Questions
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
Get AmbitionBox app

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