interface_sample
PHP Code:
public interface interface_sample {

    
void method1 ();
    
void method2 ();
    
void method3 ();
    
void method4 ();



interface_implemented
PHP Code:
public class interface_implemented implements interface_sample {

    public 
void method1() {
        
/// method
    
}

    public 
void method2() {
        
/// method
    
}

    public 
void method3() {
        
/// method
    
}

    public 
void method4() {
        
/// method
    
}


SampleObject
PHP Code:
public class SampleObject {
    
SampleObject(interface_sample obj){

        
// do something
    
}





main
PHP Code:
public class test {

    public static 
void main(String[] input){

        
SampleObject sample = new SampleObject( new interface_implemented());

        
// SampleObject wants an object with methods described in the interface_sample
        // interface_implemented is a class that implements the interface_sample
        // the new interface_implemented object can be passed to the SampleObject constructor


    
}