fpc/tests/test/jvm/tprop.pp
Jonas Maebe 71068ae7eb * made the tests Android-compatible (use the androidr14 unit instead
of the jdk15 unit in that case)
  * adjusted testall.sh script so it can also be used to test class
    files compiled for Android (still with the JVM though)

git-svn-id: branches/jvmbackend@19835 -
2011-12-12 20:34:02 +00:00

44 lines
654 B
ObjectPascal

program tprop;
{$mode delphi}
uses
{$ifdef java}jdk15{$else}androidr14{$endif};
type
tc = class
strict private
fvalue: longint;
function getit: longint;
procedure setit(l: longint);
public
property value: longint read getit write setit;
constructor create(l: longint);
end;
constructor tc.create(l: longint);
begin
fvalue:=l;
end;
function tc.getit: longint;
begin
result:=fvalue;
end;
procedure tc.setit(l: longint);
begin
fvalue:=l;
end;
var
c: tc;
begin
c:=tc.create(5);
jlsystem.fout.println(c.value);
c.value:=6;
jlsystem.fout.println(c.value);
end.