Difference between revisions of "Pascal for Java users/de"
From Free Pascal wiki
Jump to navigationJump to searchm |
|||
Line 74: | Line 74: | ||
| ++ | | ++ | ||
| Inc | | Inc | ||
− | | inkrementieren ( | + | | inkrementieren (Hochzählen) |
|- | |- | ||
| -- | | -- | ||
Line 173: | Line 173: | ||
|- | |- | ||
| for ++ | | for ++ | ||
− | | For To Do | + | | For ... To ... Do |
− | | | + | | Kopfgesteuerte Schleife, die Hochgezählt wird |
|- | |- | ||
| for -- | | for -- | ||
− | | For Downto Do | + | | For ... Downto ... Do |
− | | | + | | Kopfgesteuerte Schleife, die Heruntergezählt wird |
|- | |- | ||
| for each | | for each | ||
− | | For in | + | | For ... in |
− | | | + | | Kopfgesteuerte Schleife, für das Durchsuchen von Mengen |
|- | |- | ||
| if() | | if() | ||
| If Then | | If Then | ||
− | | | + | | If-Bedingung |
|- | |- | ||
| if() else | | if() else | ||
− | | If Then Else | + | | If ... Then ... Else |
− | | | + | | If-Bedingung mit Sonstzweig |
|- | |- | ||
| implements | | implements | ||
Line 196: | Line 196: | ||
| | | | ||
|- | |- | ||
− | | import | + | | import ...; |
− | | Uses | + | | Uses ...; |
− | | | + | | Bindet Bibliotheken und Klassen ein |
|- | |- | ||
| instanceof | | instanceof | ||
Line 224: | Line 224: | ||
| | | | ||
|- | |- | ||
− | | package | + | | package ...; |
− | | Unit | + | | Unit ...; |
− | | | + | | Einbinden der Pascal Unit bzw. des Java Packages |
|- | |- | ||
| private | | private | ||
Line 246: | Line 246: | ||
| return | | return | ||
| Result := | | Result := | ||
− | | | + | | Einer Funktion Ihren Rückgabewert zuweisen |
|- | |- | ||
| static | | static | ||
Line 265: | Line 265: | ||
|- | |- | ||
| switch case break | | switch case break | ||
− | | Case Of End | + | | Case ... Of ... End |
− | | | + | | Case-Bedingung |
|- | |- | ||
| switch case break default | | switch case break default | ||
− | | Case Of Else End | + | | Case ... Of ... Else ... End |
− | | | + | | Case-Bedingung mit Sonst-Zweig |
|- | |- | ||
| synchronized | | synchronized | ||
Line 282: | Line 282: | ||
| throw | | throw | ||
| Raise | | Raise | ||
− | | | + | | Wirft eine Exception |
|- | |- | ||
| throws | | throws |
Revision as of 06:47, 10 May 2013
│
Deutsch (de) │
English (en) │
Übersetzen von gemeinsamen Programm-Teilen
Die folgende englisch sprachige Seite zeigt, wie gemeinsame Probleme in verschiedenen Programmiersprachen, einschließlich Java und FreePascal / Object Pascal gelöst werden können.
Rosetta Code
Übersetzen von Java Stichwörtern / Konzepten
Java | Pascal | Kommentare |
---|---|---|
{ | Begin | Anfang eines Anweisungsblocks |
} | End | Ende / Abschluss eines Anweisungsblocks |
= | := | Zuweisung |
+ | + | Addition |
- | - | Subtraktion |
* | * | Multiplikation |
/ | / | Division |
% | Mod | Modulo (Division ohne Rest) |
! | Not | Nichten (Den Wahrheitswert in sein Gegenteil ändern) |
== | = | Gleich / Vergleich |
!= | <> | ungleich |
&& | And | logisches UND |
|| | Or | logisches ODER |
^ | Xor | exclusives ODER |
>> | Shr | bitweises shift right |
<< | Shl | bitweises shift left |
++ | Inc | inkrementieren (Hochzählen) |
-- | Dec | dekrementieren (Herunterzählen) |
/* | { | Anfang eines Kommentars |
/* | (* | Anfang eines Kommentars |
*/ | } | Ende eines Kommentars |
*/ | *) | Ende eines Kommentars |
// | // | Kommentarzeile |
public static void main(String[] args) { } | Program ProgramName; Begin End. | Unterprogramm |
someType arrayVar[] | arrayVar: Array Of someType | |
someType arrayVar[#] | arrayVar: Array[MINRANGE..MAXRANGE] Of someType | |
null | Nil | |
abstract | Abstract | |
break | Break | |
class TheClass { } | TheClass = Class End | FPC / Delphi |
class TheClass { } | TheClass = Object End | FPC / Turbo Pascal |
class TheClass<T> { } | Generic TheClass = Class<T> End | Generische Klassen werden erst ab FPC 2.2.2 unterstützt |
TheClass() | Constructor CtorName | Der Name des Konstructors ist entweder Init oder Create |
continue | Continue | |
do while ! | Repeat Until Not | |
do while | Repeat Until | |
enum TheEnum | TheEnum = ( MINVALUE .. MAXVALUE ) | |
enum TheEnum = {MINVALUE, MAXVALUE} | TheEnum = ( MINVALUE, MAXVALUE ) | |
TheEnum enumVar | enumVar := Set Of TheEnum | |
extends | SubClass = Class(BaseClass) | |
final | Const | |
for ++ | For ... To ... Do | Kopfgesteuerte Schleife, die Hochgezählt wird |
for -- | For ... Downto ... Do | Kopfgesteuerte Schleife, die Heruntergezählt wird |
for each | For ... in | Kopfgesteuerte Schleife, für das Durchsuchen von Mengen |
if() | If Then | If-Bedingung |
if() else | If ... Then ... Else | If-Bedingung mit Sonstzweig |
implements | SomeClass = Class(SomeInterface) | |
import ...; | Uses ...; | Bindet Bibliotheken und Klassen ein |
instanceof | Is | |
interface | TheInterface = Interface | |
native | StdCall | Pascal / FPC Standardaufrufkonvention |
native | CDecl | C Standardaufrufkonvention |
new primitive_type[#] | SetLength(ArrayVar, #) | |
new Class() | InstanceVar := TheClass.Create | |
package ...; | Unit ...; | Einbinden der Pascal Unit bzw. des Java Packages |
private | Private | |
protected | Protected | |
public | Public | |
return | FunctionName := | Diese Pascal Schreibwese ist übeholt(deprecated) |
return | Result := | Einer Funktion Ihren Rückgabewert zuweisen |
static | Static | |
static | Class Function | |
static | Class Procedure | |
super | Inherited | Ruft den Elternkonstruktor auf |
switch case break | Case ... Of ... End | Case-Bedingung |
switch case break default | Case ... Of ... Else ... End | Case-Bedingung mit Sonst-Zweig |
synchronized | ||
this | Self | |
throw | Raise | Wirft eine Exception |
throws | ||
transient | Das Feld soll nicht serialisiert werden | |
try { ... } catch { ... } | Try Begin ... End Except Begin ... End | Fehlerbehandlung mit einem Try-Block |
try { ... } catch { ... } finally { ... } | begin ... try try ... except ... end; finally ... end; ... end; | Fehlerbehandlung mit einem Block für Abschlussarbeiten |
void | Procedure | Unterprogramm ohne Rückgabewert |
volatile | Speichert den Wert nicht in Registern | |
while | While Do |
Translating Java data types
Java type | Pascal type | Size (bits) | Range |
---|---|---|---|
byte | Shortint | 8-bit | -128 .. 127 |
short | SmallInt | 16-bit | -32768 .. 32767 |
int | LongInt | 32-bit | -2147483648..2147483647 |
long | Int64 | 64-bit | -9 223 372 036 854 775 808 .. 9 223 372 036 854 775 807 |
float | Single | 32-bit | 1.5E-45 .. 3.4E+38 |
double | Double | 64-bit | 5.0E-324 .. 1.7E+308 |
boolean | Boolean | 8-bit | False True |
char | WideChar | 16-bit | 2 Zeichen codieren ein sichtbares Zeichen |
String | String |
--Olaf 14:28, 24 March 2013 (UTC)