Hey everyone, I am basically trying to just use the super keyword to call my subclass:
public class SenderReceiver extends MultiEchoClient{ public SenderReceiver(String host,int port){ super(host,port); } public static void main(String args[]){ if(args.length == 0){ SenderReceiver senderReceiver = new SenderReceiver((String) "127.0.0.1",4433); }else{ SenderReceiver senderReceiver = new SenderReceiver(args[0],4433); } //SenderReceiver.run(); } }
The super class has a constructor that passes String host,int port and so I am just trying to call that. I want to be able to have all the functionality in this new class so that if i mess up, then my superclass will be okay!
The compile error that i get is "unreported exception, must be caught or thrown". It is an IOException so I tried to encase the super(host,port); with a try catch block but it says that the super keyword must be declared first...
Thanks!