Sort by

recency

|

123 Discussions

|

  • + 0 comments

    user super keyword

    import java.util.*;
    import java.io.*;
    
    class BiCycle{
    	String define_me(){
    		return "a vehicle with pedals.";
    	}
    }
    
    class MotorCycle extends BiCycle{
    	String define_me(){
    		return "a cycle with an engine.";
    	}
    	
    	MotorCycle(){
    		System.out.println("Hello I am a motorcycle, I am "+ define_me());
    
    		String temp=super.define_me(); 
    
    		System.out.println("My ancestor is a cycle who is "+ temp );
    	}
    	
    }
    class Solution{
    	public static void main(String []args){
    		MotorCycle M=new MotorCycle();
    	}
    }
    
  • + 0 comments

    Because they don’t have a frame, the lens shape and size can be more varied, allowing for more experimentation with unique designs. Some rimless sunglasses even incorporate bold shop page, creative shapes and accents around the temples, offering the wearer a more individualized look that blends function and fashion. They can also accommodate different lens tints or finishes more easily, offering customization options for those who want to adjust their sunglasses for specific purposes like driving, sports, or outdoor adventures.

  • + 0 comments

    import java.io.; import java.util.;

    public class Solution {

    public static void main(String[] args) {
      cycle c = new cycle();
      c.print();
    
      }
    

    }

    class Motorcycle{ public void print(){ System.out.println("Hello I am a motorcycle, I am a cycle with an engine.");

    };
    

    } class cycle extends Motorcycle{ @Override public void print(){ super.print();

    System.out.println("My ancestor is a cycle who is a vehicle with pedals.");
    

    }

    }

  • + 0 comments

    my code:

    import java.io.; import java.util.;

    class bicycle { String text(){ return " with pedals.";

    }
    

    }

    class moto extends bicycle{ String text(){ return " an engine.";

    }
    moto(){
        System.out.println("Hello I am a motorcycle, I am a cycle with"+ text());
        String ss = super.text();
    
        System.out.println("My ancestor is a cycle who is a vehicle"+ ss);
    }
    

    }

    public class Solution {

    public static void main(String[] args) {
        moto bi = new moto();
    
    }
    

    }

  • + 0 comments

    Method overriding in Java lets a subclass redefine a method from its parent class, allowing for specialized behavior. The super keyword is used to invoke the parent class's method, ensuring the original functionality is preserved alongside the new implementation.

    For more interesting insights and analyses, check out the latest Today IPL Match at for expert match forecasts and updates.