By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,034 Members | 822 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,034 IT Pros & Developers. It's quick & easy.

how do you do this method?

P: n/a
CTG
package mydiary_system;

public class Pt_in_Time {
private long NofSecSince1900;

public Pt_in_Time( final long paramNofSecSince1900 )
{
/*can i do this ? */
NofSecSince1900 = ParamNofSecSince1900
}

public boolean isItEarlier( final Pt_in_Time anotherPt_in_Time )
{
// can you do this in java ? //????????????????? if not then how does this method shoudl look like?
if (anotherPt_in_Time >this.NofSecSince1900) return false else return true
}
}
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
syntax aside, can you better describe your application to me?

- perry
CTG wrote:
package mydiary_system;

public class Pt_in_Time {
private long NofSecSince1900;

public Pt_in_Time( final long paramNofSecSince1900 )
{
/*can <file://can> i do this ? */
NofSecSince1900 = ParamNofSecSince1900
}

public boolean isItEarlier( final Pt_in_Time anotherPt_in_Time )
{
// c <file:// can>an <file:// can> you do this in java ?
//????????????????? if not then how does this method shoudl look like?
if (anotherPt_in_Time >this.NofSecSince1900) return false else return true
}
}


Jul 17 '05 #2

P: n/a
CTG wrote:
package mydiary_system;

public class Pt_in_Time {
private long NofSecSince1900;

public Pt_in_Time( final long paramNofSecSince1900 )
{
/*can i do this ? */
NofSecSince1900 = ParamNofSecSince1900
}

public boolean isItEarlier( final Pt_in_Time anotherPt_in_Time )
{
// can you do this in java ? //????????????????? if not then how does
this method shoudl look like? if (anotherPt_in_Time
>this.NofSecSince1900) return false else return true }

}


You need to create a member function to access the private variabile
"NofSecSince1900":

public long GetTime()
{
return NofSecSince1900;
}

then in the function isItEarlier() call it:

if (anotherPt_in_Time.GetTime() > this.NofSecSince1900) return false
else return true

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.