0

I am trying to call an external class with the following line

class "classname" implements "another classname" {

..I however keep getting an "Interface expected here" error at compilation. What am doing wrong, please?

3
Contributors
5
Replies
7
Views
9 Years
Discussion Span
Last Post by orko
0

Well, is the "other classname" an interface? The declaration expects you to have an interface name there, which your class implements. When you say "call " an external class, what exactly are you trying to do?

0

I have two .java files (with with a main method and one without). My goal is to call the class without main for use in the one with a main method.

0

You don't need to "implement" that class then. You just need to declare an object of that type and use whatever methods you need on it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.