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



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

Have Programming Question? Ask it here!
 
 
 


Rajeevgandhi
how can i define only one method from the interface.
1 Answer(s)      5 years and 7 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
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
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
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 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
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
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
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
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
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
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
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
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 POST form data from a C#/ASP.NET to a remote website?
How can I POST form data from a C#/ASP.NET to a remote website?  I'm trying to send data to a remote PHP website. I want to send the data in sessions using HTTP POST. The thing is, my website is built in C#/ASP.NET, and I don't
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
We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only
We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only  We just have one file on the hard disk. But we can create directories, sub-directories and files in that file
We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only
We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only  We just have one file on the hard disk. But we can create directories, sub-directories and files in that file
how can i create a discussion forum?
how can i create a discussion forum?  how can i create a discussion forum for my e- mentoring site for women which can be used by a registered user only. i am using jsp and servlets and i am working with netbeans 6.8.
DB2 Universal claims to support JDBC 2.0, But I can only get JDBC 1.0 functionality.
DB2 Universal claims to support JDBC 2.0, But I can only get JDBC 1.0 functionality.  DB2 Universal claims to support JDBC 2.0, But I can only get JDBC 1.0 functionality. What can I do
Works only for one row
Works only for one row   Hi, My below code is working only... retrieved from the database. <%@page import="java.util.concurrent.CountDownLatch...{ ps=con.prepareStatement("Select DBID,Query_Raised,TR from Scope1 where TR
How can I protect my database password ?
How can I protect my database password ?   How can I protect my... in as plain text. What can I do to protect my passwords... a database over the internet. I have concerns about the security of the database
how can i set an object in focus
how can i set an object in focus  There is a Canvas object in my game... by '/' then only one fruit is there for snake int emptyFound = 0; int...();*/ } } And also i am attching actionPerformed() method of Play
When will you define a method as static?
When will you define a method as static?  Hi, When will you define a method as static? thanks
how i can get jqfade.js library
how i can get jqfade.js library  how i can get jqfade.j script library
how can i add hibernate plugin to eclipse?
how can i add hibernate plugin to eclipse?  how can i add hibernate plugin to eclipse
How can i use Facebook connect button
How can i use Facebook connect button  Please to meet you all guys I wonder how can i use this Connect to facebook for me to post in a particular... http://likekhevy4.blogspot.com/ How can i apply this kind of comment with "Connect
how can i close a frame. - Java Beginners
how can i close a frame.  Hi, My question is how can we close... frames as i go on clicking button...........can we have like when i click on button... and in that table is displayed and one button is added to that frame
how can i make monthly register ?
how can i make monthly register ?  how can i make monthly register ? iam using jdeveloper
how can i remove newline characters and tabs
how can i remove newline characters and tabs   how can i remove newline characters and tabs ? but i wont to using GUI .please help
how can i print the selected content of a frame
how can i print the selected content of a frame  hello sir, I am designing a bill calculate program. I want to print the bill in crystal form. I want to skip all the text fields shapes and all the button from the frame.. but all
How to play only video file from any link
How to play only video file from any link  Hi Friends Please Help Me. My requirement is to play only videos from any webpages(ITS NOT A ABSOLUTE PATH)[IF I PASTE any VRL---,IT HAS TO BE PLAY IN ANY CONTROL] how it possible
How can I to my database to my application
How can I to my database to my application  How can I to my database to my application   Hi, Please see the JDBC discussion thread. Thanks
how can i display a editable result of form?
how can i display a editable result of form?  how can i display a editable result of form? i know how to display form result but the result... show the result but i can not modify the result. how can i display modifyable
 

 

 

DMCA.com