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
interface is 100% incomplete
interface supports multiple inheritance
all variable by default are final and static
interface can't consist of constructor
abstract can be 0 to 100% incomplete
abstract can't ...read more
Add answer anonymously...
Top TCS Java Developer interview questions & answers
Popular interview questions of Java Developer
Stay ahead in your career. Get AmbitionBox app
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