Connecting Tech Pros Worldwide Forums | Help | Site Map

how do you do this method?

CTG
Guest
 
Posts: n/a
#1: Jul 18 '05
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
}
}



perry
Guest
 
Posts: n/a
#2: Jul 18 '05

re: how do you do this method?


syntax aside, can you better describe your application to me?

- perry


CTG wrote:[color=blue]
> 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
> }
> }[/color]

Mihai
Guest
 
Posts: n/a
#3: Jul 18 '05

re: how do you do this method?


CTG wrote:
[color=blue]
> 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[color=green]
> >this.NofSecSince1900) return false else return true }[/color]
> }[/color]

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



Closed Thread