Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners java interfaces
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


shanthi
java interfaces
1 Answer(s)      2 years and 11 months ago
Posted in : Java Beginners


sample code for multiple interface


Advertisement
View Answers

January 23, 2012 at 1:21 PM


interface A {
   void test(int i);
}
interface B {
   void test(String s);
}
public class MultipleInterface implements A, B {
  public void test(int i) {
    System.out.println("Interface A is testing......"+i);
  }
  public void test(String s) {
    System.out.println("Interface B is testing......"+s);
  }
  public static void main(String[] a) {
    MultipleInterface t = new MultipleInterface();
    t.test(42);
    t.test("Hello");
  }
}


Related Tutorials/Questions & Answers:
Java interfaces
Java interfaces  What interface must an object implement before it can be written to a stream as an object
java interfaces
java interfaces  sample code for multiple interface   interface A { void test(int i); } interface B { void test(String s); } public class MultipleInterface implements A, B { public void test(int i
Advertisements
Marker interfaces in java
Marker interfaces in java  how marker interfaces work
java interfaces implementation
java interfaces implementation  hai I have defined one inter face like Maths taking methods like add(), sub(), mul()in interface I take different implementation classes for add() method and sub()and mul() when i trying
interfaces - Java Beginners
, super class constructor runs.what about interfaces?  Hi Friend... is called the base class or the parent class. To derive a class in java the keyword... to : http://www.roseindia.net/java/language/inheritance.shtml Thanks
Interfaces - Java Interview Questions
Interfaces  two interfaces having same method names and these two interfaces are implemented by a single class. so now i would like to generate different code of same methods of different interfaces. eg: ---- interface i1
Interfaces - Java Interview Questions
Interfaces  two interfaces having same method names and these two interfaces are implemented by a single class. so now i would like to generate different code of same methods of different interfaces in single class? my query
how to create interfaces in java
how to create interfaces in java  HI, Here is my code public interface validateInfo { public void validate(String empcode, String password); } class updateInfo implements validateInfo { public void update() { //code
interfaces - Java Beginners
interfaces  examples on interfaces  Hi Friend, Please visit the following links: http://www.roseindia.net/java/master-java/interface.shtml http://www.roseindia.net/java/java-exception/create-interface.shtml
interfaces
& interfaces.   An interface declaration introduces a new reference type whose members are classes, interfaces, constants and abstract methods... to directly implement one or more interfaces, meaning that any instance of the class
What are the different types of interfaces in java? - Java Interview Questions
What are the different types of interfaces in java?  Hi, Is it correct question.I faced this in one interview. If yes can u tell me please. thanks chandu
Overview of Networking through JAVA,Getting list of Local Interfaces on a machine
Getting list of Local Interfaces on a machine... to find out the total no of list of local interfaces available on a machine. Here... the local interfaces which are instances of NetworkInterface class and displays
EJB Interfaces
EJB Interfaces       Interface in java means a group of related methods with empty bodies. EJB have generally 4 interfaces. These are as follows 1)Remote interface:- Remote interface
Interfaces in flex
Interfaces in flex  Hi..... Please tell me about... What are - IStyleClient, IChildList, ILayoutManager, IToolTipManagerClient, IInvalidating, IValidatorListener, IFlexModule, IAutomationObject, IPropertyChangeNotifier
EJB Interfaces
EJB Interfaces       Interface in java means a group of related methods with empty bodies. EJB have generally 4 interfaces. These are as follows 1)Remote interface:- Remote interface
What are Callback interfaces?
What are Callback interfaces?  Hi, What are Callback interfaces? thanks
Hibernate Callback interfaces
Hibernate Callback interfaces  What are Callback interfaces?   Callback interfaces allow the application to receive a notification when something interesting happens to an object?for example, when an object is loaded
interfaces,exceptions,threads
interfaces,exceptions,threads  SIR,IAM JAVA BEGINER,I WANT KNOW THE COMPLETE CONEPTS OF INTERFACES,EXCEPTIONS,THREADS   Interface... class. In java, multiple inheritance is achieved by using the interface
Collection Interfaces
Collection Interfaces     ... of several interfaces, and classes that implement those interfaces, contained within... of objects.  Different interfaces describe different types of functionalities
What are the Core interfaces are of Hibernate framework?
What are the Core interfaces are of Hibernate framework?  Hi, What are the Core interfaces are of Hibernate framework? Thanks
Hibernate: core interfaces of hibernate framework
Hibernate: core interfaces of hibernate framework  What are the core interfaces of hibernate framework   Most of hibernate based application code deals with following interfaces provided by the Hibernate Core
Interfaces and Abstract Classes - Development process
Interfaces and Abstract Classes  What are the Scenarios where we use Interface and Abstract Classes?  Hi Friend, Interface: Java does... by using the interface. Interfaces are useful when you do not want classes
Java API
Java API       Java API Java API is not but a set of classes and interfaces that comes with the JDK. Java API is actually a huge collection of library
Jep's Rich User Interfaces blog
Jep's Rich User Interfaces blog       About AJAX Performance and some other things by Jep Castelein of Backbase Read full Description
Getting list of Local Interfaces on a machine
Getting list of Local Interfaces on a machine... to find out the total no of list of local interfaces available on a machine. Here... the local interfaces which are instances of NetworkInterface class and displays
Classes and Interfaces of the I/O Streams
Classes and Interfaces of the I/O Streams   ...;Writer It uses for writing to character stream. Interfaces: The following summary of Interfaces provided by the java.io package shown in the table
Interface in Java
Interface in Java       In this section we will learn about Interface and Marker Interfaces in Java... is also the interface's example. But in java programming language interface
EJB 3.1 - EJB Interfaces are Optional
In EJB 3.1, now you do not need to define any interfaces for Session Beans, just like JPA Entities and Message Driven Beans. All you have to do is annotate a POJO with the @Stateless or @Stateful to get a fully functional EJB
Graphical User Interfaces
Graphical User Interfaces       A class library is provided by the Java programming language... to the display area with a layout manager. As the Java programming language, the AWT
Identify the interfaces and methods a JMS message-driven bean must implement.
Identify the interfaces and methods a JMS message-driven bean must... Contract Next    Identify the interfaces and methods a JMS... ReservationHomeLocal resHome = (ReservationHomeLocal) jndiContext.lookup ("java
Identify the interfaces and methods a CMP entity bean must and must not implement.
Identify the interfaces and methods a CMP entity bean must and must not implement.Prev Chapter 6. Component Contract for Container... the interfaces and methods a CMP entity bean must and must not implement. 
Advertisements
 

 

 

DMCA.com