-
How to inherit class in Java progamming
How to inherit class in Java progamming
Question asked by visitor sagar reddy
-
Junior Member
Re: How to inherit class in Java progamming
For extending a class in java programming, u should make use of 'extends' keyword.
Ex: ClassA is the class which u would like to inherit in ClassB. Code is as follows
//CODE
public class ClassB extends ClassA {
Note: we cannot inherit more than one class at a time in Java. For this we must go for multilevel inheritance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules