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



Home Answers Viewqa Java-Beginners how can i define only one method from the interface.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Rajeevgandhi
how can i define only one method from the interface.
1 Answer(s)      5 years and 9 months ago
Posted in : Java Beginners



Advertisement
View Answers

January 10, 2009 at 12:35 AM


Hi friend,

If u declare the methods in interface then it must be define in the class
that implement the interface.

for e.g :

interface abc
{
public void m1();
public void m2();
public void m3();
}
class c1 implements abc
{
public void m1()
{
System.out.println("Hello world");
}
public void m2()
{
System.out.println("Hello world");
}

public void m3()
{
System.out.println("Hello world");
}

}


Thanks


Related Tutorials/Questions & Answers:
how can i define only one method from the interface. - Java Beginners
how can i define only one method from the interface.  If i am having an interface with 3 methods(declaration) . If i want to use only one method..., If u declare the methods in interface then it must be define in the class
how can i display the dates of one week by selecting the date randomly from the calendar?
how can i display the dates of one week by selecting the date randomly from... display the calendar, simultaneously i want to display the list of seven dates from the date selected from the calendar. how can we display the dates by picking
Advertisements
I want only one method goes to sleep but both method goes to sleep together
I want only one method goes to sleep but both method goes to sleep... and Computer's turn. But when i call Sleep() before cpuPlay() method or after... really tried very hard to find why it is making sleep() to both method together but i
I want only one method goes to sleep but both method goes to sleep together
I want only one method goes to sleep but both method goes to sleep... and Computer's turn. But when i call Sleep() before cpuPlay() method or after... really tried very hard to find why it is making sleep() to both method together but i
How can I Define a JFrame subclass that has four vertically positioned buttons. - Java Beginners
How can I Define a JFrame subclass that has four vertically positioned buttons.  How can I Define a JFrame subclass that has four vertically...*; public class DisplayButtons extends JFrame { int i=0; static JPanel panel
I want to Transfer only 1/3rd of contents from one folder to other but my code is transferring all contents
I want to Transfer only 1/3rd of contents from one folder to other but my code...("No files in directory: " + src); } for (int i = 0; i < entries.length; i++) { File file = entries[i
I have only one day to visit the Jaipur..
I have only one day to visit the Jaipur..  Hi, I have only a day to travel in Jaipur ..hence, bit worried about what to see first
how to open one Jframe from main method call
how to open one Jframe from main method call  I have downloaded... the main() method, when i run this Engine.java class game starts running... don't want in my project Here is the code that i have included in main method
Given a list of methods for a stateful or stateless session bean class, define which of the following operations can be performed from each of those methods: SessionContext interface metho
, define which of the following operations can be performed from each... Business method from component interface SessionContext... Business method from component interface SessionContext methods
Can a method inside a Interface be declared as final?
Can a method inside a Interface be declared as final?   Hi, Can a method inside a Interface be declared as final? Thanks
Can a method inside a Interface be declared as final?
Can a method inside a Interface be declared as final?   Hi, Can a method inside a Interface be declared as final? Thanks
How can i pass the valus from a JSP to the action class???
How can i pass the valus from a JSP to the action class???  hewllo wevryone... can anyone help me with how i can pass the value of menuId in my JSP and pass it in the action class
How can i read a file from nth line onwards in java
How can i read a file from nth line onwards in java  Hi, I need to read a file content from its nth line onwards till end. How can i implement it in java. Regards, Chinnu
how can i run ASP.Net Server from netbeans IDE?
how can i run ASP.Net Server from netbeans IDE?  please help me how can i run ASP.Net Server from netbeans IDE? in other word , I have a web services published with IIS7 and I want to use it from my Application My Application
How Can I get ArrayList of Data from jsp with ajax request
How Can I get ArrayList of Data from jsp with ajax request  Hi, I retereved 5 Employee Record of Data from Struts Action class to jsp with ajax response. But I don't how how can reterve this dynamic 5 employee records
How can i Dispose Dialog box From LWUIT Component >
How can i Dispose Dialog box From LWUIT Component >  Hi All, i am Developing one mobile application using lwuit,Midlet.in that am trying to show a dialog when i press key "0". again if i press key "4" the Dialog should
how can i use one dbase conection in serveral pages - JSP-Servlet
how can i use one dbase conection in serveral pages  Hi! Thanks... connections many times whereever i need in several pages. How can I avoid this....that means i want to write only one time and i want to call that in other pages
How can i download these java related materials from rose india
How can i download these java related materials from rose india  How can i download these java related materials from rose india   Hello... tutorial do you want to download from the site? Please specify it. Thanks
i have one txt field and one button.when i entere any test in testfield then only button should be enabled.
i have one txt field and one button.when i entere any test in testfield then only button should be enabled.  i have one txt field and one button.when i entere any test in testfield then only button should be enabled. i need
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...
how can create pop() method in this program ,Or how can delete image in it when... safety, * this method should be invoked from the * event-dispatching thread... dose the work method ? } if(e.getSource() == b1) { pop();// i wont if i press
i have one txt field and one button.when i entere any test in testfield then only button should be enabled. i need for this
i have one txt field and one button.when i entere any test in testfield then only button should be enabled. i need for this   i have one txt field and one button.when i entere any test in testfield then only button should
Interface in java with example
static constant and abstract method. We can only implement a class and extended it by other interface. We can extend one or more other interfaces but cannot... method heading listed in interface. We can take the interface check
actually i want to knw how to include an google page inside a tab(suppose in 2nd tab).can any one help me....
how to include an google page inside a tab(suppose in 2nd tab).can any one help me....  actually i want to knw how to include an google page inside a tab(suppose in 2nd tab).can any one help me
How can I do it? .click();
How can I do it? .click();  I have a very unusual problem. I want...("a"); x.click(); </script> So it's click on an element witch one Id's is "a", but I want that it make mouseup in this element. How can I do it, because if I write
how can i send a mail to a particular user from a many user dropdown list in jsp
how can i send a mail to a particular user from a many user dropdown list in jsp  how can i a sent a user question to a particular person from a drop down list in jsp
How can I learn Java?
How can I learn Java?  Hi, I have just completed a course in HTML and C programming language. I have some programming experience in visual basic... programming. How can I learn Java? in shortest possible time. I mean I just want to begin
how should i can solve
how should i can solve  Web based program - Input - Person's contact details with Passport Number as Unique Key. Save data in to oracle / MySQL. Output - List of Persons saved in the database. Technology to be used - JSP
How can print integer in method
How can print integer in method   a method call process public process(int jobid,int remain){ } how to print int jobid ,int remain in for loop jobid in proc[0],remain in proc[1],both show in text file how to print proc[0
Define the session factory interface in hibernate?
Define the session factory interface in hibernate?  Define the session factory interface in hibernate?   Session factory is used for manageing the session objects.public interface SessionFactory extends Referenceable
How can i extract email ids from xls/xlsx file in java?
How can i extract email ids from xls/xlsx file in java?  that's the code..... i tried to extract email id;s from xls file........... but it doesn;t...); for (int i = 0; i < dataHolder.size(); i
How i write a function/method in jsp?
How i write a function/method in jsp?  How write the function/method in jsp? Using that method i can retrieve the value coming from database. give.... And the details come from different table and id is store in user table. I hope you all
Advertisements
 

 

 

DMCA.com