I am trying to call a class, and I keep getting a construct instead why? Is there a reason why this would keep happening? Just a list of some basic reason why this happens would be appriciated.
Printable View
I am trying to call a class, and I keep getting a construct instead why? Is there a reason why this would keep happening? Just a list of some basic reason why this happens would be appriciated.
could you supply the code that's giving you trouble and the result.
How are you "calling" a class? Do you mean you are trying to create an instance of the class?
Or to call a method in a class?
First class:
Second class:Code:public class client extends Player implements Runnable {
//code here
}
Code:public class OBJECTS2 extends client {
//code here
}
Error Thrown:
Code:OBJECTS2.java:2: error: constructor client in class client cannot be applied to
given types;
public class OBJECTS2 extends client {
^
required: Socket,int
found: no arguments
reason: actual and formal argument lists differ in length
1 error
Finished!
Press any key to continue . . .
You need to post all of the code for all of the classes. Your edited,shortened code samples are useless.
This code compiles with no errors:
Code:public class InheritanceTest {
class Player {}
class client extends Player implements Runnable {
//code here
public void run(){}
}
class OBJECTS2 extends client {
//code here
}
}