mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 21:59:32 +02:00

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 -
44 lines
654 B
ObjectPascal
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.
|