hi all,
when i am trying to implement an interface,at compile time when i am trying to compile the implementation class i am getting an error like can not resolve the symbol.what may be the problem?please send it as soon as possible
ex:interface:
import java.rmi.*;
public interface MyRemote extends Remote
{
public int add(int i,int j)throws RemoteException;
public int sub(int i,int j)throws RemoteException;
}
implementation class:
import java.rmi.*;
import java.rmi.server.*;
public class MyImpl implements MyRemote
{
public MyImpl() throws RemoteException{
}
public int add(int i,int j)
{
System.out.println("In add method of MyImpl");
return(i+j);
}
public int sub(int i,int j)
{
System.out.println("In sub method of MyImpl");
return(i-j);
}
};
3 2200
hi all,
when i am trying to implement an interface,at compile time when i am trying to compile the implementation class i am getting an error like can not resolve the symbol.what may be the problem?please send it as soon as possible
ex:interface:
import java.rmi.*;
public interface MyRemote extends Remote
{
public int add(int i,int j)throws RemoteException;
public int sub(int i,int j)throws RemoteException;
}
implementation class:
import java.rmi.*;
import java.rmi.server.*;
public class MyImpl implements MyRemote
{
public MyImpl() throws RemoteException{
}
public int add(int i,int j)
{
System.out.println("In add method of MyImpl");
return(i+j);
}
public int sub(int i,int j)
{
System.out.println("In sub method of MyImpl");
return(i-j);
}
};
1.) Use code tags when posting code
2.) What's the full error message you got?
hi all,
when i am trying to implement an interface,at compile time when i am trying to compile the implementation class i am getting an error like can not resolve the symbol.what may be the problem?please send it as soon as possible
ex:interface:
import java.rmi.*;
public interface MyRemote extends Remote
{
public int add(int i,int j)throws RemoteException;
public int sub(int i,int j)throws RemoteException;
}
implementation class:
import java.rmi.*;
import java.rmi.server.*;
public class MyImpl implements MyRemote
{
public MyImpl() throws RemoteException{
}
public int add(int i,int j)
{
System.out.println("In add method of MyImpl");
return(i+j);
}
public int sub(int i,int j)
{
System.out.println("In sub method of MyImpl");
return(i-j);
}
};
Hi,
Compiler will be definitely pointing to the line exactly where u r getting error. And It will also giving u the name of the symbol, which it is not able to resolve.....So go to that line and find that symbol.... Either u have mistype the symbol name or u haven't define that symbol at all.
Check it again... or send ur error.
Nepomuk 3,112
Recognized Expert Specialist
hi all,
when i am trying to implement an interface,at compile time when i am trying to compile the implementation class i am getting an error like can not resolve the symbol.what may be the problem?please send it as soon as possible
Hi mamathareddy! Welcome to TSDN!
I copied your classes and could not recreate the error - however, possibly my main method is different: -
public static void main(String[] args) {
-
try
-
{
-
MyImpl impl = new MyImpl();
-
System.out.println("Add: " + impl.add(23, 42));
-
System.out.println("Sub: " + impl.sub(42, 23));
-
}
-
catch(Exception e)
-
{
-
System.err.println(e);
-
}
-
}
-
Normally ... cannot be resolved indicates, that you did something like
Without defining impl with MyImpl impl.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Java script Dude |
last post by:
I am investigating a solution to build all pages sent from my
application servlet in UTF-8 encoding. From what I understand, I
should be using HttpServletResponse.setCharacterEncoding("UTF-8"). The...
|
by: yanwan |
last post by:
I met this problem in executing a c++ project in visual studio.
Does anyone have suggestions to resolve "error lnk 2001"?
--------------------Configuration: reconstruction - Win32...
|
by: Tony Johansson |
last post by:
Hello!
I get compile error when compiling using the command javac from the command
terminal window(CMD).
I have just two classes which are called HelloWorld.java and Slask.java.
I have both...
|
by: asanford |
last post by:
We use StackWalk(StackWalk64) from dbghelp.dll to walk our
callstacksas needed, using the various Sym* methods
(SymGetSymFromAddr, SymGetLineFromAddr) to resolve source file,
function name, and...
|
by: vsp15584 |
last post by:
Hii..i use the coding as below :-
import java.applet.applet;
import java.awt.*;
import com.sun.j3d.utils.applet.mainframe;
import com.sun.j3d.utils.universe.*;
import...
| |
by: toish |
last post by:
I have a program, aaa.java which creates an instance of another class(bbb.java).
both java files are in a package entitled 'diss'
bbb.java compiles sucessfully
aaa.java throws a cannot resolve...
|
by: adamrace |
last post by:
Hi,
i am fairly new to java and have been stuck on this for ages, basically i need to create a new object which gets a list of data from a text file, so i have this
import java.io.*;
...
|
by: momov4 |
last post by:
I can't seem to resolve these errors. I have had people compile these codes on their computers with no problem, but I keep getting errors...can anyone help????
Here are the errors:
cannot find...
|
by: sunil |
last post by:
Hi ,
Am facing one problem while deploying the shared library in different
boxes.
I devoloped one shared library for TAM suite ( This is a IBM product
for different authentication mechanisms)...
|
by: Sindhu Rani |
last post by:
i hav created 3 classes in 3 different files. am gettin an error durin compilation. wat shud i do???
C:\s\source>javac -d ..\classes devtestdrive.java
devtestdrive.java:5: cannot resolve symbol...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |