Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Ramesh{
- Ramesh(){
- System.out.println("I'm from Ramesh Baap class");
- }
- }
- class Suresh extends Ramesh{
- Suresh(){
- System.out.println("I'm from Suresh Bacha class");
- }
- }
- public class Main{
- public static void main(String[] args){
- Suresh obj = new Suresh();
- }
- }
- /* Output:
- I'm from Ramesh Baap class
- I'm from Suresh Bacha class
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement