Answers for "java interface define variable"

1

use variables in interface java

public class MyInterfaceImpl implements MyInterface {

    public void sayHello() {
        System.out.println(MyInterface.hello);
    }
}
Posted by: Guest on September-16-2020
6

java interface

public interface Exampleinterface {
	
  public void menthod1();
  
  public int method2();

}

class ExampleInterfaceImpl implements ExampleInterface {


  	public void method1()
    {
        //code here
    }
  
    public int method2()
  	{
    	//code here
  	}

}
Posted by: Guest on May-28-2020

Browse Popular Code Answers by Language