java - 'class' or 'interface' expected error -
i getting class
or interface
expected error. know how go it? new java , trying learn! in advance.
public class rallydevice { private int _sno; private time _currenttime; private double _dist; private double _avgspeed; private double _requiredtime; private time _idealtime; } public rallydevice(){} public rallydevice(int sno, time currenttime, double dist,double avgspeed,double requiredtime,time idealtime) { this._sno = sno; this._currenttime = currenttime; this._dist = dist; this._avgspeed = avgspeed; this._requiredtime = requiredtime; this._idealtime = idealtime; } public rallydevice( time currenttime, double dist,double avgspeed,double requiredtime,time idealtime) { this._currenttime = currenttime; this._dist = dist; this._avgspeed = avgspeed; this._requiredtime = requiredtime; this._idealtime = idealtime; }
you must enclose class inside overloaded constructor , not outside
public class rallydevice { private int _sno; private time _currenttime; private double _dist; private double _avgspeed; private double _requiredtime; private time _idealtime; public rallydevice() { } public rallydevice(int sno, time currenttime, double dist,double avgspeed,double requiredtime,time idealtime) { this._sno = sno; this._currenttime = currenttime; this._dist = dist; this._avgspeed = avgspeed; this._requiredtime = requiredtime; this._idealtime = idealtime; } public rallydevice( time currenttime, double dist,double avgspeed,double requiredtime,time idealtime) { this._currenttime = currenttime; this._dist = dist; this._avgspeed = avgspeed; this._requiredtime = requiredtime; this._idealtime = idealtime; } }
Comments
Post a Comment