home > 比較編 > C, C++, Objective-C, Java, C# > objects >

ForNext

Only Do What Only You Can Do

123. define method

VBScript

JScript

Perl

PHP

Python

Ruby

PowerShell

Scala

F#

C

C++

int Rational::height() {
  return (abs(num) > abs(denom)) ? abs(num) : abs(denom);
}



C++Builder

VC++

C#

public int Height() {
  return (System.Math.Abs(this.num) > this.denom) ? System.Math.Abs(this.num) : this.denom;
}



Java

public int height() {
  return (Math.abs(this.num) > this.denom) ? Math.abs(this.num) : this.denom;
}



Objective-C

-(int) height {
  if ( abs(self.num) > abs(self.denom) ) {
    return abs(self.num);
  }
  return abs(self.denom);
}

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system