Erwin Merker Roman Merker
Programmieren lernen mit JAVA
Aus dem Bereich IT erfolgreich lernen
Lexikon für IT-Berufe...
128 downloads
1778 Views
4MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Erwin Merker Roman Merker
Programmieren lernen mit JAVA
Aus dem Bereich IT erfolgreich lernen
Lexikon für IT-Berufe von Peter Fetzer und Bettina Schneider Grundkurs IT-Berufe von Andreas M. Böhm und Bettina Jungkunz Java für IT-Berufe von Wolf-Gert Matthäus Prüfungsvorbereitung für IT-Berufe von Manfred Wünsche Grundlegende Algorithmen von Volker Heun Algorithmen für Ingenieure – realisiert mit Visual Basic von Harald Nahrstedt Grundkurs Programmieren mit Delphi von Wolf-Gert Matthäus Grundkurs Visual Basic von Sabine Kämper Visual Basic für technische Anwendungen von Jürgen Radel Grundkurs Smalltalk – Objektorientierung von Anfang an von Johannes Brauer Grundkurs Software-Entwicklung mit C++ von Dietrich May Grundkurs JAVA von Dietmar Abts Aufbaukurs JAVA von Dietmar Abts Grundkurs Java-Technologien von Erwin Merker Java ist eine Sprache von Ulrich Grude Middleware in Java von Steffen Heinzl und Markus Mathes Das Linux-Tutorial – Ihr Weg zum LPI-Zertifikat von Helmut Pils Rechnerarchitektur von Paul Herrmann Grundkurs Relationale Datenbanken von René Steiner Grundkurs Datenbankentwurf von Helmut Jarosch Datenbank-Engineering von Alfred Moos Grundlagen der Rechnerkommunikation von Bernd Schürmann Netze – Protokolle – Spezifikationen von Alfred Olbrich Grundkurs Verteilte Systeme von Günther Bengel Grundkurs Mobile Kommunikationssysteme von Martin Sauter
www.vieweg.de
Grundkurs Wirtschaftsinformatik von Dietmar Abts und Wilhelm Mülder Grundkurs Theoretische Informatik von Gottfried Vossen und Kurt-Ulrich Witt Anwendungsorientierte Wirtschaftsinformatik von Paul Alpar, Heinz Lothar Grob, Peter Weimann und Robert Winter Business Intelligence – Grundlagen und praktische Anwendungen von Hans-Georg Kemper, Walid Mehanna und Carsten Unger Grundkurs Geschäftsprozess-Management von Andreas Gadatsch Prozessmodellierung mit ARIS ® von Heinrich Seidlmeier ITIL kompakt und verständlich von Alfred Olbrich BWL kompakt und verständlich von Notger Carl, Rudolf Fiedler, William Jórasz und Manfred Kiesel Masterkurs IT-Controlling von Andreas Gadatsch und Elmar Mayer Masterkurs Computergrafik und Bildverarbeitung von Alfred Nischwitz und Peter Haberäcker Grundkurs Mediengestaltung von David Starmann Grundkurs Web-Programmierung von Günter Pomaska Web-Programmierung von Oral Avcı, Ralph Trittmann und Werner Mellis Grundkurs MySQL und PHP von Martin Pollakowski Grundkurs SAP R/3® von André Maassen und Markus Schoenen SAP ®-gestütztes Rechnungswesen von Andreas Gadatsch und Detlev Frick Kostenträgerrechnung mit SAP R/3® von Franz Klenger und Ellen Falk-Kalms Masterkurs Kostenstellenrechnung mit SAP® von Franz Klenger und Ellen Falk-Kalms Controlling mit SAP ® von Gunther Friedl, Christian Hilz und Burkhard Pedell Logistikprozesse mit SAP R/3® von Jochen Benz und Markus Höflinger IT-Projekte strukturiert realisieren von Ralph Brugger Programmieren lernen mit Java von Erwin Merker und Roman Merker
Erwin Merker Roman Merker
Programmieren lernen mit Java Leicht verständlich – Griffige Beispiele – Ausführbare Programme Mit 52 Abbildungen
Bibliografische Information Der Deutschen Bibliothek Die Deutsche Bibliothek verzeichnet diese Publikation in der Deutschen Nationalbibliografie; detaillierte bibliografische Daten sind im Internet über abrufbar.
Prof. Dr.-Ing. habil. Reiner R. Dumke lehrt Software-Technik an der Universität Magdeburg. Er ist Leiter des dortigen Software-Messlabors sowie Leiter bzw. Mitglied in maßgeblichen Gremien auf dem Gebiet der Softwaremetrie (GI-Fachgruppe für Software-Messung und -Bewertung; DASMA; COSMIC).
Die Wiedergabe von Gebrauchsnamen, Handelsnamen, Warenbezeichnungen usw. in diesem Werk berechtigt auch ohne besondere Kennzeichnung nicht zu der Annahme, dass solche Namen im Sinne von Warenzeichen- und Markenschutz-Gesetzgebung als frei zu betrachten wären und daher von jedermann benutzt werden dürfen. Höchste inhaltliche und technische Qualität unserer Produkte ist unser Ziel. Bei der Produktion und Auslieferung unserer Bücher wollen wir die Umwelt schonen: Dieses Buch ist auf säurefreiem und chlorfrei gebleichtem Papier gedruckt. Die Einschweißfolie besteht aus Polyäthylen und damit aus organischen Grundstoffen, die weder bei der Herstellung noch bei der Verbrennung Schadstoffe freisetzen.
1. Auflage Februar 2006 Alle Rechte vorbehalten © Friedr. Vieweg & Sohn Verlag | GWV Fachverlage GmbH, Wiesbaden 2006 Lektorat: Dr. Reinald Klockenbusch / Andrea Broßler Der Vieweg Verlag ist ein Unternehmen von Springer Science+Business Media. www.vieweg.de
Das Werk einschließlich aller seiner Teile ist urheberrechtlich geschützt. Jede Verwertung außerhalb der engen Grenzen des Urheberrechtsgesetzes ist ohne Zustimmung des Verlags unzulässig und strafbar. Das gilt insbesondere für Vervielfältigungen, Übersetzungen, Mikroverfilmungen und die Einspeicherung und Verarbeitung in elektronischen Systemen.
Konzeption und Layout des Umschlags: Ulrike Weigel, www.CorporateDesignGroup.de Umschlagbild: Nina Faber de.sign, Wiesbaden Druck und buchbinderische Verarbeitung: Tˇeˇsínská tiskárna, a.s.; Tschechische Republik Gedruckt auf säurefreiem und chlorfrei gebleichtem Papier. Printed in the Czech Republic ISBN 3-8348-0068-6
`]U`O[[WS`a^`OQVS VOPS\ eW` 8OdO USeÉVZb eSWZ 8OdO SW\S []RS`\S SZSUO\bS c\R ZSWQVb hc ZS`\S\RS A^`OQVS Wab 3a eS`RS\ YSW\S >`]U`O[ [WS`YS\\b\WaaS d]`OcaUSaSbhb OcQV \WQVb W\ SW\S` O\RS`S\ A^`OQVS 2S` :SaS` PS\rbWUb RWS Y]abS\Z]aS 3\beWQYZc\Uac[USPc\U RS` 4W`[O Ac\ c\R SW\S\ PSZWSPWUS\ BSfbSRWb]` c[ OZZS 0SWa^WSZS W\ RWSaS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QV`SWPc\U OZZS` AbO\RO`R 9ZOaaS\ RWS SW\USPOcb aW\R c\R hc[ :WSTS`c[TO\U RS` AbO\RO`R3RWbW]\ USVr`S\ />7 Wab RWS /PYº`hc\U Tº` /^^ZWQObW]\ >`]U`O[[S` 7\bS`TOQS RO[Wb PShSWQV\Sb [O\ RWS AQV\WbbabSZZS\ RWS RS[ 8OdO^`]U`O[[WS`S` Tº` ROa AQV`SWPS\ aSW\S` /\eS\Rc\U hc` DS`TºUc\U abSVS\ c\R ROa aW\R OZZS 9ZOaaS\ c\R 7\bS`TOQSa RSa 8OdO >ZObT]`[ >OQYOUSa 3W\S 4ºZZS d]\ 7\T]`[ObW]\S\ aW\R W\ RWSaS` 2]Yc[S\bObW]\ S\bVOZbS\( Bcb]`WOZa 2S[]a c\R 0SWa^WSZ^`]U`O[[S 5Z]aaO`g cae /ZZS 7\T]`[ObW]\S\ aW\R OcQV ]\ZW\S dS`TºUPO` c\bS`( http://java.sun.com/reference/ 1TidV d]S 8]bcP[[PcX^] STa 0?83^Zd\T]cPcX^] U¶a [^ZP[T =dcid]V •
7[ 0`]eaS` RWS 8OdOC@: RS` 4W`[O AC< SW\USPS\( Wcc_)YPePbd]R^\
•
7[ AbO`bPWZR RW`SYb RWS AQVOZbTZÉQVS 8 A3 # c\bS` RS` ÍPS`aQV`WTb >]^cZO` 2]e\Z]ORa O\YZWQYS\
•
2O\OQV RWS AQVOZbTZÉQVS 2]e\Z]OR Tº` RWS 8 A3 # 2]Qc[S\bObW]\ O\YZWQYS\ RWS :WhS\hdS`SW\PO`c\US\ OYhS^bWS`S\ c\R [Wb Q]\bW\cS RS\ 2]e\Z]OR D]`UO\U abO`bS\ d]`VS` \]QV RWS S\UZWaQVS DS`aW]\ OcaeÉVZS\
•
3a eW`R RWS 2ObSW YSZ N$S^RiX_ ºPS`b`OUS\ 5`rzS QO "" ;0
•
2WS 7\abOZZObW]\ eW`R USabO`bSb Rc`QV ROa 3\bhW^^S\ RWSaS` 2ObSW
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dS`heSWUb eS`RS\ YO\\ 5SabO`bSb eW`R RWS 3\beWQYZc\Uac[USPc\U [Wb(
START|PROGRAMME|Fantastic-Bits|JOE|JOE
3[^TSVZc\U( :SUS\ AWS SW\S DS`Y\º^Tc\U OcT RS[ 2SaYb]^ O\ ?a¶UT] ^Q 9>4 Z^aaTZc X]bcP[[XTac Xbc ÍPS` RS\ ;S\c^c\Yb Optionen|Einstellungen a]ZZbS ºPS`^`ºTb eS`RS\ ]P RWS >TORS hc[ 1][^WZS` c\R hc[ 7\bS`^`SbS` Y]``SYb SW\USb`OUS\ aW\R 3dS\bcSZZ [caa RWSa [O\cSZZ \OQVUSV]Zb eS`RS\ EOVZeSWaS YO\\ VWS` OcQV RS` HWSZ^TOR Tº` RWS /caUOPS RSa 1][^WZS`a SW\USb`OUS\ eS`RS\ 0][TVT] TX]Tb ]TdT] >aS]Tab U¶a SXT ÎQd]VbSPcTXT] 4º` ROa /`PSWbS\ [Wb RS\ 0SWa^WSZS\ W\ RWSaS[ 0cQV Wab Sa VWZT`SWQV eS\\ SW\ aS^O `ObSa DS`hSWQV\Wa O\USZSUb eW`R 2S` `]U`O[[ VOb \c` eS\WUS HSWZS\ 3a USVb OPS` \WQVb RO`c[ SW\ DS` abÉ\R\Wa Tº` RWSaSa >`]U`O[[ hc PSY][[S\ a]\RS`\ Sa VO\RSZb aWQV ZSRWUZWQV c[ SW\S\ bSQV\WaQVS\ BSab ?a^VaP\\ CTbc ) 3Pb TabcT 9PeP?a^VaP\\ public class Test01 { public static void main(String[] args) { System.out.println("Erstes Programm"); } } AW\R RWS D]`OcaaSbhc\US\ RWS OcT RS\ d]`VS`WUS\ ASWbS\ PSaQV`WSPS\ e]`RS\ aW\R S`TºZZb UWPb Sa heSW ;rUZWQVYSWbS\ eWS AWS O`PSWbS\ Yr\\S\( •
3\beSRS` dS`hWQVbS\ AWS UO\h OcT SW\S 723 OZa] OcQV h0 OcT 8=3 c\R abO`bS\ RWS >`]U`O[[S 3RWb]` 1][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]V\S Ag\bOfTSVZS` Wab S`hScUb RS` 1][^WZS` RO`Oca SW\S hcaÉbhZWQVS \ScS 2ObSW 2WSaS VOb RWS 2ObSWS`eSWbS`c\U R[Pbb c\R S\bVÉZb SW\S\ HeWaQVS\Q]RS RS\ a] US\O\\bS\ 0gbSQ]RS 3a UWPb >`]U`O[[WS`a^`OQVS\ h0 1 PSW RS\S\ ROa A]c`QS>`]U`O[[ W\ SW\ ;O aQVW\S\^`]U`O[[ c[USeO\RSZb eW`R 0SW RWSaS` C[eO\RZc\U eW`R SW\ OcaTºV`PO`Sa >`]U`O[[ Tº` SW\S US\Oc RSTW\WS`bS >ZObbT]`[ eSZQVS` >`]hSaa]` eSZQVSa 0Sb`WSPa agabS[ S`hScUb PSW SW\S[ ESQVaSZ RS` >ZObbT]`[ [caa \Sc Q][^WZWS`b eS`RS\ $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# 3Pb TabcT 9PeP?a^VaP\\ TabcT[[T] d\fP]ST[] d]S PdbU¶WaT]
`]U`O[[a YO\\ SPS\TOZZa [S\ºUSabScS`b S`T]ZUS\ •
C[eO\RSZ\ Rc`QV( JAVA|COMPILIEREN
•
/caTºV`S\ Rc`QV(
JAVA|STARTEN
/ZbS`\ObWd Yr\\S\ AWS OcQV ºPS` RS\ ;S\º3W\b`OU •
8/D/j;A2=A 3W\UOPSOcTT]`RS`c\U
W\ SW\S 1][[O\RP]f dS`heSWUS\ c\R d]\ R]`b Oca RS\ 1][^WZS` c\R RS\ 7\bS`^`S bS` ^S` 1][[O\R OcT`cTS\
.OT]KOYKG[LSMROINK6XUHRKSKHKOS)USVOROKXKT[TJ'[YLNXKT •
5`]z c\R 9ZSW\aQV`SWPc\U Wab eWQVbWU 0SW[ 3RWbWS`S\ RSa ?cSZZbSfbSa c\R PSW[ /cT`cTS\ RS` >`]U`O[[\O[S\ Tº` RWS C[eO\RZc\U c\R /caTºV`c\U Wab RO`OcT hc OQVbS\ ROaa 8OdO aSV` e]VZ c\bS`aQVSWRSb heWaQVS\ 9ZSW\ c\R 5`]zPcQVabO PS\
•
/QVbS\ AWS PSa]\RS`a OcT RWS 9ZO[[S`\PWZRc\U( rTT\S\RS c\R aQVZWSzS\RS 9ZO[[S`\ W[[S` ^OO`eSWaS h0 i k ]RS`
•
ES\\ RS` 1][^WZS` ]RS` RS` 7\bS`^`SbS` \WQVb USTc\RS\ eS`RS\ Wab RWS >/B6 3\dW`]\[S\bDO`WOPZS hc ºPS`^`ºTS\ 7\ RWSaS` AcQV^TORZWabS [ºaaS\ RWS 6W\ eSWaS OcT RWS QX]2ObSWS\ RSa 7\abOZZObW]\a]`R\S`a abSVS\ h0 Path=D:\WINNT\....E:\Programme\Java\jdk1.5.0_01\bin 6W\eSWaS eWS RWSaS` 4SVZS` Y]``WUWS`b eW`R TW\RS\ AWS W[ /\VO\U /
•
ES\\ RWS ?cSZZbSfbRObSW \WQVb USTc\RS\ eW`R ºPS`^`ºTS\ AWS PWbbS ]P RS` 1][ ^WZS`OcT`cT Oca RS[ `WQVbWUS\ =`R\S` VS`Oca S`T]ZUb Wab \É[ZWQV Oca RS[ /` PSWba]`R\S` W\ RS[ aWQV ROa ?cSZZS\^`]U`O[[ PSTW\RSb
•
;O\QVS 3RWb]`S\ S`UÉ\hS\ RS\ 2ObSW\O[S\ [Wb RS[ ?cSZZbSfb VO`b\ÉQYWU c[ RWS 2ObSWS\Rc\U cgc 2O\\ [caa h0 [Wb 6WZTS RSa EW\R]ea3f^Z]`S`a ]RS` [Wb RS[ 2=A1][[O\R aT]P\T RS` USeº\aQVbS 2ObSW\O[S VS`USabSZZb eS`RS\
•
ES\\ PSW RS` /caTºV`c\U RWS 1ZOaa2ObSW \WQVb USabO`bSb eS`RS\ YO\\ ºPS`^`º TS\ AWS ]P \OQV RS[ /cT`cT RSa 7\bS`^`SbS`a Rc`QV YPeP RS` Y]``SYbS 2ObSW\O [S Tº` ROa OcaTºV`PO`S 8OdO^`]U`O[[ O\USUSPS\ Wab \É[ZWQV [Wb RS[ `WQVbWUS\ 2ObSW\O[S\ OZZS`RW\Ua ]V\S RWS 3\Rc\U R[Pbb c\R ]P RWSaS` 2ObSW\O[S Sf OYb ºPS`SW\abW[[b [Wb RS[ `]U`O[[É\RS`c\U Rc`QVUSTºV`b e]`RS\ Wab [caa c\PSRW\Ub \Sc c[USeO\RSZb eS`RS\ /\RS`\TOZZa eW`R RWS Ò\RS`c\U \WQVb eW`YaO[ '
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
4X][TXcd]V) 3XT 0aQTXc e^aQTaTXcT]
ÎQd]V id\ ?a^VaP\\ CTbc YPeP 3W\ 8OdO>`]U`O[[ YO\\ 9][[S\bO`hSWZS\ S\bVOZbS\ 3\beSRS` PSUW\\b RS` 9][ [S\bO` [Wb heSW AQV`ÉUab`WQVS\ RO\\ UWZb RWSa \c` Tº` RS\ @Sab SW\S` HSWZS ]RS` S` PSUW\\b [Wb RO\\ YO\\ aWQV RS` 9][[S\bO` OcQV ºPS` [SV`S`S HSWZS\ S`ab`S QYS\ c\R eW`R [Wb OPUSaQVZ]aaS\ 3`UÉ\hS\ AWS ROa >`]U`O[[ c[ RWS T]ZUS\RS 9][[S\bO`hSWZS( "Dies ist das erste Testprogramm" eO\RSZ\ AWS ROa >`]U`O[[ \Sc c[ c\R bSabS\ AWS Sa S`\Scb DS`acQVS\ AWS RWS heSW ;rUZWQVYSWbS\ eWS SW\ 9][[S\bO` SW\USTºUb eS`RS\ YO\\ ÍPS`^`ºTS\ AWS RWS 5`r zS RS` S`hScUbS\ 1ZOaa2ObSW c[ hc YZÉ`S\ ]P RS` 9][[S\bO` 0SabO\RbSWZ RS` 0gbS 2ObSW Wab 2ORc`QV PSY][[S\ AWS RWS /\be]`b OcT RWS 4`OUS( DS`É\RS`b aWQV RWS 5`rzS RS` OcaTºV`PO`S\ 2ObSW eS\\ [O\ aSV` dWSZ 2]Yc[S\bO`bSfb W[ A]c`QS>`]U`O[[ dS` eS\RSb- IdbP\\T]UPbbd]V
2WS D]`OcaaSbhc\US\ Tº` SW\ S`T]ZU`SWQVSa /`PSWbS\ [Wb 8OdO VOPS\ AWS USaQVOTTb AWS VOPS\ OcQV PS`SWba RWS R`SW eWQVbWUabS\ AQV`WbbS hc` >`]U`O[[S`abSZZc\U OcaUSTºV`b( 4SXcXTaT](
3W\UOPS RSa ?cSZZbSfba [Wb 6WZTS SW\Sa 3RWb]`a
2^\_X[XTaT](
3`hScUS\ RSa 0gbSQ]RSa [Wb 6WZTS SW\Sa 1][^WZS`>`]U`O[[a Rc`QV( javac dateiname.java
8]cTa_aTcXTaT])
BSabS\ RSa >`]U`O[[a Rc`QV /caTºV`c\U W\ SW\S` 8D; Rc`QV( java dateiname
4º` RWSaS /`PSWbS\ Wab RWS 7\abOZZObW]\ SW\S` 8OdO3\beWQYZc\Uac[USPc\U h0 829 d]\ Ac\ S`T]`RS`ZWQV C\R Tº` ROa C[eO\RSZ\ c\R /caTºV`S\ Wab Sa \]beS\RWU ROaa RWS S\ba^`SQVS\RS\ AgabS[^`]U`O[[S ROa C[eO\RZc\Ua^`]U`O[[ YPePR c\R ROa 7\bS`^`SbS`^`] U`O[[ YPeP W[ AcQV^TOR RSa 0Sb`WSPaagabS[a USTc\RS\ eS`RS\ 2Ohc ec`RS RWS _PcW3\dW`]\[S\bDO`WOPZS O\US^Oaab c\R c[ ROa QX]DS`hSWQV\Wa RS` 829 S`UÉ\hb 4º` ROa 3RWbWS`S\ RS` ?cSZZbSfbS SW\Sa 8OdO>`]U`O[[a Wab SW\ a^ShWSZZS` 8OdO BSfbSRWb]` eWS h0 8=3 VWZT`SWQV 2O\\ Yr\\S\ SW\WUS /`PSWbS\ Ocb][ObWaWS`b c\R [S\ºUSabScS`b OcaUSTºV`b eS`RS\ c\R RWS /\hSWUS RSa ?cSZZbSfba eW`R ºPS`aWQVbZWQV USabOZbSb h0 Rc`QV dS`aQVWSRS\TO`PWUS BSfbPOcabSW\S c[ AQVZºaaSZer`bS` DO`WOPZS c\R 0STSVZS ]^bWaQV YS\\bZWQV hc [OQVS\
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
0G\GOSkHKXHROIQ +XYZK9INXOZZKSGINKT
7\ RWSaS[ 9O^WbSZ S`VOZbS\ AWS /\be]`bS\ OcT T]ZUS\RS 4`OUS\( •
EWS Wab SW\ SW\TOQVSa 8OdO^`]U`O[[ OcTUSPOcb-
•
EOa dS`abSVb [O\ c\bS` Ag\bOf c\R AS[O\bWY SW\S` >`]U`O[[WS`a^`OQVS-
•
EOa aW\R RWS eWQVbWUabS\ 0SabO\RbSWZS SW\Sa OcaTºV`PO`S\ 8OdO^`]U`O[[a SW\S` /^^ZWQObW]\-
•
ESZQVS PSa]\RS`S 0SRScbc\U VOb RWS \PX];SbV]RS-
•
EOa aW\R RWS C\bS`aQVWSRS heWaQVS\ AQVZºaaSZer`bS`\ c\R >`]U`O[[WS`S`er` bS`\-
•
ESZQVS 3[^TSVZc\US\ UWPb Sa Tº` RWS `]U`O[[WS`a^`OQVS UWPb Sa OcQV Tº` 8OdO ZSfW YOZWaQVS c\R ag\bOYbWaQVS @SUSZ\ RWS d][ >`]U`O[[WS`S` SW\USVOZbS\ c\R d][ 1][^WZS` ºPS`^`ºTb eS`RS\ [ºaaS\ 2S` 1][^WZS` S`abSZZb \c` RO\\ SW\ OcaTºV`PO`Sa >`]U`O[[ OZa] RS\ 0gbSQ]RS eS\\ RS` ?cSZZbSfb YSW\S T]`[OZS\ 4SVZS` S\bVÉZb 8SRS` DS`ab]z USUS\ RWS Ag\bOf `SUSZ\ RS` 8OdOA^`OQVS eW`R d][ 1][^WZS` OZa 4SVZS`[SZRc\U R]Yc[S\bWS`b c\R Sa USVr`b SW\WUS ÍPc\U c\R 3`TOV`c\U ROhc RWSaS 4SVZS`[SZRc\U hc W\bS`^`SbWS`S\ c\R RWS 9]``SYbc` Rc`QVhcTºV`S\ EW` S[^TSVZS\ \]QV SW\[OZ R`W\US\R OZZS 0SWa^WSZS W\ RWSaS[ 0cQ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aS\ drZZWU Ocb]\][ c\R Yr\\S\ ^S` 0Sb`WSPaagabS[PSTSVZ YPeP _a^V]P\T USabO`bSb eS`RS\ 8OdO >`]U`O[[S PS\rbWUS\ Tº` RWS /caTºV`c\U SW\S a^ShWSZZS :OcThSWbc[USPc\U RWS dW` bcSZZS ;OaQVW\S 8D; 2WSaS eW`R Rc`QV /cT`cT d]\ YPeP USabO`bSb c\R aWS a]`Ub RO\\ ROTº` ROaa RWS 2ObSW [Wb RS[ 0gbSQ]RS W\ RS\ /`PSWbaa^SWQVS` USZORS\ eW`R 2WS >`]U`O[[OcaTºV`c\U PSUW\\b [Wb RS[ S`abS\ 0STSVZ W\ RS` \PX];SbV]RS /ca 0Sb`WSPaagabS[aWQVb eW`R Rc`QV YPeP SW\ \ScS` ?a^iTbb USabO`bSb c\R heO` hc\ÉQVab RWS 8D; RWS RO\\ RWS 9ZOaaS abO`bSb 3a UWPb O\RS`S 8OdO>`]U`O[[bg^S\ RWS \WQVb aSZPababÉ\RWU OcaTºV`PO` aW\R 2Ohc USVr`S\ 9ZOaaS\ RWS YSW\S \PX] ;SbV]RS VOPS\ h0 /^^ZSba AS`dZSba 380a c\R ESPaS`dWQSa 2WSaS 9ZOaaS\ PS\rbW US\ a^ShWSZZS AS`dS`^`]U`O[[S W\ RWS aWS SW\USPSbbSb eS`RS\ RO[Wb aWS R]`b OZa BV`SOR c\R \WQVb OZa >`]hSaa OcaUSTºV`b eS`RS\ Yr\\S\ 2WSaS >`]U`O[[bg^S\ aW\R \WQVb 5SUS\abO\R RWSaSa 0cQVSa C\R RO\\ UWPb Sa RWS 9ZOaaS\ RWS OZa AQVOPZ]\S PS\cbhb eS`RS\ RO[Wb O\RS`S 9ZOa aS\ d]\ WV\S\ =PXSYbS S`hScUS\ Yr\\S\ 2Od]\ S\bVÉZb OZZSW\ RWS 9PeP ! BcP]SPaS 4SXcX^] [SV`S`S BOcaS\R =V\S aWS YO\\ SW\ 8OdO>`]U`O[[ \WQVb USaQV`WS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`]U`O[[a S\bVOZbS\ ?a^VaP\\ 4X]UdTWad]V!) 7P[[^ FT[c Z^\_[Tcc ^QYTZc^aXT]cXTac public class Einfuehrung02 { public static void main (String[] private String text; text = new String("Hallo "); text = text.concat("Welt"); System.out.println(text); } }
args) { // Objektreferenz erzeugen // Objekt im Speicher anlegen // Nachricht senden // Nachricht senden
9ZSW\S` B`]ab Tº` RS\ <ScSW\abSWUS`( 2WSaSa >`]U`O[[ Wab Tº` RWS \ÉQVabS\ # ASWbS\ ROa aQVeWS`WUabS 3a S\bVÉZb SW\S DWSZhOVZ d]\ a^ShWSZZS\ 8OdOBSQV\WYS\( HcU`WTTa []RWTWS` /`PSWbS\ [Wb @STS`S\hS\ c\R =PXSYbS\ [Wb /``Oga c\R ;SbV]RS\OcT`cTS >O`O[SbS`ºPS`UOPS c\R @Sbc`\eS`bS Phe e^XS /czS`RS[ eW`R [Wb RS` \WQVb UO\h aSZPabS`YZÉ`S\RS\ BSQV\WY Tº` RWS AbO\RO`R/caUOPSSW\VSWb BhbcT\^dc USO`PSWbSb /Z a]( 2Oa >`]U`O[[ VOb Sa W\ aWQV c\R Sa S\bVÉZb OcQV OZZ ROa eOa c\a W\ RS\ \ÉQVa bS\ 9O^WbSZ\ PSaQVÉTbWUS\ eW`R 7\ RWSaS[ 9O^WbSZ USVb Sa hc\ÉQVab d]` OZZS[ RO`c[ hc dS`abSVS\ eWS SW\ 8OdO^`] U`O[[ OcTUSPOcb Wab c\R eSZQVS T]`[OZS\ D]`aQV`WTbS\ SW\hcVOZbS\ aW\R $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!!
4[T\T]cT TX]Tb 9PeP?a^VaP\\b
'[LHG[KOTKY0G\G6XUMXGSSY 2S` ?cSZZbSfb SW\Sa >`]U`O[[a A]c`QSQ]RS PSabSVb Oca SW\hSZ\S\ Er`bS`\ c\R Ag[P]ZS\ OcQV B]YS\ US\O\\b RWS [SWabS\a Rc`QV :SS`abSZZS\ OPUSb`S\\b aW\R 0SUW\\S\ eW` [Wb SW\S` U`c\RaÉbhZWQVS\ C\bS`aQVSWRc\U RS` SW\hSZ\S\ B]YS\( Sa UWPb AQVZºaaSZer`bS` YSge]`Ra RWS 0SabO\RbSWZ RS` 8OdOa^`OQVS aW\R c\R Sa UWPb T`SW d][ >`]U`O[[WS`S` USeÉVZbS Er`bS` >`]U`O[[WS`S`er`bS` 0ShSWQV\S` FPb bX]S BRW[¶bbT[f»acTa d]S fPb bX]S ?a^VaP\\XTaTaf»acTa.
•
AQVZºaaSZer`bS` aW\R h0 R[Pbb _dQ[XR bcPcXR e^XS 2WS AQV`SWPeSWaS RWSaS` 0S U`WTTS WV`S Bh]cPg Wab SfOYb d]`USUSPS\ c\R OcQV RWS 0SRScbc\U WV`S BT \P]cXZ Wab W\ RS` A^`OQVRSTW\WbW]\ TSabUSZSUb 3a UWPb SbeO # AQVZºaaSZer`bS` W\ 8OdO
•
>`]U`O[[WS`S`er`bS` aW\R `]U`O[[WS `S` T`SW USeÉVZb VOb h0 Tº` 9ZOaaS\ ;SbV]RS\ ]RS` Tº` 2ObS\ 2Oa >`]U`O[[ 4X]UdTWad]V! S\bVÉZb h0 T]ZUS\RS >`]U`O[[WS`S`er`bS`( 4X]UdTWad]V! PaVb c\R cTgc
7X]fTXbT id\ 0aQTXcT] \Xc 9>4
ES\\ AWS [Wb 8=3 ]RS` SW\S[ O\RS`S\ 8OdO3RWb]` O`PSWbS\ S`YS\\S\ AWS ROaa RWSaS C\bS`aQVWSRS OcQV TO`PZWQV RO`USabSZZb eS`RS\ 2Oa >`]U`O[[ 4X]UdTWad]V! PSabSVb Oca \c` SW\S` ;SbV]RS RS` ;SbV]RS \PX] 7\\S`VOZP d]\ ;SbV]RS\ eS`RS\ T]ZUS\RS bg^WaQVS /`PSWbS\ OcaUSTºV`b( •
Sa eS`RS\ 2ObS\ PSaQV`WSPS\ c\R RS[ >`]U`O[[ hc` DS`TºUc\U USabSZZb
•
RO\OQV eS`RS\ RWS 2ObS\ dS`O`PSWbSb [O\W^cZWS`b c\R
•
hc[ AQVZcaa eW`R ROa 3`USP\Wa OcaUSUSPS\
/caUSR`ºQYb [Wb SW\WUS\ 4OQVOcaR`ºQYS\ RS` ]PXSYb]`WS\bWS`bS\ >`]U`O[[WS`c\U YO\\ [O\ RS\ /PZOcT OcQV eWS T]ZUb PSaQV`SWPS\( EW` PS\cbhS\ RWS [WbUSZWSTS`bS 9ZOaaS BcaX]V c[ SW\S\ \ScS\ 2ObS\bg^ W[ /`PSWbaa^SWQVS` hc PSaQV`SWPS\ 2Ohc eW`R hc\ÉQVab SW\S =PXSYb`STS`S\h [O\ aOUb OcQV( SW\S 7\abO\hdO`WOPZS S`abSZZb aWS PSY][[b RS\ 0ShSWQV\S` cTgc 7\ RS` \ÉQVabS\ HSWZS eW`R ROa =PXSYb aSZPab W[ A^SW QVS` S`hScUb c\R Rc`QV ROa AS\RS\ SW\S` `]U`O[[ eO\RSZ\ AWS Sa c[ c\R `cTS\ AWS Sa OcT hc` /caTºV `c\U /QVbS\ AWS OcT 5`]z9ZSW\aQV`SWPc\U c\R USPS\ AWS PSW[ /cT`cT RSa 7\bS` ^`SbS`a \WQVb RWS 2ObSWS`eSWbS`c\U R[Pbb Tº` ROa OcaTºV`PO`S >`]U`O[[ O\ 2Oa 3` USP\Wa RWSaSa >`]U`O[[OcT`cTa Wab RWS /caUOPS RSa BSfbSa 6OZZ] ESZb DO`WWS`S\ AWS RO\OQV ROa >`]U`O[[ USPS\ AWS PSZWSPWUS O\RS`S BSfbS Oca %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! 9PeP X\ ÎQTaQ[XRZ) 4abcT BRWaXccT \PRWT]
'[LX[LJKY6XUMXGSSY 4º` RWS /caTºV`c\U RSa >`]U`O[[a [caa W\ SW\S` 1][[O\RZW\S T]ZUS\RS` 0STSVZ SW\USUSPS\ eS`RS\(
java Einfuehrung02
2ORc`QV eW`R d][ 0Sb`WSPaagabS[ SW\S TgT2ObSW USabO`bS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 Oca SW\hSZ\S\ Er`bS`\ c\R Ag[P]ZS\ b]YS\ RWS Rc`QV TSabUSZSUbS B`S\\hSWQVS\ RSZW[WbS` USb`S\\b eS`RS\
•
0SW RS\ B]YS\ eS`RS\ AQVZºaaSZer`bS` `SaS`dWS`bS Er`bS` c\R >`]U`O[[WS `S`er`bS` T`SW USeÉVZbS ]aWbW]\ SW\S` HWTTS` W\\S`VOZP SW\S` HOVZ dS` É\RS`b aWQV RS` bObaÉQVZWQVS ES`b 1TXb_XT[ ) 7[ 3TiX\P[bhbcT\ [caa RS` <S\\eS`b SW\S` >]aWbW]\ a] ]Tb [Wb [cZbW^ZWhWS`b eS`RS\ eWS Sa RWS >]aWbW]\ S`T]`RS`b PSUW\\S\R `SQVba [Wb ]aWbW]\ a] ]Tb [Wb [cZbW^ZWhWS`b eS`RS\ eWS Sa RWS >]aWbW]\ S`T]`RS`b PSUW\\S\R `SQVba [Wb `]U`O[[ 7[ \ÉQVabS\ 0SWa^WSZ e]ZZS\ eW` SW\S\ 1X]ÊafTac c[eO\RSZ\ W\ SW\ HSWQVS\ ?a^VaP\\ 0bRXX#) 1XcbcaX]V X] ITXRWT] d\fP]ST[] public class Ascii04 { public static void main(String args[]) { String bits = "1000001"; System.out.println((char)Integer.parseInt(bits, 2)); } } 3a Wab OcQV [rUZWQV SW\S\ WTgPSTiX\P[T] ES`b W\ SW\S 2ShW[OZhOVZ c[hceO\RSZ\ 2Oa \ÉQVabS >`]U`O[[ ºPS`\W[[b RWSaS /cTUOPS c\R W\bS`^`SbWS`b hcaÉbhZWQV RWSaS\ 2ShW[OZeS`b OZa >]aWbW]\a\c[[S` W\ RS` 1]RSbOPSZZS ?a^VaP\\ 0bRXX%) 7TgPSTiX\P[T] BcaX]V X] 2WPaPRcTa
d\fP]ST[] public class Ascii06 { public static void main(String args[]) { String bits = "5A"; System.out.println((char)Integer.parseInt(bits, 16)); } }
!!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" 8]U^a\PcX^]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SUb aW\R A] UWPb Sa h0 7A= &' :/B7 # 1]RS^OUS VOb RWSaSa HSWQVS\ RWS >ZObh \c[[S` & ES\\ AWS ROa >`]U`O[[ XSR]QV W\ SW\S[ 2=A4S\abS` bSabS\ eW`R RS` 7\VOZb RWSaSa HSWQVS\a OPS` OZa 1 W\bS`^`SbWS`b c\R OcaUSUSPS\ RS\\ R]`b UWZb RWS 1]RS^OUS ÎQd]V !) ES\\ AWS XSR]QV RWS /caUOPS RSa >`]U`O[[a c[ZSWbS\ Rc`QV T]ZUS\RS\ 0STSVZ W\ RS` 1][[O\RZW\S RS` 2=A0]f( java Ascii07 > datei.txt Yr\ \S\ AWS aWQV O\aQVZWSzS\R RS\ 2ObSWW\VOZb W\ SW\S[ 3RWb]` ]RS` BSfb^`]U`O[[ O\ aQVOcS\ R]`b abSVb ROa €HSWQVS\ EOa Yr\\S\ AWS Oca RWSaS\ ÍPc\US\ ZS`\S\- /cT XSRS\ 4OZZ RWS 3`YS\\b\Wa ROaa \c` RWS S`abS\ & HSWQVS\ RSa /A1771]RSa US\]`[b aW\R /ZZS O\RS`S\ HSWQVS\ W\aPS a]\RS`S OcQV RWS RScbaQVS\ C[ZOcbS Yr\\S\ >`]PZS[S PS`SWbS\ a]POZR AWS RWS >ZObbT]`[ ]RS` OcQV \c` ROa >`]U`O[[ eSQVaSZ\ `OfWa \WQVb OYhS^bOPSZ c\R 8OdO PWSbSb OcQV ROTº` SW\S aSV` Y][T]`bOPZS :rac\U AWS eS`RS\ RWSaS a^ÉbS` YS\\S\ZS`\S\
8KOTHOToXK)UJOKX[TM\UT@GNRKT
7[ /A1771]RS aW\R OcQV RWS 0W\É`dS`aQVZºaaSZc\US\ Tº` RWS HWTTS`\ RSa 2ShW[OZ agabS[a S\bVOZbS\ ÎQd]V
0WbbS YZÉ`S\ AWS O\VO\R RS` BOPSZZS W[ /\VO\U 1 eWS RWS HWTTS` W[ /A1771]RS OZa HSWQVS\ dS`aQVZºaaSZb eW`R VSfORShW[OZ 3W\S HWTTS` RWS OZa HSWQVS\ O\USaSVS\ eW`R eW`R O\RS`Sa Q]RWS`b OZa SW\S HWTTS` RWS SW\S HOVZ Wab 3W\S HOVZ YO\\ Oca [SV`S`S\ HWTTS`\ PSabSVS\ h0 PSabSVb RWS HOVZ % Oca R`SW HWTTS`\ C[ RWSaS HOVZ OZa 5O\hSa hc Q]RWS`S\ PS\rbWUb [O\ YSW\S\ /A1771]RS a]\RS`\ [O\ dS`aQVZºaaSZb RWSaS 2ShW[OZhOVZ OZa `SW\ PW\É`S\ ES`b 6WS`PSW USVb [O\ d][ 2ShW[OZagabS[ eSU c\R dS`eS\RSb RWS AbSZZS\eS`bWUYSWb RSa 2cOZagabS[a ;O\ Q]RWS`b OZa] O\VO\R RS` AbSZZS\eS`bWUYSWb RS` SW\hSZ\S\ 0Wba 0SWa^WSZ( EWS eW`R RWS 2ShW[OZhOVZ % OZa `SW\ PW\É`S HOVZ Q]RWS`b- AbSZZS\eS`b( 0WbRO`abSZZc\U(
#$
&
$" !
$
&
"
/PP!!( AbSZZS\eS`bWUYSWb RS` SW\hSZ\S\ 0Wba 2ShW[OZhOVZ % `SW\ PW\É` !#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" 8]U^a\PcX^]T] \PbRWX]T[[ SPabcT[[T]
?a^VaP\\ 0bRXX') 1XcZ^\QX]PcX^] X\ 0aQTXcbb_TXRWTa U¶a SXT IPW[ !& public class Ascii08 { public static void main(String args[]) { int zahl = 270; System.out.println(Integer.toBinaryString(zahl)); } } 4º` RWS `SW\ PW\É`S 1]RWS`c\U a^WSZb RWS /A177BOPSZZS YSW\S @]ZZS RS\\ Sa eW`R VWS` \WQVb SW\ SW\hSZ\Sa HSWQVS\ a]\RS`\ RWS HOVZ OZa 5O\hSa dS`aQVZºaaSZb /ca RS` BO PSZZS /PP !! YO\\ [O\ h0 OPZSaS\ ROaa RWS 2ShW[OZhOVZ $# `SW\ PW\É` eWS T]ZUb Q]RWS`b eW`R( c\R P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\WQ]RS TW\RS\ AWS c\bS` RS` /R`SaaS
http://www.unicode.org
2S` C\WQ]RS TOaab RWS 0Wba hc 5`c^^S\ d]\ XSeSWZa $ W\ \ScS`S\ DS`aW]\S\ PWa hc ! `OYbWaQV UWZb RWSa XSRS\TOZZa RS`hSWb \]QV \WQVb 2S\\ RWS 4`OUS eWS RWS C\WQ]RSHSWQVS\ SWUS\bZWQV S\babSVS\ Wab \]QV \WQVb PST`WSRWUS\R USZrab 2WS VScbWUS\ 4X]VPQTVTaÊcT c\R 3RWb]`S\ YS\\S\ VÉcTWU \c` RWS 0gbSDS`aQVZºaaSZc\U 2WS BOabObc` PS\cbhb Tº` RWS 3W\UOPS RS\ %PWb/A177 1]RS S`UÉ\hb c[ \ObW]\OZS 0Sa]\RS`VSWbS\ Tº` RWS \ÉQVabS\ & 9][PW\ObW]\S\ 2Oa PSRScbSb ROaa PSW[ 3W\bW^^S\ d]\ HSWQVS\ ºPS` RWS BOabObc` SW\S 9]\dS`bWS `c\U RWSaS` &PWb/A1771]RWS`c\U W\ RS\ C\WQ]RS S`T]ZUS\ [caa /ZZS`RW\Ua UWPb Sa PSW SW\WUS\ 3RWb]`S\ RWS ;rUZWQVYSWb [Wb 6WZTS d]\ C[aQVOZbbOabS\ h0 /:B1 7`]U`O[[ S`\Scb Oca SW\S` 3W\UOPSOcTT]`RS`c\U 2=A 0]f 5SPS\ AWS ROhc T]ZUS\RS\ 0STSVZ SW\( java Unicode02 > test.html 2ORc`QV eW`R RWS /caUOPS c[USZSWbSb W\ SW\S 6B;:2ObSW 2WSaS Yr\\S\ AWS RO\\ W\ SW\S[ 0`]eaS` O\hSWUS\ ES\\ R]`b OZa 1]RWS`c\U ESabSc`]^ÉWaQV 7A= USeÉVZb ec`RS [ºaabS ROa 3c`]hSWQVS\ O\UShSWUb eS`RS\ >`]PWS`S\ AWS OcQV SW\S O\RS`S 1]RWS`c\U W[ 7\bS`\Sb 3f^Z]`S` Rc`QV /`]U`O[[S\ RO`USabSZ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UZWQV 2Oa PSRScbSb ROaa RWSaS 2ObS\ d]`VS` d]\ SW\S[ SfbS`\S\ A^SWQVS` USZSaS\ ]RS` ºPS` RWS BOabObc` SW\ USUSPS\ eS`RS\ [ºaaS\ 2S[ 7\bS`^`SbS` [ºaaS\ RO\\ RWS >]aWbW]\ RS` 2ObS\ W[ /`PSWbaa^SWQVS` WV`S Ab`cYbc` RV RWS W\bS`\S 2O`abSZZc\U RS` 2ObS\ c\R WV`S DS` O`PSWbc\Ua[rUZWQVYSWbS\ PSYO\\b aSW\ C\R US\Oc ROTº` UWPb Sa RWS 2SYZO`ObW]\a O\eSWac\U W\ 8OdO 2c`QV RWS 2ObS\PSaQV`SWPc\U RSQZO`ObW]\ DS`SW\PO`c\U eW`R RS[ 1][^WZS` PS YO\\b US[OQVb eSZQVS 2ObS\ ROa >`]U`O[[ dS`O`PSWbSb eWS aWS OcTUSPOcb aW\R eSZQVS DS`O`PSWbc\Ua[rUZWQVYSWbS\ Sa Tº` aWS UWPb c\R eWS aWS `STS`S\hWS`b RV O R`SaaWS`b eS`RS\ 7\ 8OdO aWSVb RWS 2SYZO`ObW]\aO\eSWac\U UO\h OZZUS[SW\ eWS T]ZUb Oca(
0SWa^WSZ Tº` SW\S 2ObS\RSYZO`ObW]\(
String
text;
;Wb RWSaS` /\eSWac\U eW`R RS[ 1][^WZS` [WbUSbSWZb ROaa d][ 2ObS\bg^ BcaX]V SW\ =PXSYb PS\rbWUb eW`R ROa c\bS` RS[ 0ShSWQV\S` cTgc OR`SaaWS`b eS`RS\ YO\\ 2S` 0ShSWQV\S` cTgc eW`R OcQV OZa @STS`S\hdO`WOPZS PShSWQV\Sb RS\\ S` YO\\ SW\S @STS `S\h OcT SW\ PSabW[[bSa BcaX]V=PXSYb S\bVOZbS\ 2S` 2ObS\bg^ BcaX]V Wab W\ SW\S` [WbUSZWSTS`bS\ 9ZOaaS RS` AbO\RO`R0WPZW]bVSY SfOYb PSaQV`WSPS\ 2]`b abSVb e]`Oca RWSaS` 2ObS\bg^ PSabSVb SW\ BcaX]V Wab Oca SW\hSZ\S\ HSWQVS\ hcaO[[S\USaSbhb c\R eSZQVS DS`O`PSWbc\Ua[rUZWQVYSWbS\ RS[ >`]U`O[ [WS`S` hc` DS`TºUc\U abSVS\ h0 YO\\ [O\ BcaX]V OcaUSPS\ dS`UZSWQVS\ Y]^WS`S\ c\R Y]\YObS\WS`S\ OZa] heSW Ab`W\Ua hcaO[[S\TOaaS\ hc SW\S[ SW\hWUS\ cae 3W\S 0Sa]\RS`VSWb Wab ROaa PSW RS` 2SYZO`ObW]\ [SV`S`S 0ShSWQV\S` O\USUSPS\ eS` RS\ Yr\\S\ h0 double gehalt, stundenlohn, pension, rente; ;Wb RWSaS` 2SYZO`ObW]\ eS`RS\ dWS` 0ShSWQV\S` PSYO\\b US[OQVb ROPSW Wab RS` 2O bS\bg^ \c` SW\[OZ O\USUSPS\ 7\ RS` /cThÉVZc\U eS`RS\ RWS 0ShSWQV\S` eWS Tº` /cThÉVZc\US\ W\ 8OdO US\S`SZZ ºPZWQV Rc`QV 9][[O USb`S\\b 4º` XSRS RWSaS` dWS` DO`WOPZS\ UWZb ROaa RS` 2ObS\bg^ S^dQ[T Wab /ZZS`RW\Ua eW`R RWSaS AQV`SWPeSWaS \WQVb S[^T]VZS\ eSWZ RWS :SaPO`YSWb RSa ?cSZZbSfbSa RORc`QV ZSWRSb 2WS 2SYZO`ObW]\aO\eSWac\U YO\\ hcaÉbhZWQV SW\S 9ZOcaSZ hc[ 7\WbWOZWaWS`S\ S\bVOZbS\ 2WSaS 9ZOcaSZ RS` 7\WbWOZWhS` PSabSVb Oca RS[ HceSWac\Ua]^S`Ob]` + c\R SW\S[ /caR`cQY RS` RS\ /\TO\UaeS`b a^ShWTWhWS`b h0
int zahl = 4700;
""
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#!
FPb Xbc STa 3PcT]ch_.
=GYOYZJKX*GZKTZ_V%
8SRS DO`WOPZS VOb SW\S\ 2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O[[ RO\OQV hc` /caTºV`c\U abO`bS\ eW`R OcT RS` 1]\a]ZS OcaUSUSPS\( 6OZZ] # =TTS\aWQVbZWQV VOb RS` 1][^WZS` ROa >ZcaHSWQVS\ \WQVb OZa O`WbV[SbWaQVS\ 0STSVZ Tº` SW\S /RRWbW]\ W\bS`^`SbWS`b a]\RS`\ S` VOb RWS PSWRS\ ES`bS 6OZZ] c\R # dS`YSbbSb Q]\QObS\WS`b c\R RO\\ OcaUSUSPS\ /PVÉ\UWU d][ 2ObS\bg^ TºV`b RWS 8D; OZa] RWS `WQVbWUS /YbW ]\ Oca ÎQd]V " id\ ?a^VaP\\ 3TZ[PaPcX^] 0WbbS ºPS`^`ºTS\ AWS eWS RWS /caUOPS ZOcbSb eS\\ AWS W[ /caUOPSPSTSVZ heSW \c [S`WaQVS ES`bS [Wb RS[ >ZcaHSWQVS\ dS`PW\RS\ h0 println(5 + 3); R 3Ta 3PcT]ch_ QTbcX\\c SXT 0ac STa 3PcT]fTacT ST] FTacTQTaTXRW
<WQVb XSRS` 2ObS\bg^ POaWS`b OcT SW\S` 9ZOaaS\PSaQV`SWPc\U 3W\WUS SW\TOQVS ^`W[W bWdS 2ObS\bg^S\ aW\R W\ RWS A^`OQVS SW\USPOcb c\R Yr\\S\ d][ >`]U`O[[WS`S` PS\cbhb eS`RS\ ]V\S ROaa SW\S 9ZOaaS\PSaQV`SWPc\U OZa 5`c\RZOUS d]`ZWSUb 4º` XSRS\ SW\USPOcbS\ 2ObS\bg^ Wab SfOYb TSabUSZSUb eWSdWSZ A^SWQVS`^ZObh Tº` WV\ `SaS`dWS`b eW`R A] VOb h0 SW\S DO`WOPZS d][ 2ObS\bg^ RWPa SW\S 5`rzS d]\ heSW 0gbSa eSUS\ C\WQ]RS c\R aWS YO\\ US\Oc TX] SW\hSZ\Sa HSWQVS\ OcT\SV[S\ ?a^VaP\\ 3TZ[PaPcX^]!) EPaXPQ[T e^\ Ch_ RWPa
public class Deklaration02 { public static void main(String[] args) { char c = 'A'; System.out.println(c); } } 7\ RS` R`WbbS\ HSWZS eW`R RWS DO`WOPZS R d][ 2ObS\bg^ RWPa RSTW\WS`b d]S UZSWQVhSWbWU W\WbWOZWaWS`b RV Sa eW`R WV` SW\ /\TO\UaeS`b hcUSeWSaS\ ÎQd]V id\ ?a^VaP\\ 3TZ[PaPcX^]! BSabS\ AWS RWS @SOYbW]\ RSa 1][^WZS`a eS\\ AWS dS`acQVS\ RWS DO`WOPZS Q [Wb RS\ PSWRS\ HSWQVS\ /0 hc W\WbWOZWaWS`S\ 3a Y][[b RWS 4SVZS`[SZRc\U( c\QZ]aSR QVO`OQbS` ZWbS`OZ eSWZ \OQV RS[ S`abS\ HSW QVS\ ROa OPaQVZWSzS\RS 6]QVY][[O TSVZb 3W\S DO`WOPZS d][ 2ObS\bg^ RWPa YO\\ \c` SW\ SW\hSZ\Sa HSWQVS\ a^SWQVS`\ S 3Ta 2^\_X[Ta ¶QTafPRWc SXT ETaPaQTXcd]V ch_XbXTacTa 3PcT] D]` SW\S[ HcU`WTT OcT RS\ ES`b SW\S` DO`WOPZS\ ºPS`^`ºTb RS` 1][^WZS` a]eSWb [rUZWQV ]P RWS DO`WOPZS RSYZO`WS`b Wab c\R ]P SW\ Y]``SYbS` 7\VOZb d]`VO\RS\ Wab A] [caa d]` RS` S`abS\ 0S\cbhc\U SW\ ^OaaS\RS` ES`b hcUSeWSaS\ aSW\ S\beSRS` Rc`QV SW\S 7\WbWOZWaWS`c\U ]RS` Rc`QV SW\S ES`bShceSWac\U "$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#!
FPb Xbc STa 3PcT]ch_.
ÎQd]V ! id\ ?a^VaP\\ 3TZ[PaPcX^]! BSabS\ AWS ]P SW\S TSVZS`T`SWS C[eO\RZc\U [rUZWQV Wab eS\\ AWS RWS 7\WbWOZWaWS`c\U W\ RS` R`WbbS\ HSWZS S\bTS`\S\ Phe [Wb OZa 9][[S\bO` YS\\hSWQV\S\ 5PiXc) 2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9ZOaaS BcaX]V RWS 9ZOa aS 3PcT ]RS` RWS 9ZOaaS ?^X]c 2WS Ag\bOf Tº` RWS 2SYZO`ObW]\ d]\ @STS`S\hdO`WOPZS\ c\bS`aQVSWRSb aWQV \WQVb d]\ RS` 2SYZO`ObW]\ SW\S` ^`W[WbWdS\ DO`WOPZS\ 7\ PSWRS\ 4ÉZZS\ PSabSVb RWS 2SYZO`ObW]\ W\ RS` SW\TOQVabS\ 4]`[ Oca RS[ 2ObS\bg^ c\R RS[ ZObhSa W\ RWS @STS`S\hdO`WOPZS ºPS`b`OUS\ c\R
•
RWSaS` >ZObh [Wb abO\RO`RWaWS`bS\ ]RS` W\RWdWRcSZZS\ ES`bS\ W\WbWOZWaWS`b
/[ 0SWa^WSZ RSa PS`SWba PSYO\\bS\ >`]U`O[[a 3TZ[PaPcX^] e]ZZS\ eW` XSbhb US \OcS` YZÉ`S\ eWS RWS /PZÉcTS W[ /`PSWbaa^SWQVS` @/; aW\R eS\\ [Wb @STS`S\hdO `WOPZS\ USO`PSWbSb eW`R "&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#"
ATUTaT]ich_T]
?a^VaP\\ 3TZ[PaPcX^] ) ATUTaT]iePaXPQ[T d]S >QYTZc
public class Deklaration01 { public static void main(String[] args) { String text; //Referenzvariable erzeugen text = new String("Hallo "); // Objekt erzeugen System.out.println(text); // Objektwert ausgeben } } 0SW[ AbO`bS\ RWSaSa >`]U`O[[a USaQVWSVb W[ A^SWQVS` T]ZUS\RSa( 7[ S`abS\ AQV`Wbb eW`R SW\ >ZObh `SaS`dWS`b Tº` RWS @STS`S\hdO`WOPZS cTgc 2WSaS DO`WOPZS Wab d][ Bg^ BcaX]V RV aWS YO\\ OcT SW\ =PXSYb [Wb RS\ /bb`WPcbS\ c\R DS`O`PSW bc\Ua[rUZWQVYSWbS\ RWS W\ RS` 9ZOaaS BcaX]V PSaQV`WSPS\ aW\R dS`eSWaS\ 2c`QV RWS aS 2STW\WbW]\ VOb R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V RS` >ZObh Tº` RWS /R`SaaS `SaS`dWS`b RO\OQV Wab SW\ heSWbS` AQV`Wbb RWS 7\abO\hWWS`c\U [Wb ]Tf S`T]`RS`ZWQV RO[Wb SW\ =PXSYb S\babSVb 6WS`hc SW\ 6W\eSWa( 7\ SW\WUS\ O\RS`S\ >`]U`O[[WS`a^`OQVS\ eW`R heWaQVS\ 2SYZO`ObW]\ c\R 2STW\WbW]\ ab`S\U c\bS`aQVWSRS\ /Za 2SYZO`ObW]\ eW`R RS` D]`UO\U PShSWQV\Sb RS` SW\S\ \ScS\ 0ShSWQV\S` h0 Tº` SW\S DO`WOPZS PSYO\\b [OQVb c\R c\bS` 2STW\WbW]\ eW`R RO\\ \WQVb \c` RWS 2SYZO`ObW]\ a]\RS`\ OcQV RWS A^SWQVS`OZZ]YObW]\ Tº` RWS DO`WOPZS dS` abO\RS\ 8OdO c\bS`aQVSWRSb \WQVb heWaQVS\ RWSaS\ PSWRS\ 0SU`WTTS\ /cT RS\ \ÉQVabS\ ASWbS\ eW`R XSRS` 2ObS\bg^ RSbOWZZWS`b PSa^`]QVS\ 2WS 0SWa^WSZ^`] U`O[[S VOPS\ W[[S` RS\ UZSWQVS\ /cTPOc 2O[Wb AWS SW\ DS`abÉ\R\Wa Tº` RWS Ab`cY bc` c\R RWS eWQVbWUabS\ A^`OQVSZS[S\bS RWSaS` W[[S` UZSWQV OcTUSPOcbS\ >`]U`O[[S PSY][[S\ S`ZÉcbS`\ eW` hc\ÉQVab SW\ ;cabS`^`]U`O[[ ?a^VaP\\ Ch_T] ) 4X] ch_XbRWTb 43E?a^VaP\\ bXTWc X] 9PeP b^ Pdb)
import java.util.Scanner; public class Typen01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); int zahl; zahl = eingabe.nextInt(); zahl = zahl + 50; System.out.println("Ergebnis ist: " + zahl); } } 2Oa >`]U`O[[ VOb RWS bg^WaQVS Ab`cYbc` dWSZS` 32D>`]U`O[[S( 3W\UOPS DS`O`PSW b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TºV`c\U RSa >`]U`O[[a ab]^^b O\ RS` AbSZZS e] RWS 3W\UOPS SW\S` HOVZ S`eO`bSb eW`R 5SPS\ AWS SW\S UO\hS HOVZ SW\ h0 # 9ZÉ`S\ AWS W\ eSZQVS` HSWZS RWS DS`O`PSWbc\U a] ZO\US c\bS`P`]QVS\ eW`R PWa RS` 0SRWS\S` RWS 3W\UOPSbOabS 3\bS` R`ºQYb ÎQd]V !) @cTS\ AWS ROa >`]U`O[[ S`\Scb hc` /caTºV`c\U OcT 9ZÉ`S\ AWS eOa ^Oa aWS`b eS\\ AWS YSW\S 5O\hhOVZ SW\USPS\ a]\RS`\ h0 SW\S 9][[OhOVZ ]RS` SW\S\ 0cQVabOPS\ C\a W\bS`SaaWS`b O\ RWSaS` AbSZZS PSa]\RS`a RWS 2SYZO`ObW]\ RSa A^SWQVS`^ZObhSa Tº` SW\S ^`W[WbWdS DO`WOPZS 2WSa USaQVWSVb [Wb RS` T]ZUS\RS\ /\eSWac\U( int zahl; 2Oa AQVZºaaSZe]`b X]c ZSUb RS\ 2ObS\bg^ TSab RO\OQV eW`R RS` 7RS\bWTWS` 0ShSWQV\S` Tº` RWS DO`WOPZS RSTW\WS`b 2S` 2ObS\bg^ X]c Wab SW\S` d]\ PRWc TX]VTQPdcT] ^STa T[T\T]cPaT] TX]UPRWT] ^STa _aX\XcXeT] 3PcT]ch_T] 3W\TOQVS 2ObS\bg^S\ USVr`S\ hc[ 8OdOA^`OQVc[TO\U aWS eS`RS\ ºPS` AQVZºaaSZer`bS` YSge]`Ra PS \cbhb #!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# :[PbbT] d]S P]STaT Ch_T] QTbRWaTXQT] STR[PaPcX^]
*OK*GZKTZ_VKTLX-GT``GNRKT 3W\S UO\hS HOVZ Wab SW\S HOVZ ]V\S 9][[OabSZZS\ AWS YO\\ ^]aWbWd ]RS` \SUObWd aSW\ 5O\hS HOVZS\ eS`RS\ W\ 8OdO \]`[OZS`eSWaS `S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\hS\ W\bS`^`SbWS`b eS`RS\ ESWbS`VW\ Wab Rc`QV RS\ 2ObS\bg^ TSabZSUb eSZQVS =^S`ObW]\S\ [Wb RWSaS` DO`WOPZS\ S`ZOcPb aW\R h0 `SQV\S\ OPS` YSW\ Y]\YObS\WS`S\ ?a^VaP\\ 8]cTVTa ) 0aQTXcT] \Xc ST\ 3PcT]ch_ X]c import java.util.Scanner; public class Integer01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); int zahl; // Deklaration zahl = eingabe.nextInt(); // Einlesen System.out.println("Eingelesen wurde: " + zahl); } } #"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
##
B_TiXP[UP[[) ?aX\XcXeT 3PcT]ch_T]
ÎQd]VT] id\ ?a^VaP\\ 8]cTVTa ÎQd]V ( 0WbbS bSabS\ AWS ROa >`]U`O[[ W\RS[ AWS hc\ÉQVab SW\S\ PSZWSPWUS\ 7\bS US`eS`b SW\USPS\ 2O\\ Wab OZZSa W\ =`R\c\U ÎQd]V !( BSabS\ AWS RO\OQV [Wb SW\S[ \WQVb\c[S`WaQVS\ ES`b h0 [Wb 0cQVabO PS\ ]RS` [Wb SW\S[ USP`]QVS\S\ /\bSWZ S\beSRS` W\ O[S`WYO\WaQVS` AQV`SWPeSWaS PSW RS` O\abSZZS RSa 9][[O SW\ >c\Yb SW\USbW^^b eW`R h0 # ]RS` OcQV RWS RScbaQVS AQV`SWPeSWaS 2O\\ S`hScUb RWS 8D; SW\S\ :OcThSWbTSVZS` 3fQS^bW]\ ÎQd]V ") BSabS\ AWS XSbhb ROa >`]U`O[[ W\RS[ AWS SW\S \SUObWdS 5O\hhOVZ SW\US PS\ /QVbc\U( ROa D]`hSWQVS\ [caa d]` RS` HOVZ abSVS\ OZa] h0 #
##!! 3Ta 3PcT]ch_ QhcT
2Oa \ÉQVabS >`]U`O[[ S`eO`bSb d][ 0SRWS\S` ES`bS d][ 2ObS\bg^ QhcT 2WSa Wab SPS\TOZZa SW\ \c[S`WaQVS` 2ObS\bg^ EWS RWS BOPSZZS " hSWUb Wab RS` VrQVabS ES`b W\ SW\S` 0gbSDO`WOPZS\ % 3`ZÉcbS`c\U( 3W\S QhcTDO`WOPZS S\bVÉZb W[[S` SW\ D]` hSWQVS\PWb RSaeSUS\ abSVS\ Tº` RWS HOVZ aSZPab \c` % PWba hc` DS`TºUc\U 2Oa UWPb & ;rUZWQVYSWbS\ PSUW\\S\R [Wb RS` 2ShW[OZhOVZ [OfW[OZ RO\\ % ^]aWbWd ]RS` [W\W[OZ % \SUObWd ?a^VaP\\ 1hcT ) 0aQTXcT] \Xc ST\ 3PcT]ch_ QhcT import java.util.Scanner; public class Byte01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); byte zahl; // Deklaration zahl = eingabe.nextByte(); // Eingabe System.out.println("Eingegeben wurde: " + zahl); } } ÎQd]V id\ ?a^VaP\\ 1hcT ÎQd]V ( BSabS\ AWS ROa >`]U`O[[ hc\ÉQVab [Wb SW\S` Y]``SYbS\ \c[S`WaQVS\ 3W\ UOPS h0 & c\R RO\OQV [Wb SW\S[ ES`b RS` OczS`VOZP RSa ES`bSPS`SWQVa SW\S` QhcTDO`WOPZS\ ZWSUb h0 & ]RS` SW\S[ \WQVb\c[S`WaQVS\ ES`b ÎQd]V !( 3`ZOcPb RWSaS` 2ObS\bg^ RWS 3W\UOPS SW\S` \SUObWdS\ HOVZ h0 #- ÎQd]V "( DS`acQVS\ AWS aSZPababÉ\RWU SW\S\ [^]V2ObS\bg^ hc PS\cbhS\ :rac\Ua VW\eSWaS( 2Ohc Wab W\ HSWZS # RS` 2ObS\bg^ OcT [^]V hc É\RS`\ c\R W\ RS` HSWZS $ ZOcbSb RS` :SaSPSTSVZ(
zahl = eingabe.nextLong();
##
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# :[PbbT] d]S P]STaT Ch_T] QTbRWaTXQT] STR[PaPcX^]
*OK*GZKTZ_VKTLXJOK-RKOZQUSSG@GNRKTLRUGZOTMVUOTZ HOVZS\ [Wb `]U`O[[OPP`cQV ES\\ RWS 9ZOcaSZ TSVZb TºV`b ROa hc T]ZUS\RS[ C[eO\RZc\UaTSVZS`( ...unreported exception java.io.IOException; must be caught or declared to be thrown... /cT RS` 0OaWa d]\ SW\hSZ\S\ HSWQVS\ RWPaBg^ Yr\\S\ eSWbS`S BSfbbg^S\ USPWZRSb eS`RS\ A] UWPb Sa W\ 8OdO RWS 9ZOaaS\ BcaX]V c\R BcaX]V1dUUTa RWS SW\ Y][T]`bOPZSa /`PSWbS\ [Wb HSWQVS\YSbbS\ ab`W\Ua S`[rUZWQVS\
=XGVVKX1RGYYKT 7\ 8OdO UWPb Sa Tº` XSRS\ ^`W[WbWdS\ 2ObS\bg^ SW\S Y]``Sa^]\RWS`S\RS 9ZOaaS OZa] Tº` RS\ Bg^ RWPa RWS 9ZOaaS 2WPaPRcTa Tº` RS\ Bg^ QhcT RWS 9ZOaaS 1hcT cae 2WS 9ZOa aS\ eS`RS\ E`O^^S`9ZOaaS\ US\O\\b AWS Yr\\S\ O\abSZZS RS` SW\TOQVS\ 2ObS\bg ^S\ PS\cbhb eS`RS\ QYTZc TaiTdVT] public class Wrapper01 { public static void main (String[] args) Integer zahl = new Integer(25); System.out.println(zahl + 3); } }
{
2Oa >`]U`O[[ FaP__Ta! hSWUb eWS [Wb 6WZTS SW\S` ;SbV]RS RS` E`O^^S`9ZOaaS 2WPaPRcTa OPUST`OUb eS`RS\ YO\\ ]P Sa aWQV PSW SW\S[ HSWQVS\ c[ SW\S\ 5`]z PcQVabOPS\ VO\RSZb ?a^VaP\\ FaP__Ta!) `]U`O[[aWQVS`VSWb eW`R S`VrVb eSWZ RS` 1][^WZS` RWS Y]``SYbS DS`eS\ Rc\U RS` A^SWQVS`^ZÉbhS ºPS`^`ºTb
•
@Saa]c`QS\=^bW[WS`c\US\ aW\R [rUZWQV RS` A^SWQVS`PSRO`T c\R RWS ]^bW[OZS DS`O`PSWbc\UaT]`[ YO\\ O\VO\R R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YSW\S ;SbV]RS\ OcTUS`cTS\ eS` RS\
FT[RWT _aX\XcXeT] 3PcT]ch_T] VXQc Tb. 3a UWPb SW\USPOcbS 2ObS\bg^S\ Tº` UO\hS HOVZS\ Tº` `SSZZS HOVZS\ [Wb 9][[OabSZ ZS\ Tº` SW\hSZ\S C\WQ]RSHSWQVS\ c\R Tº` Z]UWaQVS ES`bS 7[ 3W\hSZ\S\ aW\R RWSa RWS T]ZUS\RS\ OQVb 2ObS\bg^S\( •
dWS` UO\hhOVZWUS Bg^S\ QhcT bW^ac X]c [^]V RWS aWQV \c` c\bS`aQVSWRS\ Rc`QV RWS :É\US RSa `SaS`dWS`bS\ A^SWQVS`^ZObhSa " ]RS` & 0gbS
•
heSW `SOZS 2ObS\bg^S\ RWS 5ZSWbY][[OhOVZS\ U[^Pc ^STa S^dQ[T RWS aWQV W\ RS` 5S\OcWUYSWb ROa VSWzb W\ RS` /\hOVZ RS` AbSZZS\ d]` c\R VW\bS` RS[ 9][[O c\bS`aQVSWRS\
•
0]]ZSaQVS` 2ObS\bg^ Q^^[TP] RS` W\ RS` :OUS Wab RWS EOV`VSWbaeS`bS cadT ] RS` UP[bT hc a^SWQVS`\
•
HSWQVS\bg^ RWPa RS` XSRSa SW\hSZ\S HSWQVS\ O\VO\R RS` C\WQ]RSBOPSZZS RV W\ 0gbSa OZa] $ PWba dS`aQVZºaaSZb
FT[RWT ATVT[] VT[cT] U¶a _aX\XcXeT 3PcT]ch_T]. •
2S` >ZObhPSRO`T W[ /`PSWbaa^SWQVS` Wab Rc`QV RWS A^`OQVa^ShWTWYObW]\ TSabUSZSUb c\OPVÉ\UWU d]\ RS` 6O`ReO`S^ZObbT]`[ c\R d]\ RS` 0Sb`WSPaagabS[c[USPc\U ROa Wab TX] 5`c\R Tº` RWS 9][^ObWPWZWbÉb d]\ 8OdO^`]U`O[[S\
•
2O[Wb Wab OcQV RS` ES`bSPS`SWQV RS` VrQVabS c\R \WSR`WUabS RO`abSZZPO`S ES`b \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( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$!
?aX\XcXeT EPaXPQ[T]
/TOZOGROYOKX[TM\UTVXOSOZO\KT`]U`O[[ PSYO\\b US[OQVb ROaa SW\ A^SWQVS`PS `SWQV `SaS`dWS`b eS`RS\ a]ZZ RS` $" PWb U`]z Wab c\R 5ZSWbY][[OhOVZS\ a^SWQVS`\ YO\\ 2S` /\TO\UaeS`b Wab ASW\ OYbcSZZS` ES`b YO\\ c\bS` RS[ `]U`O[[ c[ c\R TºV`S\ AWS Sa Oca 4]`[OZ Wab OZZSa W\ =`R\c\U OPS` Sa ^OaaWS`b \Obº`ZWQV \WQVba Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa RS` ES`b RS` DO`WOPZS\ VTWP[c OcT BhbcT\^dc OcaUSUSPS\ eW`R c\R dS`acQVS\ AWS ROa >`]U`O[[ c[hceO\RSZ\ 2WS 4SVZS`[SZRc\U ZOcbSb aW\\US[Éz( 2WS DO`WOPZS Wab \WQVb W\WbWOZWaWS`b ÎQd]V !) Ò\RS`\ AWS OZa] ROa >`]U`O[[ S`\Scb W\RS[ AWS 7V` Ec\aQVUSVOZb OZa 7\WbWOZES`b W\ RWS DO`WOPZS aQV`SWPS\ =P\T] XST]cXUXTa U¶a EPaXPQ[T] 2WS `]U`O[[WS`S` T`SW eÉVZPO` /caUSaQVZ]aaS\ aW\R OZZS`RW\Ua RWS AQVZºaaSZer`bS` RS` A^`OQVS RS\\ RWSaS VOPS\ SW\S TSabUSZSUbS 0SRScbc\U 2WS :É\US Wab PSZWSPWU OZa HSWQVS\ Wab TOab XSRSa C\WQ]RShSWQVS\ S`ZOcPb \c` RWS S`abS AbSZZS [caa SW\ 0cQVabOPS aSW\ 3[^TSVZc\US\ Tº` RWS `]PZS[S PSW[ /\hSWUS\ ]RS` /caR`cQYS\ RSa ?cSZZbSfba UWPb a]ZZbS\ RWS 0ShSWQV\S` YSW\S HSWQVS\ OczS`VOZP RSa `SW\S\ /A1771]RSa S\bVOZbS\ /cQV RScbaQVS C[ZOcbS aW\R hc dS`[SWRS\ /PVÉ\UWU d]\ RS` >]aWbW]\ e] SW\S DO`WOPZS RSYZO`WS`b Wab c\bS`aQVSWRSb [O\ \]QV RWS AQ]^S 2Oa Wab RWS AWQVbPO`YSWb RS` 2SYZO`ObW]\ RV aWS PSaQV`SWPb e] RWS DO `WOPZS US\cbhb eS`RS\ YO\\ c\R e] \WQVb 2WSa Wab SW\ BVS[O ROa W[ 9O^WbSZ $ S` ZÉcbS`b eW`R $#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
=KXZK`[]KOY[TMGT`]U`O[[WS`S` SW\S\ 7\WbWOZeS`b PSY][[S\ PSd]` aWS US\cbhb eS`RS\ Yr\\S\ DO`WOPZS\ RWS ;WbUZWSRS` SW\S` 9ZOa aS aW\R eS`RS\ OczS`VOZP d]\ ;SbV]RS\ RSYZO`WS`b c\R RWSaS DO`WOPZS\ eS`RS\ Ocb][ObWaQV W\WbWOZWaWS`b 2Ohc W\ a^ÉbS`S\ 9O^WbSZ\ [SV` 7[ >`]U`O[[ EPaXPQ[T] aW\R OZZS R`SW DO`WOPZS\ Z]YOZ 2SaVOZP [ºaaS\ aWS Sf^ZW hWb SW\S\ ES`b OZa /\TO\UaeS`b PSY][[S\ 2Oa YO\\ S`T]ZUS\ •
S\beSRS` PS`SWba PSW RS` 2SYZO`ObW]\ W\RS[ ROa 5ZSWQVVSWbahSWQVS\ c\R ROVW\ bS` RS` USeº\aQVbS 7\WbWOZeS`b SW\USb`OUS\ eS`RS\
•
]RS` a^ÉbS` hc` :OcThSWb RSa >`]U`O[[a Rc`QV SW\S HceSWac\U [Wb RS` SW\ ES`b W\ RWS DO`WOPZS USaQV`WSPS\ eW`R
?a^VaP\\ EPaXPQ[T]!) 8]XcXP[XbXTaT] e^] [^ZP[T] EPaXPQ[T] public class Variablen02 { public static void main(String[] args) char zeichen = 'x'; double gehalt = 2000.00; boolean vorhanden= true; System.out.println(vorhanden); } }
{
ÎQd]V id\ ?a^VaP\\ EPaXPQ[T]! Ò\RS`\ AWS ROa >`]U`O[[ eWS T]ZUb( 4ºV`S\ AWS ZTX]T 7\WbWOZWaWS`c\U PSW RS` 2SYZO `ObW]\ Oca a]\RS`\ Q]RWS`S\ AWS abObbRSaaS\ SW\S ES`bShceSWac\U 2WS /caUOPS RSa >`]U`O[[a dS`É\RS`b aWQV RORc`QV \WQVb a]\RS`\ \c` ROa DS`VOZ bS\( XSbhb eW`R RS` ES`b \WQVb PS`SWba hc` C[eO\RZc\UahSWb SW\USb`OUS\ a]\RS`\ S`ab hc` :OcThSWb 0SW XSRS` ES`bShceSWac\U ºPS`^`ºTb RS` 1][^WZS` ]P RS` USaS\RSbS ES`b Y][^ObWPSZ Wab hc RS[ 2ObS\bg^ RS` 3[^TÉ\US`dO`WOPZS\ HceSWac\UaY][^O bWPWZWbÉb $$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$!
?aX\XcXeT EPaXPQ[T]
;»bd]Vbe^abRW[PV) ?a^VaP\\ EPaXPQ[T]") FTacTidfTXbd]V P] EPaXPQ[T] public class Variablen03 { public static void main(String[] args) char zeichen; double gehalt; boolean vorhanden; zeichen = 'x'; gehalt = 2000; vorhanden = true; System.out.println(vorhanden); } }
{
2S` DO`WOPZS\\O[S abSVb Tº` RS\ ES`b RS` DO`WOPZS\ 2Oa VSWzb eS\\ W\ SW\S[ 0S TSVZ RS` `]U`O[[ CPdbRWT] a]ZZ RS\ 7\VOZb RWS ES`bS RS` DO`WOPZS\ i c\R i! bOcaQVS\ c\R RO\OQV O[ 0WZRaQVW`[ OcaUSUSPS\ ?a^VaP\\ CPdbRWT] ) CPdbRWT] STa FTacT e^] ! EPaXPQ[T] import java.util.Scanner; public class Tauschen01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); int z1; int z2; System.out.println("Bitte 2 Zahlen eingeben"); z1 = eingabe.nextInt(); z2 = eingabe.nextInt(); System.out.println("Zahl1 = " + z1 + " Zahl2 = " + z2); int hilfsvariable = z1; z1 = z2; z2 = hilfsvariable; System.out.println("Zahl1 = " + z1 + " Zahl2 = " + z2); } } $%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
2WS 0Sa]\RS`VSWb W\ RWSaS[ >`]U`O[[ Wab ROaa SW\S 6WZTadO`WOPZS RSTW\WS`b eS`RS\ [caa RWS bS[^]`É` SW\S\ ES`b heWaQVS\a^SWQVS`b ÎQd]V id\ ?a^VaP\\ CPdbRWT] 0WbbS \]bWS`S\ AWS OcT SW\S[ 0ZObb >O^WS` eSZQVS /`PSWbaa^SWQVS`^ZÉbhS RSTW\WS`b eS` RS\ eWS U`]z RWSaS aW\R c\R eWS aWQV RS`S\ 7\VOZbS hc` >`]U`O[[ZOcThSWb dS`É\ RS`\
8KLKXKT`\GXOGHRKT
*KQRGXGZOUTKOTKX8KLKXKT`\GXOGHRKT 0SW RS` 2SYZO`ObW]\ SW\S` DO`WOPZS\ YO\\ OZa 2ObS\bg^ \WQVb \c` SW\S` RS` OQVb SW\ USPOcbS\ 2ObS\bg^S\ O\USUSPS\ eS`RS\ a]\RS`\ R]`b YO\\ OZa Bg^ OcQV SW\ 9ZOa aS\\O[S abSVS\ 2OPSW YO\\ Sa aWQV SW\S RS` [WbUSZWSTS`bS\ 9ZOaaS\ VO\RSZ\ Oca RS` AbO\RO`RPWPZW]bVSY RS` 8 A3 ]RS` c[ SW\S 9ZOaaS RWS hcUSYOcTb ]RS` aSZPab US aQV`WSPS\ ec`RS 2O[Wb Wab RWS A^`OQVS 8OdO PSZWSPWU S`eSWbS`PO` ROa 6W\hcTºUS\ d]\ 9ZOaaS\ S\ba^`WQVb SW\S[ 6W\hcTºUS\ d]\ eSWbS`S\ 2ObS\bg^S\ [Wb WV`S\ DS`O` PSWbc\Ua[rUZWQVYSWbS\ EW` VOPS\ PS`SWba [SV`TOQV [Wb RS` AbO\RO`RYZOaaS BcaX]V USO`PSWbSb h0
String text;
2c`QV RWSaS 2SYZO`ObW]\aO\eSWac\U eW`R SW\S DO`WOPZS RSYZO`WS`b RWS RWS 4ÉVWUYSWb VOb OcT SW\ PSZWSPWUSa Ab`W\U]PXSYb hc dS`eSWaS\ 2WS DO`WOPZS cTgc eW`R OcQV @STS `S\hdO`WOPZS US\O\\b eSWZ aWS SW\S @STS`S\h OcT SW\ =PXSYb S\bVOZbS\ a]ZZ 3W\S @STS `S\h Wab SW\S /R`SaaS OcT RS\ /\TO\U RS` =PXSYbeS`bS /PS` \]QV S\bVÉZb RWSaS DO`W OPZS YSW\S\ ES`b RS\\ Sa SfWabWS`b \]QV YSW\ Ab`W\U]PXSYb ?a^VaP\\ BcaX]V ) ATUTaT]iePaXPQ[T STZ[PaXTaT] public class String01 { public static void main(String[] args) { String text; } } ÎQd]V id\ ?a^VaP\\ BcaX]V 3`UÉ\hS\ AWS ROa >`]U`O[[ c[ SW\S\ /caUOPSPSTSVZ RS` RS\ 7\VOZb RS` DO`WOPZS\ cTgc O[ 0WZRaQVW`[ OcaUSPS\ a]ZZ DS`acQVS\ AWS SW\S C[eO\RZc\U c\R W\bS`^`SbWS `S\ AWS RWS 4SVZS`[SZRc\U 2S` 5`c\R Tº` RWS 4SVZS`[SZRc\U Wab( 2WS DO`WOPZS cTgc a]ZZ SW\ =PXSYb `STS`S\hWS`S\ OPS` RWSaSa =PXSYb Wab W[ A^SWQVS` \]QV UO` \WQVb d]`VO\RS\
$&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$"
ATUTaT]iePaXPQ[T]
5HPKQZKX`K[MKT/TYZGT`OOKXKT[TJOTOZOGROYOKXKT EW` VOPS\ PS`SWba W\ T`ºVS`S\ >`]U`O[[S\ USaSVS\ ROaa SW\ =PXSYb [Wb RS[ AQVZºaaSZe]`b ]Tf S`hScUb eW`R 6W\bS` RS[ AQVZºaaSZe]`b ]Tf eW`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bT] TaiTdVT]
public class String02 { public static void main(String[] args) String str1 = new String("Java"); String str2 = new String("buch"); String ergebnis; ergebnis = str1.concat(str2); System.out.println(ergebnis); } }
{
2WS HSWZS
String str1 = new String("Java"); $'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
TOaab R`SW D]`UÉ\US hcaO[[S\ 3a Wab RWS 9c`haQV`SWPeSWaS Tº`(
String str1; str1 = new String("Java");
Hc\ÉQVab eW`R SW\S @STS`S\hdO`WOPZS [Wb RS[ 0ShSWQV\S` bca RSYZO`WS`b c\R RO\OQV eW`R ROa SWUS\bZWQVS Ab`W\U]PXSYb S`hScUb Rc`QV ROa AQVZºaaSZe]`b ]Tf C\R R`Wb bS\a eW`R RWSaSa =PXSYb [Wb RS[ 7\WbWOZeS`b 8OdO PSZSUb ÎQd]V id\ ?a^VaP\\ BcaX]V! 2Oa >`]U`O[[ S`hScUb W\aUSaO[b R`SW =PXSYbS 0WbbS WRS\bWTWhWS`S\ AWS RWS R`SW =P XSYbS O^WS` ÍPS`ZSUS\ AWS eO\\ c\R W\ eSZQVS\ AQV`WbbS\ RWS PS\rbWUbS\ >ZÉbhS O\USZSUb eS`RS\ HSWQV\S\ AWS OcQV RS\ 7\VOZb RS\ ES`b SW\ RS\ RWS =PXSYbS W[ :OcTS RS` >`]U`O[[Oca TºV`c\U VOPS\ 6T]TaT[[Ta 7X]fTXb id\ 0aQTXcT] \Xc BcaX]V>QYTZcT] 7\ XSRS` >`]U`O[[WS`a^`OQVS eS`RS\ 2ObS\bg^S\ [Wb RS\S\ BSfbS HSWQVS\YSbbS\ Ab`W\Ua PSaQV`WSPS\ eS`RS\ Yr\\S\ aSV` VÉcTWU PS\rbWUb 2WSa UWZb \Obº`ZWQV OcQV Tº` 8OdO 2SaeSUS\ VOPS\ RWS 3\beWQYZS` RS` A^`OQVS SW\S DS`SW\TOQVc\U a^ShWSZZ Tº` ROa /`PSWbS\ [Wb BcaX]V=PXSYbS\ S`[rUZWQVb A] Yr\\S\ BcaX]VDO`WOPZS W[ /` PSWbaa^SWQVS` S`hScUb eS`RS\ ]V\S Sf^ZWhWb ROa AQVZºaaSZe]`b ]Tf hc PS\cbhS\ 3\beSRS` YO\\ RWS =PXSYbS`hScUc\U PS`SWba hcaO[[S\ [Wb RS` 2SYZO`ObW]\ RS` @S TS`S\hdO`WOPZS\ S`T]ZUS\(
String text = "Hallo";
]RS` a^ÉbS` W\ SW\S` aS^O`ObS\ ES`bShceSWac\U(
String text; ... text = "Hallo";
EW` VOPS\ W\ RS\ PWaVS`WUS\ 0SWa^WSZS\ hc` =PXSYbS`hScUc\U OZZS`RW\Ua OcQV Tº` Ab`W\Ua ROa AQVZºaaSZe]`b ]Tf PS\cbhb c[ hc RS[]\ab`WS`S\ eWS RWS 7\abO\hS`hSc Uc\U \]`[OZS`eSWaS RV PSW OZZS\ O\RS`S\ 9ZOaaS\ hc S`T]ZUS\ VOb
1TXb_XT[ U¶a ST] 3PcT]ch_ ?^X]c 2Oa \ÉQVabS >`]U`O[[ dS`eS\RSb RS\ 2ObS\bg^ ?^X]c 2WSaS AbO\RO`RYZOaaS PS aQV`SWPb heSW 7\bSUS`TSZRS` f c\R g hc` A^SWQVS`c\U SW\S` >]aWbW]\ W\ SW\S` 9]]`RW \ObS /Za DS`O`PSWbc\Ua[rUZWQVYSWbS\ Tº` RWSaS\ 2ObS\bg^ aW\R SbeO hSV\ ;SbV]RS\ d]`^`]U`O[[WS`b cO OcQV RWS ;SbV]RS c^BcaX]V ?a^VaP\\ ?^X]c ) 8]bcP]i STa :[PbbT ?^X]c TaiTdVT] d]S PdbVTQT]
import java.awt.*; class Point01 { %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$"
ATUTaT]iePaXPQ[T]
public static void main(String[] args) { Point p; p = new Point(5,3); System.out.println(p.toString()); } } 2Oa >`]U`O[[ ?^X]c RSTW\WS`b RWS @STS`S\hdO`WOPZS ^ S`hScUb [Wb ]Tf SW\ =PXSYb d][ Bg^ ?^X]c [Wb RS\ ES`bS\ # c\R ! c\R `cTb O\aQVZWSzS\R RWS ;SbV]RS c^BcaX]V OcT RO[Wb RWS ES`bS ºPS` BhbcT\^dc OZa Ab`W\U O\UShSWUb eS`RS\
=KXZ`[]KOY[TMHKO8KLKXKT`Z_VKT ES\\ SW\S @STS`S\hdO`WOPZS dS`O`PSWbSb eS`RS\ a]ZZ [caa aWS OZa ES`b S\beSRS` ]d[[ S\bVOZbS\ eS\\ Tº` aWS \]QV YSW\ =PXSYb SfWabWS`b ]RS` SW\S @STS`S\h c[ SW\ =P XSYb hc S``SWQVS\ 2OPSW Yr\\S\ Rc`QVOca [SV`S`S @STS`S\hdO`WOPZS OcT ROaaSZPS =PXSYb dS`eSWaS\ ?a^VaP\\ ?^X]c!) IfTX ATUTaT]iT] PQTa ]da >QYTZc import java.awt.*; public class Point02 { public static void main(String[] args) { Point p1 = new Point(5,3); Point p2; p2 = p1; // Wertezuweisung System.out.println(p2.toString()); } } A] eWS ^`W[WbWdS\ DO`WOPZS\ SW\ ES`b hcUSeWSaS\ eS`RS\ YO\\ a] Wab RWSa OcQV Tº` @STS`S\hdO`WOPZS\ S`ZOcPb /ZZS`RW\Ua UWZb Tº` PSWRS DO`WOPZS\O`bS\( RWS ES`bS [ºaaS\ Y][^ObWPSZ aSW\ RV aWS [ºaaS\ hc RS[ 3[^TÉ\US` ^OaaS\ <WQVb S`ZOcPb h0 Wab RWS HceSWac\U SW\Sa ^`W[WbWdS\ Bg^a O\ SW\S\ @STS`S\hbg^ RS\\ RWSaS DO`WOPZS\ aW\R \WQVb idfTXbd]VbeTacaÊV[XRW 3W\S` @STS`S\hdO`WOPZS\ YO\\ \c` SW\ ES`b hc USeWSaS\ eS`RS\ RS` RS[ 9ZOaaS\bg^ S\ba^`WQVb [Wb RS[ aWS RSTW\WS`b e]`RS\ Wab ÎQd]V id\ ?a^VaP\\ ?^X]c! ÎQd]V ( ÍPS`ZSUS\ AWS hc\ÉQVab bVS]`SbWaQV RWS /caeW`Yc\U T]ZUS\RS` >`] U`O[[É\RS`c\U( ESWaS\ AWS RS` DO`WOPZS\ ^ c\[WbbSZPO` d]` RS[ /caUOPSPSTSVZ ]d[[ hc Rc`QV( p1 = null;" 9O\\ ^ b`]bhRS[ Y]``SYb OcaUSUSPS\ eS`RS\- ÍPS`^`ºTS\ AWS RWSa ^`OYbWaQV ÎQd]V !) DS`acQVS\ AWS RO\OQV RWS ES`bS RSa =PXSYba _ OcahcUSPS\ :rac\Ua VW\eSWa( 3a [ºaabS T]ZUS\RS 4SVZS`[SZRc\U Y][[S\( Exception in thread "main" java.lang.NullPointerException". %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
7[ >`]U`O[[ ?^X]c! ec`RS RS` ES`b d]\ _ RS` DO`WOPZS _! hcUSeWSaS\ 2O[Wb eO`S\ W[ /`PSWba^SWQVS` T]ZUS\RS >ZÉbhS PSZSUb ^
f + # g + !
^
/PP #( HeSW @STS`S\hdO`WOPZS\ OPS` \c` =PXSYb 0Sa]\RS`a eWQVbWU Wab RWS 3`YS\\b\Wa ROaa Rc`QV RWS HceSWac\U W[ >`]U`O[[ ?^X]c! \WQVb ROa =PXSYb RS[ 3[^TÉ\US` hcUSeWSaS\ eW`R a]\RS`\ ROaa ZSRWUZWQV RWS @STS`S\h OcT ROa =PXSYb Y]^WS`b c\R W\ RWS DO`WOPZS\ _! b`O\a^]`bWS`b e]`RS\ Wab 2Oa =PXSYb aSZPab Wab \c` SW\[OZ W[ /`PSWbaa^SWQVS` 2Oa \ÉQVabS >`]U`O[[ ?^X]c" PSeSWab RWSaS /caaOUS 2]`b eS`RS\ \É[ZWQV RWS PSWRS\ ES`bS d]\ f c\R g USÉ\RS`b RV XSbhb eW`R ROa =PXSYb aSZPab dS`É\RS`b ?a^VaP\\ ?^X]c") FTacTidfTXbd]V P] SPb >QYTZc bT[Qbc import java.awt.*; public class Point03 { public static void main(String[] args) { Point p1 = new Point(5,3); Point p2; p2 = p1; // Wertezuweisung p2.x = 3333; p2.y = 4444; System.out.println(p1.toString()); System.out.println(p2.toString()); } } 2WS /caUOPS Wab W\ PSWRS\ 4ÉZZS\ UZSWQV 2O[Wb eW`R RScbZWQV ROaa a]e]VZ _ OZa OcQV _! OcT ROaaSZPS =PXSYb `STS`S\hWS`S\ ÎQd]V id\ ?a^VaP\\ ?^X]c" 0WbbS USPS\ AWS [Wb RS` _aX]c[];SbV]RS RS\ gES`b RS` 7\abO\h ^ Oca :rac\Ua VW\eSWa( RWSaS DO`WOPZS YO\\ `STS`S\hWS`b eS`RS\ Rc`QV p1.y"
%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$"
ATUTaT]iePaXPQ[T]
=UJ[XIN[TZKXYINKOJKTYOINVXOSOZO\K[TJ8KLKXKT`\GXOGHRKT% 7\ SW\S[ 8OdO^`]U`O[[ Yr\\S\ DO`WOPZS\ SW\S\ ^`W[WbWdS\ 2ObS\bg^ ]RS` SW\S\ @S TS`S\hbg^ VOPS\ 2S[hcT]ZUS Yr\\S\ OcQV heSW /`bS\ d]\ DO`WOPZS\eS`bS\ c\bS` aQVWSRS\ eS`RS\( ^`W[WbWdS ES`bS c\R @STS`S\heS`bS E] ZWSUS\ RWS U`c\RaÉbhZWQVS\ C\bS`aQVWSRS heWaQVS\ RS\ @STS`S\hdO`WOPZS\ c\R SW\TOQVS\ DO`WOPZS\- •
>`W[WbWdS DO`WOPZS\ PSabSVS\ Oca US\Oc SW\S[ ES`b RWSaSa 2ObS\bg^a @STS`S\h DO`WOPZS\ Yr\\S\ OcT hcaO[[S\USaSbhbS =PXSYbS dS`eSWaS\ RWS Oca c\bS` aQVWSRZWQVS\ Bg^S\ hcaO[[S\USaSbhb aW\R
•
2WS Ag\bOf eWS aWS S`hScUb eS`RS\ Wab c\bS`aQVWSRZWQV( Tº` @STS`S\hdO`WOPZS\ PS\rbWUb [O\ ROa AQVZºaaSZe]`b ]Tf
•
/`b c\R C[TO\U RSa A^SWQVS`^ZObhSa Wab c\bS`aQVWSRZWQV( =PXSYbS PS\rbWUS\ hc aÉbhZWQV hc RS\ SWUS\bZWQVS\ 2ObS\ \]QV SW\S @STS`S\hdO`WOPZS RWS OcT RS\ HWSZeS`b dS`eSWab
•
2S` HSWb^c\Yb eO\\ RWS 5`rzS RSa /`PSWbaa^SWQVS`^ZObhSa Tº` RWSaS DO`WOPZS PS abW[[b eW`R Wab c\bS`aQVWSRZWQV( PSW SW\TOQVS\ 2ObS\bg^S\ YO\\ RWSa PS`SWba hc` C[eO\RZc\UahSWb Q][^WZSbW[S c\R PSW @STS`S\hbg^S\ S`ab hc` /caTºV`c\Ua hSWb `c\bW[S PSabW[[b eS`RS\
•
2S` HSWb^c\Yb eO\\ RS` A^SWQVS`^ZObh O\UST]`RS`b eW`R /ZZ]YWS`c\U Wab c\bS` aQVWSRZWQV( SW\TOQVS DO`WOPZS\ Yr\\S\ PS`SWba PSW[ :ORS\ RSa >`]U`O[[a W\ RS\ /`PSWbaa^SWQVS` RS\ O\UST]`RS`bS\ >ZObh PSZSUS\ @STS`S\hdO`WOPZS\ eS`RS\ \OQV 0SRO`T eÉV`S\R RS` >`]U`O[[OcaTºV`c\U Rg\O[WaQV [Wb RS[ AQVZºa aSZe]`b ]Tf S`hScUb
•
=Pe]VZ SW\S ES`bShceSWac\U Tº` PSWRS DO`WOPZS\bg^S\ [Wb RS[ 5ZSWQVVSWbahSW QVS\ + S`T]ZUS\ YO\\ Wab RWS EW`Yc\U aSV` c\bS`aQVWSRZWQV( PSW SW\TOQVS\ DO`W OPZS\ eW`R RS` ES`b aSZPab hcUSeWSaS\ PSW @STS`S\hbg^S\ eW`R RWS @STS`S\h OcT ROa =PXSYb hcUSeWSaS\
7\ a^ÉbS`S\ 9O^WbSZ\ eS`RS\ AWS fTXcTaT D]cTabRWXTST RWSaS` PSWRS\ DO`WOPZS\O` bS\ YS\\S\ZS`\S\ 2S` D]ZZabÉ\RWUYSWb VOZPS` eS`RS\ RWSaS PS`SWba VWS` OcTUSTºV`b( •
2WS Ag\bOf eWS aWS dS`O`PSWbSb eS`RS\ h0 dS`UZSWQVS\ hceSWaS\ Y]^WS`S\ cae Wab c\bS`aQVWSRZWQV 0SW @STS`S\hbg^S\ eS`RS\ \]`[OZS`eSWaS ;SbV]RS\ OcTUS`cTS\ PSW SW\TOQVS\ Bg^S\ eW`R [SWabS\a [Wb =^S`Ob]`S\ eWS /RRWbW]\ ]RS` * DS`UZSWQV USO`PSWbSb
•
2WS ÍPS`UOPS OZa >O`O[SbS` PSW[ /cT`cT d]\ ;SbV]RS\ c\bS`aQVSWRSb aWQV PSW =PXSYbS\ U`c\RZSUS\R d]\ RS` /`b eWS SW\TOQVS DO`WOPZS ºPS`USPS\ eS`RS\ 3a eW`R heO` W[[S` RS` ES`b RS` DO`WOPZS\ Y]^WS`b OPS` \c` PSW SW\TOQVS\ DO`WOP ZS\ Wab Sa RS` bObaÉQVZWQVS ES`b PSW =PXSYbS\ VO\RSZb Sa aWQV c[ RS\ ES`b RS` @STS`S\hdO`WOPZS\ OZa] c[ RWS /R`SaaS d]\ RS[ =PXSYb RS` Y]^WS`b c\R ºPS` USPS\ eW`R %!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
1UTYZGTZKT
3TZ[PaPcX^] e^] :^]bcP]cT]
9]\abO\bS\ aW\R W\ 8OdO `]U`O[[WS`S` ZSRWUZWQV [rUZWQV RWSaS >ZÉbhS TX]\P[ hc TºZZS\ RO\OQV Wab SW \S Ò\RS`c\U \WQVb [SV` S`ZOcPb 9]\abO\bS\ PSabSVS\ Oca •
SW\S[ 7 UWPb Sa OZa 0SabO\RbSWZ d]\ 9ZOaaS\ VÉcTWU SW\USPOcbS 9]\abO\bS\ AWS eS`RS\ O\abSZZS d]\ \c[S`WaQVS\ ES`bS\ PS\cbhb eSWZ aWS RORc`QV OcaaOUSTÉVWUS` eS`RS\ A] UWPb Sa h0 W\ RS\ E`O^^S`9ZOaaS\ Tº` SW\TOQVS DO`WOPZS\ SW\USPOcbS 9]\abO\ bS\ RWS RS\ XSeSWZa VrQVabS\ ]RS` \WSR`WUabS\ ES`b RSa 2ObS\bg^a S\bVOZbS\ 2Oa T]ZUS\RS 0SWa^WSZ hSWUb eWS ;OfW[OZeS`bS d]\ RWdS`aS\ ^`W[WbWdS\ 2ObS\bg^S\ [Wb 6WZTS d]\ d]`RSTW\WS`bS\ 9]\abO\bS\ O\UShSWUb eS`RS\ Yr\\S\ ?a^VaP\\ :^]bcP]cT]") 0aQTXcT] \Xc TX]VTQPdcT] :^]bcP]cT] public class Konstanten03 { public static void main(String[] args) // Ganzzahlen byte b = Byte.MAX_VALUE; short s = Short.MAX_VALUE; int z = Integer.MAX_VALUE; long l = Long.MAX_VALUE; // Reale Zahlen float f = Float.MAX_VALUE; double d = Double.MAX_VALUE; System.out.println("b = " + b); System.out.println("s = " + s); System.out.println("z = " + z); System.out.println("l = " + l); System.out.println("f = " + f); System.out.println("d = " + d); } }
{
%#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
ÎQd]V id\ ?a^VaP\\ :^]bcP]cT]" ÍPS`^`ºTS\ AWS eWS RS` 1][^WZS` `SOUWS`b eS\\ AWS dS`acQVS\ Rc`QV T]ZUS\RS HSW ZS SW\S\ ;/FD/:C3 hc É\RS`\( Float.MAX_VALUE = 15;" FP]] b^[[cT] :^]bcP]cT] TX]VTbTcic fTaST].
9]\abO\bS\ aW\R \WQVb \c` RO\\ aW\\d]ZZ SW\aSbhPO` eS\\ RS` ES`b eW`YZWQV Tº` W[ [S` Y]\abO\b Wab eWS PSW RS[ ES`b Tº` >7 a]\RS`\ OcQV eS\\ hc S`eO`bS\ Wab ROaa Ò\RS`c\US\ SW\b`SbS\ eWS PSW RS[ ES`b Tº` RS\ ;EABAObh 7\ a]ZQVS\ 4ÉZ ZS\ eW`R R`W\US\R S[^T]VZS\ \WQVb SW\S\ TSabS\ ES`b & W\ RS\ dS`aQVWSRS\S\ /\eSWac\US\ SW\S` ]RS` [SV`S`S` 9ZOaaS\ hc dS`eS\RS\ a]\RS`\ SW\S 9]\abO\bS hc RSTW\WS`S\ RO[Wb PSY][[b RS` ES`b SW\S\ `]U`O[[ RW`SYb PS\cbhb eS`RS\ =V\S ROaa d]`VS` SW\ A^SWQVS`PS`SWQV Tº` SW\S DO`WOPZS ]RS` 9]\abO\bS RSYZO`WS`b ec`RS YO\\ RS` ES`b W[ ?cSZZbSfb PS\cbhb eS`RS\ :WbS`OZS aW\R a][Wb ES`bS ]V\S 7RS\bWTWS` aWS eS`RS\ SW\TOQV a] W\ SW\S` /\eSWac\U Q]RWS`b 2S` ES`b SW\Sa :WbS`OZa S\ba^`WQVb SW\S[ SW\TOQVS\ 2ObS\bg^ ]RS` SW\S[ Ab`W\U 0SWa^WSZ Tº` SW\ :WbS`OZ W\ SW\S` ES`bShceSWac\U(
hOVZ + $)
6WS` Wab # SW\ :WbS`OZ 2S` 2ObS\bg^ SW\Sa :WbS`OZa eW`R d][ 1][^WZS` Ocb][ObWaQV TSabUSZSUb OPVÉ\UWU d]\ RS` AQV`SWPeSWaS /ZZS`RW\Ua Wab \WQVb W[[S` SW\RScbWU S` YS\\PO` d]\ eSZQVS[ Bg^ ROa :WbS`OZ Wab ROhc [ºaaS\ RWS @SUSZ\ PSYO\\b aSW\ h0 Wab "% # SW\ U[^Pc ]RS` S^dQ[TBg^- ESZQVS :WbS`OZS UWPb Sa- •
5O\hhOVZWUS ES`bS aW\R d][ Bg^ X]c
•
`]U`O[[ SW\USTºUb eW`R(
System.out.println(Integer.toBinaryString(zahl1));
ÎQd]V !) Ò\RS`\ AWS RS\ 2ObS\bg^ eOVZeSWaS W\ QhcT [^]V ]RS` bW^ac c[ hc ºPS` ^`ºTS\ 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@SUSZ\ Sa UWPb a^ShWSZZS ;SbV]RS\ Tº` RS\ /cabOcaQV d]\ 7\T]`[ObW]\S\ heWaQVS\ BV`SORa >`]U`O[[bSWZS cae C[ RWS ÍPS`aWQVb hc S`ZSWQVbS`\ eS`RS\ eW` RWS 9ZOaaS\ U`c^^WS`S\ Hc\ÉQVab YO\\ [O\ b`S\\S\ heWaQVS\ 3W\UOPSYZOaaS\ c\R /caUOPSYZOaaS\ C\R RO\\ YO\\ [O\ PgbS]`WS\bWS`bS c\R QVO`OQbS`]`WS\bWS`bS Ab`SO[a c\bS`aQVSWRS\
3W\UOPS
/caUOPS
1PbXbZ[PbbT 1PbXb\TcW^ST 1PbXbZ[PbbT
0gbS=`WS\bWS`b 7\^cAb`SO[ `SOR + X]c d]\ ## `SOR + X]c @SORS` 1VO`OQbS` d]\ $##!# =`WS\bWS`b
=cb^cbAb`SO[ E`WbS`
1PbXb\TcW^ST e`WbS + X]c d]\ ## e`WbS + X]c d]\ $##!#
0WZR $ ( `]U`O[[ BcaTP\! ZWSab 2ObS\ SW\ 7[ >`]U`O[[ [caa S\baQVWSRS\ eS`RS\ eWS RWS SW\USZSaS\S 0WbY][PW\ObW]\ W\bS`^`SbWS`b eS`RS\ a]ZZ ;Wb SW\TOQVS\ ;WbbSZ\ YO\\ RS` SW\USZSaS\S X]cES`b h0 OZa SW\ C\WQ]RSHSWQVS\ QVO`OQbS` W\bS`^`SbWS`b eS`RS\ 2WSa RS[]\ab`WS`b ROa \OQVT]ZUS\RS >`]U`O[[ ?a^VaP\\ BcaTP\") 8]cTa_aTcPcX^] STa 4X]VPQT P[b RWPa import java.io.*; public class Stream03 { public static void main(String[] args) throws Exception { InputStreamReader eingabe = new InputStreamReader(System.in); int zeichen = eingabe.read(); System.out.println((char)zeichen); } }
`]U`O[[ BcaTP\ 0WbbS bSabS\ AWS RWSaSa >`]U`O[[ , :SaS\ d]\ BhbcT\X] W\RS[ AWS SW\S HOVZ PSabSVS\R Oca SW\S` HWTTS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BcaTP\#) C2?8?ETaQX]Sd]V P[b 4X]VPQTbca^\ import java.net.*; import java.io.*; public class Stream04 { public static void main(String[] args) throws Exception { ServerSocket ss = new ServerSocket(1500); Socket s = ss.accept(); DataInputStream ein = new DataInputStream(s.getInputStream()); int zahl = ein.read(); System.out.println(zahl); } }
C[ ºPS` SW\S B1>7>:SWbc\U 2ObS\ S[^TO\US\ hc Yr\\S\ [ºaaS\ RWS PSWRS\ S`a bS\ HSWZS\ RS` \PX];SbV]RS hcaÉbhZWQV Q]RWS`b eS`RS\ 2O[Wb eW`R SW\S a] US\O\\ bS A]QYSbDS`PW\Rc\U ºPS` RS\ >]`b # OcTUSPOcb Hc[ BSabS\ RWSaS` /\eS\Rc\U TSVZb OZZS`RW\Ua OcQV \]QV SW\ AS\RS`^`]U`O[[ 2S` /\a^`cQV RWSaSa 0cQVSa Wab Sa SW\TOQVS c\R Y]\hS\b`WS`bS 0SWa^WSZS hc PWSbS\ C\R( RWSa a]ZZS\ YSW\S 1]RST`OU[S\ bS ]RS` >`]U`O[[OcaaQV\WbbS aSW\ a]\RS`\ Y][^ZSbbS OcaTºV`PO`S >`]U`O[[S 2O [Wb ROa DS`a^`SQVS\ OcQV Tº` RWSaSa B1>7>0SWa^WSZ S`TºZZb eW`R PSaQV`SWPS\ eW` W[ /\VO\U 2 eWS RWSaS YZSW\S dS`bSWZbS /\eS\Rc\U Y][^ZSbbWS`b eS`RS\ [caa c\R eWS aWS USbSabSb eS`RS\ YO\\ /[ 3\RS RWSaSa C\bS`YO^WbSZa W\ RS[ AWS ROa Ab`SO[9]\h^Sb YS\\S\ USZS`\b c\R O\VO\R dWSZS` 0SWa^WSZS Oca^`]PWS`b VOPS\ hSWUS\ eW` 7V\S\ SW\ eSWbS`Sa 0SWa^WSZ Tº` ROa :SaS\ SW\Sa 2ObS\ab`][a >`]U`O[[ BcaTP\$ 2WSa[OZ a]ZZ RS` 3W\UOPS ab`][ W[ aSZPS\ /R`Saa`Oc[ ZWSUS\ eWS ROa >`]U`O[[ aSZPab /cQV ROa Wab [Wb Ab`SO[BSQV\WYS\ [rUZWQV) Sa [caa OZa] \WQVb W[[S` SW\ 3W\ ]RS` /caUOPSUS`Éb aSW\ [Wb RS[ Y][[c\WhWS`b eW`R AWS aSVS\( /cQV W\\S`VOZP RSa /`PSWbaa^SWQVS`a a]UO` W\\S`VOZP SW\Sa /R`Saa`Oc[a SW\S` 8D; Wab RWS aTPS;SbV]RS SW\aSbhPO` ?a^VaP\\ BcaTP\$) ;TbT] TX]Tb BcaTP\b X\ bT[QT] 0SaTbbaPd\ import java.io.*; public class Stream05 { public static void main(String[] args) throws Exception String str = "Dies ist ein Text im Arbeitsspeicher"; StringReader text = new StringReader(str); int c = text.read(); System.out.print((char)c); } }
{
'!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
9ZGTJGXJ+OTMGHK 4º` ROa 3W\ZSaS\ d]\ HSWQVS\ RWS RS` 0SRWS\S` O[ 0WZRaQVW`[ SW\USbW^^b VOb UWPb Sa SW\S U`]zS DWSZTOZb c\bS`aQVWSRZWQVS` ;SbV]RS\ /ZZS VOPS\ OZa 0OaWa ROa 3W\ZSaS\ d]\ 3W\hSZhSWQVS\ R]QV UWPb Sa OcQV Y][T]`bOPZS ;SbV]RS\ RWS Tº` ROa >`]U`O[[ UO\hS HSWQVS\YSbbS\ Y][^ZSbbS HSWZS\ ]RS` bg^WaWS`bS 2ObS\ SW\ZSaS\ c\R RWSaS \OQV PSabW[[bS\ @SUSZ\ O\OZgaWS`S\ c\R Tº` RWS DS`O`PSWbc\U hc` DS`TºUc\U abSZZS\ ?a^VaP\\ 2^]b^[T ) ITXRWT]fTXbT ;TbT] e^] STa :^]b^[T SXTb\P[ \Xc 1hcTbcaTP\ d]S \Xc eTaZ¶aicT] BRWaTXQfTXbT import java.io.*; public class Console01 { public static void main(String[] args) throws Exception { int zeichen1 = System.in.read(); System.out.println(z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bWS`b A] Yr\\S\ Y][^ZSbbS HSWZS\ SW\USZSaS\ c\R WV` 7\VOZb `WQVbWU S`YO\\b eS`RS\ 2WSaS` D]`UO\U eW`R >O`aS\ ]RS` AQO\\S\ US \O\\b 0SWa^WSZaeSWaS YO\\ SW\S HSWZS \SPS\ UO\hS\ Er`bS`\ OcQV RWS 8OdOW\bS`\S\ 2ObS\bg^S\ eWS X]c ]RS` S^dQ[T S\bVOZbS\ 2WS ;SbV]RS\ RS` 9ZOaaS BRP]]Ta c\bS` aQVSWRS\ RWS SW\hSZ\S\ Er`bS` VWS` B]YS\ US\O\\b O\VO\R d]\ B`S\\hSWQVS\ RWS T`SW eÉVZPO` aW\R AbO\RO`R[ÉzWU eS`RS\ RWS SW\hSZ\S\ B]YS\ SW\S` HSWZS OPUS b`S\\b Rc`QV :SS`abSZZS\ PZO\Y ;Wb RS[ T]ZUS\RS\ 0SWa^WSZ^`]U`O[[ eW`R SW\S Y][^ZSbbS HSWZS d][ 0WZRaQVW`[ US ZSaS\ 2OPSW eW`R ROd]\ OcaUSUO\US\ ROaa RWSaS HSWZS T]ZUS\RS\ /cTPOc VOb( hc \ÉQVab eW`R SW\S PSZWSPWUS HSWQVS\T]ZUS Ab`W\U S`eO`bSb) PSS\RSb eW`R RWSaS` Ab`W\U PSW[ /cTb`SbS\ RSa B`S\\hSWQVS\a 0ZO\Y 2O\\ T]ZUb OZa \ÉQVabSa B]YS\ SW\S UO\hS HOVZ c\R ROa ZSbhbS B]YS\ W\ RWSaS` HSWZS [caa SW\S 5ZSWbY][[OhOVZ W\ eWaaS\ aQVOTbZWQVS` AQV`SWPeSWaS [Wb RS[ 0cQVabOPS\ T aSW\ ?a^VaP\\ BRP]]Ta ) 4X]VPQT e^] ch_XbXTacT] 3PcT] BcaX]V X]c d]S S^dQ[T import java.util.Scanner; public class Scanner01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); String str = eingabe.next(); // Komplettes Wort lesen int zahl1 = eingabe.nextInt(); // Ganzzahl lesen double zahl2 = eingabe.nextDouble(); // E-Format z.B. 5e3 lesen System.out.printf("%s | %d | %f", str, zahl1,zahl2); } }
'#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
ÎQd]VT] id\ ?a^VaP\\ BRP]]Ta ÎQd]V ( 3W\S Y]``SYbS 3W\UOPShSWZS aWSVb SbeO a] Oca( aaaa 4700 5e3. 9r\\S\ RWS R`SW 2ObS\ OcQV W\ XSeSWZa SW\S` SWUS\S\ HSWZS abSVS\- ÎQd]V !( EOa ^OaaWS`b eS\\ TOZaQVS 2ObS\ W[ 3W\UOPSab`][ abSVS\-
,KNRKXHKNGTJR[TM[TJ6XL[TMKT 5S\S`SZZ eW`R ROa BVS[O 4SVZS`PSVO\RZc\U W\ RWSaS[ 0cQV \WQVb PSa^`]QVS\ RS\\ RWS >`]U`O[[WS`c\U d]\ @]cbW\S\ hc` 4SVZS`PSVO\RZc\U 3fQS^bW]\VO\RZW\U S` T]`RS`b W\ 8OdO SW\WUS bWSTS`USVS\RS 9S\\b\WaaS RS` =PXSYb]`WS\bWS`c\U C\R d]` OZ ZS[ eº`RS RWS 3W\TOQVVSWb RS` >`]U`O[[S Rc`QV RWS >`]U`O[[WS`c\U RS` 4SVZS`PS VO\RZc\U ZSWRS\ c\R RS[ 3W\abSWUS` RWS ÍPS`aWQVb S`aQVeS`S\ 2S\\]QV eS`RS\ eW` [Wb RS[ \OQVT]ZUS\RS\ >`]U`O[[ SW\S Yc`hS 3W\TºV`c\U W\ RWSaSa BVS[O USPS\ 2Oa >`]U`O[[ Cah2PcRW YPeP ZWSab d]\ RS` 1]\a]ZS ROa S`abS B]YS\ SW\ c\R ^`ºTb ]P RS` SW\USUSPS\S ES`b \c[S`WaQV Wab ES\\ \WQVb eW`R SW\S 4SVZS`[SZRc\U OcaUSUSPS\ O\RS`\TOZZa eW`R ]Y OcaUSUSPS\ ?a^VaP\\ Cah2PcRW ) ;TbT] \Xc 5^a\P[_a¶Ud]V PdU ]d\TaXbRW
import java.util.Scanner; public class TryCatch01 { public static void main(String[] args) { int zahl; Scanner eingabe = new Scanner(System.in); String str = eingabe.next(); // Erstes Wort lesen try { zahl = Integer.parseInt(str); // Konvertieren in Ganzzahl } catch (NumberFormatException e) { System.out.println("Es wurde keine Ganzzahl eingegeben"); System.exit(8); } System.out.println("Der eingegebene Text ist ok"); } }
2WS 0SVO\RZc\U d]\ 4SVZS`\ S`T]ZUb W\ 8OdO [Wb 6WZTS RS` cahRPcRW/\eSWac\U 7\ \S`VOZP RSa cah0Z]QY eS`RS\ RWS TSVZS`b`ÉQVbWUS\ /\eSWac\US\ OcaUSTºV`b c\R d]\ RS[ RPcRW0Z]QY eS`RS\ SdS\bcSZZ OcTUSb`SbS\S 4SVZS` PSVO\RSZb EW` VOPS\ W\ OZ ZS\ O\RS`S\ >`]U`O[[S\ W\ RWSaS[ 0cQV OcT RWSaS /`b RS` /ca\OV[SPSVO\RZc\U dS`hWQVbSb c\R VOPS\ Rc`QV RWS 9ZOcaSZ cWa^fb 4gRT_cX^] W[ 9]^T RS` ;SbV]RS TSabUSZSUb ROaa [rUZWQVS 4SVZS` d][ :OcThSWbAgabS[ c\R \WQVb W\RWdWRcSZZ PSVO\ RSZb eS`RS\ a]ZZS\
'$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%!
BcP]SPaS4X]VPQT
ÎQd]V id\ ?a^VaP\\ Cah2PcRW Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa OcT SW\S W\RWdWRcSZZS 4SVZS`PSVO\RZc\U dS`hWQVbSb eW`R BSabS\ AWS ROa >`]U`O[[ c\R PS]POQVbS\ AWS ROa AgabS[dS`VOZbS\ EOa ^Oa aWS`b eS\\ RS` 0SRWS\S` TOZaQVS 2ObS\ SW\bW^^b- ?a^VaP\\ BRP]]Ta") ;»bd]Vbe^abRW[PV U¶a ST] ETaiXRWc PdU X]SXeXSdT[[T 5TW[TaQTWP]S[d]V import java.util.Scanner; public class Scanner03 { public static void main(String[] args) throws Exception { int zahl; Scanner eingabe = new Scanner(System.in); String str = eingabe.next(); // Erstes Wort lesen zahl = Integer.parseInt(str); // Konvertieren in Ganzzahl System.out.println("Der eingegebene Text ist ok"); } }
2WS 4SVZS`PSVO\RZc\U VOb W\ RS` >`OfWa SW\S aSV` U`]zS 0SRScbc\U c\R RWS 3[^ TSVZc\U O\ RS\ >`]U`O[[WS`S` ZOcbSb( 8SRS` RS\YPO`S 4SVZS`TOZZ [caa d][ >`] U`O[[ W\RWdWRcSZZ PSVO\RSZb eS`RS\ [Wb cahRPcRW
eTJKXTJKY*KROSOZKXJKY(KMXKT`[TMY`KOINKTY`[S'[LZXKTTKTJKX(KMXOLLK 2WS 9ZOaaS BRP]]Ta PWSbSb RS[ >`]U`O[[WS`S` RWS ;rUZWQVYSWb RS\ 2SZW[WbS` B`S\\hSWQVS\ XS \OQV AWbcObW]\ hc É\RS`\ 2Oa B`S\\hSWQVS\ Tº` SW\hSZ\S B]YS\ YO\\ Rc`QV /cT`cT RS` ;SbV]RS dbT3T[X\XcTa USÉ\RS`b eS`RS\ ASV` VÉcTWU eS`RS\ RWS SW\hSZ\S\ 0SU`WTTS RS` 3W\UOPSRObS\ Rc`QV 9][[O OPUSb`S\\b c\R ROa T]ZUS\RS >`]U`O[[ hSWUb SW\S :rac\U Tº` RWSaS /cTUOPS\abSZZc\U ?a^VaP\\ BRP]]Ta #) Ó]STa] STb 1TVaT]id]VbiTXRWT]b import java.util.Scanner; public class Scanner04 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); eingabe.useDelimiter(","); // Delimiter aendern String str = eingabe.next(); // Komplettes Wort lesen int zahl1 = eingabe.nextInt(); // Ganzzahl lesen double zahl2 = eingabe.nextDouble(); // E-Format z.B. 5e3 lesen System.out.printf("%s | %d | %f", str, zahl1,zahl2); } }
'%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
0SWa^WSZ Tº` SW\S Y]``SYbS 3W\UOPShSWZS(
Javabuch,17,3e5,
2Oa ZSbhbS 9][[O W\ RS` 3W\UOPShSWZS Wab heW\US\R \]beS\RWU a]\ab eW`R RS` 3W\ UOPSd]`UO\U RSa ZSbhbS\ B]YS\ \WQVb PSS\RSb /czS`RS[ Rº`TS\ W\ RWSaS[ aSV` SW\TOQVS\ 0SWa^WSZ YSW\S :SS`hSWQVS\ heWaQVS\ RS\ B]YS\ abSVS\ `]U`O[[ hSWUb ?a^VaP\\ ATSXaTRc ) D\[TXcT] STa BcP]SPaS0dbVPQT X] 3PcTX import java.io.*; public class Redirect01 { public static void main(String[] args) throws Exception { System.setOut(new PrintStream(new FileOutputStream("a.txt"))); System.out.println("Der Text wird umgeleitet in Datei"); } }
'XHKOZKTSOZVXOTZRT[TJVXOTZ 2Oa 3`USP\Wa SW\S` /caUOPS [Wb RS\ dS`aQVWSRS\S\ _aX]c Phe U^a\Pc;SbV]RS\ Wab W[[S` SW\ Ab`W\U Ch_XbXTacT 3PcT] eWS X]c ]RS` U[^Pc eS`RS\ d]` RS` SWUS\bZWQVS\ /caUOPS Ocb][ObWaQV W\ SW\S Ab`W\U@S^`ÉaS\bObW]\ c[USeO\RSZb ?a^VaP\\ ?aX]c ) 0dbVPQT e^] 9PeP3PcT]ch_T] PdU 2^]b^[T public class Print01 { public static void main(String args[]){ int monat = 5; float gehalt = 2123.45f; String s1 = "Im Monat "; String s2 = "haben Sie "; System.out.print(s1 + monat + " "); System.out.print(s2 + gehalt + " "); System.out.println("verdient"); } } 2S` /caUOPSab`][ YO\\ OZa] Oca SW\S` 9][PW\ObW]\ d]\ PSZWSPWUS\ 8OdO2ObS\bg^S\ PSabSVS\ 2WS ^`W[WbWdS\ 2ObS\bg^S\ eS`RS\ Ocb][ObWaQV W\ SW\S\ Ab`W\U c[USeO\ ''
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
RSZb c\R ROa >ZcaHSWQVS\ a]`Ub Tº` ROa 9]\YObS\WS`S\ TºUb OZa] RWS SW\hSZ\S\ ES` bS a] O\SW\O\RS` ROaa TX] /caUOPSab`W\U S\babSVb ES\\ SW\ /caUOPSab`][ ROUSUS\ ATUTaT]i3PcT]ch_T] S\bVÉZb a] [caa RS` >`] U`O[[WS`S` aWQVS`abSZZS\ ROaa RWS C[eO\RZc\U W\ Ab`W\U S`T]ZUb 2WSa YO\\ RORc`QV USaQVSVS\ ROaa S` SW\S ;SbV]RS c^BcaX]V ^`]U`O[[WS`b RWSaS eW`R RO\\ Ocb][O bWaQV OcTUS`cTS\ c\R OcaUSTºV`b /\RS`\TOZZa eW`R SW\S [WbUSZWSTS`bS AbO\RO`R[SbV] RS c^BcaX]V OcaUSTºV`b 2WSaSa BVS[O eW`R W\ 9O^WbSZ " RSbOWZZWS`b PSa^`]QVS\
'XHKOZKTSOZIRGYY,UXSGZZKX A]ZZ RWS /caUOPS RS` 2ObS\ W\ PSa]\RS`S` ESWaS T]`[ObWS`b S`T]ZUS\ a] a]ZZbS [Wb RS` ;SbV]RS U^a\Pc RS` 9ZOaaS 5^a\PccTa ]RS` eOVZeSWaS OcQV [Wb _aX]cU USO`PSWbSb eS`RS\ 2WSaS PSWRS\ ;SbV]RS\ PWSbS\ WRS\bWaQVS ;rUZWQVYSWbS\ hc[ 4]`[ObWS`S\ c\R /cTPS`SWbS\ RS` /caUOPS 3a Yr\\S\ h0 /\UOPS\ hc` :É\US hc[ 3W\TºUS\ d]\ TºV`S\RS\ :SS`abSZZS\ hc` `SQVba ]RS` ZW\YaPº\RWUS\ /cTPS`SWbc\U hc RS` /\ hOVZ RS` 2ShW[OZabSZZS\ c\R SW\WUSa [SV` US[OQVb eS`RS\ ?a^VaP\\ 5^a\Pc ) 6[TXcZ^\\P \Xc STa 0dbVPQT\TcW^ST U^a\Pc
public class Format01 { public static void main(String args[]) { float gehalt = 2000.00f; System.out.format("%f \n", gehalt); System.out.format("%e \n", gehalt); System.out.format("%g \n", gehalt); } } ÎQd]V id\ ?a^VaP\\ 5^a\Pc 3`aSbhS\ AWS RS\ ;SbV]RS\\O[S U^a\Pc Rc`QV _aX]cU
RWS PSWRS\ ;SbV]RS\ VOPS\ RS\ UZSWQVS\ :SWabc\Uac[TO\U Ò\RS`b ROa SbeOa O\ RS` /caUOPS- /cQV RS` ag\bOYbWaQVS /cTPOc RS` PSWRS\ ;SbV]RS\ Wab UZSWQV( format(String format, Object ... args); printf(String format, Object ... args); 3`ZÉcbS`c\US\( 0SWRS ;SbV]RS\ S`eO`bS\ heSW /`Uc[S\bS RWS Rc`QV 9][[O US b`S\\b eS`RS\ 2Oa S`abS /`Uc[S\b Wab SW\ Ab`W\U RS` 4]`[ObWS`c\UaO\UOPS\ S\bVÉZb eOVZeSWaS US[WaQVb [Wb :WbS`OZS\ 2Oa heSWbS /`Uc[S\b VOb SW\S ePaXPQ[T 0]iPW[ TSabUSZSUb Rc`QV RWS R`SW >c\YbS c\R c[TOaab RWS hc T]`[ObWS`S\RS\ =PXSYbS 2WS 4]`[ObWS`c\UaSZS[S\bS PSUW\\S\ [Wb RS[ HSWQVS\ RO\OQV [caa [W\RSabS\a SW\ HSWQVS\ abSVS\ ROa RWS /`b RS` 9]\dS`bWS`c\U O\UWPb h0
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%"
BcP]SPaS0dbVPQT
T Tº` TZ]Ob b Tº` bW[S R Tº` RSQW[OZ ]RS` a Tº` Ab`W\U
HcaÉbhZWQV Yr\\S\ OPS` OcQV /\UOPS\ hc` 5`rzS US[OQVb eS`RS\ h0
Tº` heSW AbSZZS\ VW\bS` RS[ 9][[O $ Tº` aSQVa AbSZZS\ d]` heSW AbSZZS\ VW\bS` RS[ 9][[O
7[ T]ZUS\RS\ >`]U`O[[ a]ZZ RWS 5O\hhOVZ ' W\ c\bS`aQVWSRZWQVS\ DO`WO\bS\ O[ 0WZRaQVW`[ OcaUSUSPS\ eS`RS\ OZa 2ShW[OZhOVZ OZa =YbOZhOVZ c\R heSW[OZ OZa 6S fORShW[OZhOVZ XSeSWZa USb`S\\b Rc`QV AQV`ÉUab`WQV ?a^VaP\\ 5^a\Pc!) 6P]iiPW[ \Xc STa 0dbVPQT\TcW^ST U^a\Pc
import java.io.*; public class Format02 { public static void main(String args[]) { int zahl = 90; System.out.format("%1$d / %ZObbS\ ]RS` 2D22ObSWS\ SW\USaSbhb /ZZS`RW\Ua UWPb Sa SW\S U`]zS 4ºZZS d]\ 9ZOaaS\ RWS XSeSWZa a^ShWOZWaWS`b aW\R c\R Tº` S`UÉ\hS\RS /cTUOPS\ WV`S 2WS\abS O\ PWSbS\ 2Oa /`PSWbS\ [Wb RWSaS\ 9ZOaaS\ Wab d]ZZ ]PXSYb]`WS\bWS`b 2SaeSUS\ \]QV SW\[OZ RS` 6W\eSWa( 3a TSVZS\ O\ RWSaS` AbSZZS \]QV SW\WUS D]`OcaaSbhc\US\ c[ OZZS 1]RWS`bSQV\WYS\ RS` T]ZUS\RS\ 0SWa^WSZS hc dS`abSVS\ B`]bhRS[ e]ZZS\ eW` RS []\ab`WS`S\ eWS 2ObS\ OcT SW\S\ SfbS`\S\ A^SWQVS` h0 W\ SW\S ;OU\Sb^ZObbS\RObSW USaQV`WSPS\ [O\ aOUb( ^S`aWabS\b US[OQVb eS`RS\ c\R eWS RWSaS O\aQVZWSzS\R eWSRS` USZSaS\ eS`RS\ Yr\\S\ 2Oa 9O^WbSZ YO\\ OZa] d][ 3W\abSWUS` hc\ÉQVab º PS`TZ]US\ c\R a^ÉbS` PSW 0SRO`T \OQVUSO`PSWbSb eS`RS\ 2WSaS` /PaQV\Wbb S\bVÉZb R`SW BVS[S\PS`SWQVS( •
2WS PSWRS\ >`]U`O[[S 3PcTX c\R 3PcTX! RS[]\ab`WS`S\ ROa AQV`SWPS\ c\R :SaS\ d]\ 2ObSWS\ [Wb 6WZTS d]\ Ab`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BSfbS W\ RWS 2ObSW cTbc SPc OcaUSPS\ ?a^VaP\\ 3PcTX ) BRWaTXQT] e^] ch_XbXTacT] EPaXPQ[T] X] TX]T 3PcTX
import java.io.*; public class Datei01 { public static void main(String[] args) throws Exception { OutputStream aus = new FileOutputStream("test1.dat"); DataOutput datenAus = new DataOutputStream(aus);
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%#
3PcTXeTaPaQTXcd]V
datenAus.writeInt(4700); datenAus.writeUTF("Merker"); datenAus.writeUTF("Steinfurt"); } } 2Oa >`]U`O[[ 3PcTX PS\cbhb RWS 9ZOaaS 3PcP>dc_dcBcaTP\ 2WSaS S\bVÉZb Tº` OZZS SW\USPOcbS\ 8OdO2ObS\bg^S\ SWUS\S /caUOPS[SbV]RS\ h0 Tº` 5O\hhOVZS\ RWS ;SbV]RS faXcT8]c /czS`RS[ Yr\\S\ C\WQ]RSHSWQVS\ SW\hSZ\ [Wb faXcT2WPa ]RS` OZa Ab`W\U [Wb faXcT2WPab OcaUSUSPS\ eS`RS\ 2OPSW PSZSUb XSRSa HSWQVS\ heSW 0gbSa W\ RS` /caUOPSRObSW FPb QTSTdcTc DC5. 7[ >`]U`O[[ 3PcTX PS\cbhS\ eW` RWS ;SbV]RS faXcTDC5 Tº` RWS Ab`W\U/caUOPS c\R RWS VOb SW\S 0Sa]\RS`VSWb( C[ W\ RS` /caUOPSRObSW >ZObh hc a^O`S\ eW`R XSRSa C\WQ]RShSWQVS\ \OQV PSabW[[bS\ DS`TOV`S\ b`O\aT]`[WS`b PSd]` Sa W\ RS\ /caUOPS ab`][ USaQV`WSPS\ eW`R 2OPSW USZbS\ T]ZUS\RS B`O\aT]`[ObW]\a`SUSZ\( •
HSWQVS\ W[ 0S`SWQV Jc Jc%T PS\rbWUS\ 0gbS
•
HSWQVS\ W[ 0S`SWQV Jc& Jc%TT PS\rbWUS\ 0gbSa
•
HSWQVS\ W[ 0S`SWQV Jc& JcTTTT PS\rbWUS\ ! 0gbSa
/\R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X]Ta 3PcTX
import java.io.*; public class Datei02 { public static void main(String[] args) throws Exception { InputStream ein = new FileInputStream("test1.dat"); DataInput datenEin = new DataInputStream(ein); int plz = datenEin.readInt(); String kdname = datenEin.readUTF(); String ort = datenEin.readUTF(); System.out.println(plz + " " + kdname + " " + ort); } } ÎQd]VT] id\ ?a^VaP\\ 3PcTX! ÎQd]V ( Ò\RS`\ AWS hc\ÉQVab ROa AQV`SWP>`]U`O[[ 3PcTX YPeP a] OP ROaa SW\S heSWbS /R`SaaS W\ RWS 2ObSW USaQV`WSPS\ eW`R ÎQd]V !( 2O\OQV a]ZZ OcQV ROa :SaS>`]U`O[[ 3PcTX!YPeP a] USÉ\RS`b eS`RS\ ROaa RWSaS heSWbS /R`SaaS SW\USZSaS\ c\R O\UShSWUb eW`R
;TOIUJK[TJJOK[TZKXYINOKJROINK/TZKXVXKZGZOUT\UT(OZQUSHOTGZOUTKT 2S` C\WQ]RS Wab SW\ @SUSZeS`Y eWS XSRS[ HSWQVS\ RWSaS` ESZb SW\ \c[S`WaQVS` ES`b SW\S >ZObh\c[[S` hcUS]`R\Sb eW`R 2WSaS >ZObh\c[[S` eW`R 1]RS^]W\b US \O\\b 2WS `SOZ SfWabWS`S\RS\ 0Sb`WSPaagabS[S 3W\/caUOPSUS`ÉbS c\R >`]U`O[ [WS`a^`OQVS\ O`PSWbS\ XSR]QV \]QV \WQVb d]ZZabÉ\RWU [Wb RS[ C\WQ]RS 7\ dWSZS\ 0S `SWQVS\ UWZb \OQV eWS d]` RWS &0Wb1]RWS`c\U 2Oa PSRScbSb ROaa RS` /cabOcaQV d]\ 2ObS\ heWaQVS\ dS`aQVWSRS\S\ >ZObbT]`[S\ W\ RS` >`OfWa \]QV Tº` ZÉ\US`S HSWb SW\ VSWYZSa BVS[O PZSWPS\ eW`R "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%#
3PcTXeTaPaQTXcd]V
FPad\ Xbc SPb 4]R^SX]V TX] fXRWcXVTb CWT\P.
=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ATPSTa c\R FaXcT` W\ HcaO[ [S\O`PSWb [Wb RS\ PgbS]`WS\bWS`bS\ Ab`SO[YZOaaS\ •
SW\ SW\hSZ\S` 2ShW[OZeS`b W\ SW\S` 2ObSW USa^SWQVS`b eW`R :^]eTac YPeP
•
RWSaS HOVZ OZa dWS` 3W\hSZhSWQVS\ W\bS`^`SbWS`b c\R OZa CB4&CB4$2ObS\ Y]\ dS`bWS`b W\ SW\S` 2ObSW USa^SWQVS`b eS`RS\ YO\\ :^]eTac!YPeP
•
RWSaS C\WQ]RS2ObSW eWSRS` hc`ºQY W\ SW\S /A1772ObSW c[USabSZZb eS`RS\ YO\\ :^]eTac"YPeP c\R eWS hc[ AQVZcaa
•
RWS dWS` /A177HSWQVS\ eWSRS` OZa RWS 2ShW[OZhOVZ W\bS`^`SbWS`b eS`RS\ RWS aWS c`a^`º\UZWQV RO`USabSZZb VOPS\ :^]eTac#YPeP
?a^VaP\\ :^]eTac ) 4abcT[[T] STa 0dbVP]VbSPcTX BcaTP\ cgc import java.io.*; public class Konvert01 { public static void main(String[] args) throws Exception { OutputStream aus = new FileOutputStream("Stream01.txt"); DataOutput ausgabe = new DataOutputStream(aus); ausgabe.writeInt(174); } } 2WS ;SbV]RS faXcT8]c Q]RWS`b RWS 2ShW[OZhOVZ %" OZa `SW\S PW\É`S HOVZ c\R aQV`SWPb aWS W\ RWS 2ObSW BcaTP\ cgc 7\ 8OdO aW\R X]cBg^S\ W[[S` " 0gbSa ZO\U RWSaS ! PWba VOPS\ RWS AbSZZS\eS`bWUYSWb RSa 0W\É`agabS[a /Za] VOb RWS 2ObSW T]Z US\RS\ 7\VOZb( PW\É`( VSfORShW[OZ OcaUSR`ºQYb(
00 00 00 AE #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
2WSaS` 7\VOZb YO\\ OcQV OZa SW\S 4]ZUS d]\ " SW\hSZ\S\ 0gbSa W\bS`^`SbWS`b eS`RS\ 2Oa ZSbhbS 0gbS S\bVÉZb f/3 VSfORShW[OZ /3 ROa Wab SW\ ES`b RS` XS\aSWba RS` /A 177AbO\RO`R1]RWS`c\U d]\ %4 ZWSUb C\R eW` eWaaS\( OZZS HSWQVS\ RWS ]PS`VOZP d]\ f%4 ZWSUS\ aW\R W\ /A177 \WQVb abO\RO`RWaWS`b 6WS` Wab S\baQVSWRS\R [Wb eSZ QVS[ 1VO`OQbS`aSb USO`PSWbSb eW`R /cT RS` ;AEW\R]ea>ZObbT]`[ eW`R PSW RS` 7\ abOZZObW]\ SW\ AbO\RO`R1VO`OQbS`aSb OPVÉ\UWU d][ :É\RS`aQVZºaaSZ TSabUSZSUb 2WSa Wab W\ ESabSc`]^O RS` 1VO`OQbS`aSb 1> # :SWRS` VOb RWS 2=A0]f c\bS` ;A EW\R]ea SW\S ROd]\ OPeSWQVS\RS 1]RWS`c\U \É[ZWQV 1> 7[ /\VO\U 1 aW\R PSWRS HSWQVS\Q]RWS`c\US\ hcaO[[S\ [Wb RS[ C\WQ]RS OcTUS TºV`b 4º` RWS VSfDS`aQVZºaaSZc\U /3 TW\RS\ eW` R]`b T]ZUS\RS HSWZS: Codepoint: UnicodeZeichen/Text: %" f/3 { @357AB3@32 A75<
CP-1252: ®
CP-850: «
7[ C\WQ]RS c\R W[ ;AEW\R]eaAbO\RO`R eW`R RS` 2ShW[OZeS`b %" OZa] OZa `S UWabS`SR `SUWab`WS`bSa HSWQVS\ W\bS`^`SbWS`b) W\ SW\S` 2=A0]f ROUSUS\ eW`R RS` R]^^SZbS >TSWZ OcaUSUSPS\ ÎQd]V id\ ?a^VaP\\ :^]eTac 0WbbS ºPS`^`ºTS\ AWS eWS RS` 7\VOZb RS` 2ObSW BcaTP\ cgc W\ • •
SW\S` 2=A0]f [Wb RS[ 2=A1][[O\R bg^S RObSW\O[S c\R eWS RS` 7\VOZb W\ SW\S[ 3RWb]` h0 ;A3RWb]` ]RS` ;AE]`R
O\UShSWU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aPaQTXcd]V
]RS` RS` :WbbZS3\RWO\DO`WO\bS S\ba^`WQVb 2O`ºPS` VW\Oca UWPb Sa \]QV heSW DO`WO\ bS\ d]\ CB4$ RWS aWQV OcQV [Wb RWSaS[ Tº` RWS >]`bOPWZWbÉb RS` 2ObS\ a] eWQVbWUS\ BVS[O PSaQVÉTbWUS\ \É[ZWQV CB4$03 03 Tº` 0WU 3\RWO\ RV ROa VrVS`eS`bWUS 0gbS hcS`ab c\R CB4$:3 :3 Tº` :WbbZS 3\RWO\ RV ROa \WSRS`eS`bWUS 0gbS hcS`ab 2WS 3\Q]RW\UBOPSZZS YO\\ PSW RS` 3`hScUc\U SW\Sa 8]_dcBcaTP\ATPSTa=PXSYba Phe SW\Sa >dc_dcBcaTP\FaXcTa=PXSYbSa O\USUSPS\ eS`RS\ ES\\ RWS /\UOPS TSVZb eW`R [Wb SW\S` AbO\RO`RBOPSZZS RWS Ocb][ObWaQV PSW RS` 8OdO7\abOZZObW]\ TSab USZSUb eW`R USO`PSWbSb ?a^VaP\\ :^]eTac!) EXTa 1hcTb P[b eXTa D]XR^STiTXRWT] T]R^SXTaT]
import java.io.*; public class Konvert02 { public static void main(String[] args) throws Exception { BufferedReader eingabe = new BufferedReader( new InputStreamReader(new FileInputStream( "Stream01.txt"), "CP1252")); BufferedWriter ausgabe = new BufferedWriter( new OutputStreamWriter(new FileOutputStream( "Stream02.txt"), "UTF-16")); int zeichen = eingabe.read(); ausgabe.write(zeichen); zeichen = eingabe.read(); ausgabe.write(zeichen); zeichen = eingabe.read(); ausgabe.write(zeichen); zeichen = eingabe.read(); System.out.println((char)zeichen); ausgabe.close(); } } 7\ RS[ >`]U`O[[ :^]eTac! a]`US\ RWS 0`ºQYS\YZOaaS\ 8]_dcBcaTP\ATPSTa Phe >dc_dcBcaTP\ATPSTa Tº` ROa 3\Q]RW\U d]\ &PWb/A177 \OQV CB4$ C\WQ]RS 2Oa 3`USP\Wa RWSaS` 9]\dS`bWS`c\U abSVb W\ RS` 2ObSW BcaTP\!cgc 2WSaS 2ObSW Wab W\aUS aO[b 0gbSa U`]z \SPS\ RS\ 0gbSa XS HSWQVS\ S\bVÉZb aWS OcQV SW\ AbScS`hSW QVS\ ÎQd]VT] id\
?a^VaP\\ :^]eTac! ÎQd]V ( 0WbbS SRWbWS`S\ AWS RWS 2ObSW BcaTP\!cgc [Wb SW\S[ ;AEW\R]ea3RWb]` h0 3RWb]` ]RS` ;AE]`R /\UShSWUb eW`R ROa @SUWabS`hSWQVS\ ZOcb 1VO`OQbS`aSb CB4$ %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
ÎQd]V !( 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa ROa dWS`bS USZSaS\S HSWQVS\ O[ 0WZRaQVW`[ OcaUSUSPS\ eW`R [Wb T]ZUS\RS[ 0STSVZ(
ausgabe.write((char)zeichen);
2Oa 3`USP\Wa RWSaS` /caUOPS Wab RS` R]^^SZbS >TSWZ ZOcb 1VO`OQbS`aSb 1> ÎQd]V "( >`ºTS\ AWS eWS aWQV RS` 2ObSWW\VOZb RS` /caUOPSRObSW dS`É\RS`b eS\\ AWS Tº` RWS /caUOPS abObb CB4$ RS\ 1VO`OQbS`aSb CB4& PS\cbhS\ ÎQd]V #( ;caa Tº` RWS 3W\UOPSRObSW RS` 1VO`OQbS`aSb 1> # heW\US\R O\USUSPS\ eS`RS\ ]RS` Wab RWSa RWS AbO\RO`RO\\OV[S- 9O\\ OZa] RWS /\UOPS S\bTOZZS\- 2Oa \ÉQVabS >`]U`O[[ eW`R RS\ 7\VOZb RS` 2ObSW BcaTP\!cgc OZa dWS` C\WQ]RS HSWQVS\ W\bS`^`SbWS`S\ c\R RWSaS eWSRS` hc`ºQYTºV`S\ W\ /A1772ObS\ ?a^VaP\\ :^]eTac") 4X][TbT] e^] # D]XR^STiTXRWT] d]S X] 0B288 d\fP] ST[] import java.io.*; public class Konvert03 { public static void main(String[] args) throws Exception { BufferedReader eingabe = new BufferedReader( new InputStreamReader(new FileInputStream( "Stream02.txt"), "UTF-16")); BufferedWriter ausgabe = new BufferedWriter( new OutputStreamWriter(new FileOutputStream( "Stream03.txt"), "8859_1")); int zeichen = eingabe.read(); ausgabe.write(zeichen); zeichen = eingabe.read(); ausgabe.write(zeichen); zeichen = eingabe.read(); ausgabe.write(zeichen); zeichen = eingabe.read(); ausgabe.write(zeichen); ausgabe.close(); } } 2Oa 3`USP\Wa \OQV /caTºV`c\U RSa >`]U`O[[a :^]eTac" abSVb W\ RS` 2ObSW BcaTP\"cgc /ca RS\ 0gbSa RS` 3W\UOPSRObSW ec`RS\ eWSRS` RWS " 0gbSa RWS OcQV aQV]\ RWS 2ObSW BcaTP\ cgc VObbS 8Sbhb Yr\\bS\ eW` W\ SW\S[ eSWbS`S\ >`]U`O[[ RWSaS " 0gbSa OZa 7\bSUS`eS`b W\bS` ^`SbWS`S\ c\R O[ 0WZRaQVW`[ OZa 2ShW[OZhOVZ %" OcaUSPS\(
&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%#
3PcTXeTaPaQTXcd]V
?a^VaP\\ :^]eTac#) 8]cTa_aTcXTaT] e^] # 0B2881hcTb P[b 8]cTVTafTac import java.io.*; public class Konvert04 { public static void main(String[] args) throws Exception { InputStream ein = new FileInputStream("Stream03.txt"); DataInput eingabe = new DataInputStream(ein); int zeichen = eingabe.readInt(); System.out.println(zeichen); } }
(KOYVOKRVXUMXGSSKLX+TIUJOTM[TJ)NGXGIZKXYKZ Hc` DS`bWSTc\U RWSaSa BVS[Oa T]ZUS\ \]QV heSW 0SWa^WSZS RWS hSWUS\ a]ZZS\ eWS eWQVbWU RS` `WQVbWUS 3W\aObh RSa 3\Q]RW\U;SQVO\Wa[ca Wab 2Oa S`abS 0SWa^WSZ UWPb SW\S\ BSfb Oca ]V\S PSa]\RS`S 6W\eSWaS hc SW\S[ 3\Q] RW\U) W[ heSWbS\ 0SWa^WSZ eW`R SW\ W\RWdWRcSZZSa 3\Q]RW\U Sf^ZWhWb O\USUSPS\ ?a^VaP\\ 4]R^ST ) 0aQTXcT] \Xc BcP]SPaS4]R^SX]V import java.io.*; public class Encode01 { public static void main(String[] args) throws Exception { Writer writer = new FileWriter("ausgabe.txt"); writer.write("Java\u1234"); writer.close(); } } `]U`O[[a S\bVÉZb RWS /caUOPSRObSW # 0gbSa ]Pe]VZ ROa ZSbhbS HSWQVS\ SW\ C\WQ]RSHSWQVS\ Wab !" Wab RS` 1]RS^c\Yb Tº` ROa >`][WZZS HSWQVS\ 2WS 2ObSW S\bVÉZb O\ RWSaS` AbSZZS SW\ - 4`OUShSWQVS\ c\R ROa Wab ROa AbO\RO`RhSWQVS\ Tº` OZZS C\WQ]RSeS`bS RWS \WQVb W[ /A1771]RS S\bVOZbS\ aW\R 2WS Y]``SYbS /caUOPS d]\ C\WQ]RSHSWQVS\ RWS \WQVb W[ 0S`SWQV RS` & /A177 HSWQVS\ ZWSUS\ S`T]`RS`b RWS OcaR`ºQYZWQVS /\UOPS SW\S` 3\Q]RW\UBOPSZZS HcaÉbh ZWQV [caa RWS /caUOPSYZOaaS USÉ\RS`b eS`RS\ 2Oa \OQVT]ZUS\RS >`]U`O[[ RS []\ab`WS`b eWS PSZWSPWUS C\WQ]RShSWQVS\ W\ SW\S 2ObSW OcaUSUSPS\ eS`RS\ Yr\\S\ ?a^VaP\\ 4]R^ST!) 0aQTXcT] \Xc X]SXeXSdT[[T\ 4]R^SX]VBRWT\P SdaRW 0]VPQT STb 2WPaPRcTabTcb import java.io.*; public class Encode02 { public static void main(String[] args) throws Exception { FileOutputStream fos = new FileOutputStream("aus.txt"); '
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
Writer writer = new OutputStreamWriter(fos, "UTF-8"); writer.write("testing\u2030"); writer.close(); } }
:[PbbT >dc_dcBcaTP\FaXcTa 2Oa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U) abSVS\ R]`b a] VO\RSZb Sa aWQV c[ ROa 0gbS SW\S` $0Wb2O`abSZZc\U cae 2WS T]ZUS\RS BOPSZZS dS`RScbZWQVb RWSaS DS`aQVZºaaSZc\U
C\WQ]RS
eW`R b`O\a T]`[WS`b W\ CB4&
STiX\P[Ta FTac
4abcTb 1hcTb
0]iPW[ 1hcTb
%
fffffff
& "&
fffff
ffff
!
$##!#!%
fff
"
cae
"&$##!#
/PP $!( C[T]`[c\U d]\ C\WQ]RS \OQV AbO\RO`RCB4&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
@[YGSSKTLGYY[TM 2WS 7\^cb=cb^cb;rUZWQVYSWbS\ W\ 8OdO aW\R aSV` c[TOaaS\R OPS` \WQVb c\PSRW\Ub W\bcWbWd dS`abÉ\RZWQV C[ ROa 5SaO[bY]\hS^b `WQVbWU hc dS`abSVS\ Wab dWSZ 3`TOV`c\U W\ ]PXSYb]`WS\bWS`bS` >`]U`O[[WS`c\U S`T]`RS`ZWQV 8SRS RS` [SV` OZa # 9ZOaaS\ RWS aWQV [Wb RWSaS[ BVS[O PSTOaaS\ S`TºZZb SW\S a^S hWSZZS /cTUOPS c\R [O\QVSa >`]U`O[[WS`^`]PZS[ ZÉaab aWQV \c` Rc`QV ROa HcaO[ [S\a^WSZ d]\ [SV`S`S\ Ab`SO[YZOaaS\ ZraS\ A] aW\R RWSaS 9ZOaaS\ SW\S`aSWba aSV` abO`Y ºPS` DS`S`Pc\UabSQV\WYS\ [WbSW\O\RS` dS`Pc\RS\ O\RS`S`aSWba Yr\\S\ aWS aWQV USUS\aSWbWU PS\cbhS\ c\R OcQV SW\S DS`Y\º^Tc\U ºPS` 9]\ab`cYb]`S\ Wab [rU ZWQV EW` Yr\\S\ O\ RWSaS` AbSZZS \c` SW\S U`c\RaÉbhZWQVS 3W\TºV`c\U W\ ROa USaO[bS 7= 9]\hS^b USPS\ BcaT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 8OdO?cSZZbSfb PSabSVb SW\ /caR`cQY Oca >_TaP]ST] ROa Yr\\S\ DO`WOPZS\ 9]\abO\bS\ ]RS` :WbS`OZS aSW\ RWS Rc`QV >_TaPc^aT] h0 ]RS` dS`Y\º^Tb eS`RS\ 6WS` SW\WUS 0SWa^WSZS Tº` /caR`ºQYS(
zahl = 25 a + 5 / b a > 3
HceSWac\UaOcaR`cQY ;ObVS[ObWaQVS` /caR`cQY DS`UZSWQVaOcaR`cQY
3W\ /caR`cQY Wab YSW\ aSZPababÉ\RWUS` 0STSVZ a]\RS`\ BSWZ SW\S` /\eSWac\U 2WS ]PW US\ 0SWa^WSZOcaR`ºQYS Yr\\S\ S\beSRS` Rc`QV /\VÉ\US\ SW\Sa AS[WY]Z]\a hc SW\S` d]ZZabÉ\RWUS\ /\eSWac\U US[OQVb eS`RS\ ]RS` aWS Yr\\S\ W\\S`VOZP d]\ O\RS`S\ /\eSWac\US\ PS\cbhb eS`RS\ /cQV VWS`hc SW\WUS 0SWa^WSZS(
zahl = 25; System.out.println(a+ 5 / b); boolean b = a > 3;
HceSWac\UaO\eSWac\U /caR`cQY OZa ;SbV]RS\^O`O[SbS` /caR`cQY OZa BSWZ RS` HceSWac\U
3W\ /caR`cQY YO\\ ºPS`OZZ RO abSVS\ e] SW\ ES`b PS\rbWUb eW`R 3` YO\\ OcQV Oca \c` SW\S[ =^S`O\RS\ PSabSVS\ W[ SW\TOQVabS\ 4OZZ Oca SW\S` DO`WOPZS\ ]RS` Oca SW\S[ :WbS`OZ 2Oa Wab RSaeSUS\ eWQVbWU hc S`eÉV\S\ eSWZ ºPS`OZZ RO e] ZOcb Ag\ bOfPSaQV`SWPc\U SW\ /caR`cQY S`eO`bSb eW`R OcQV SW\S SW\hWUS DO`WOPZS ]RS` SW\ :W bS`OZ abSVS\ RO`T 2Oa 3`USP\Wa SW\Sa /caR`cQYa RS` \c` Oca SW\S` DO`WOPZS\ PSabSVb Wab OZa] RS` ES`b RWSaS` DO`WOP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RZc\UaTSVZS` 3W\ /caR`cQY YO\\ [SV`S`S =^S`O\RS\ VOPS\ RWS RO\\ dS`Y\º^Tb eS`RS\ Rc`QV =^S`Ob]`S\ A] S\babSVb SW\ Y][^ZSfS` /caR`cQY ?a^VaP\\ 0dbSadRZ ) 1TXb_XT[ U¶a TX]T] Z^\_[TgT] 0dbSadRZ
class Ausdruck01 i public static void main(String[] args) { double gehalt = 2000; gehalt = gehalt * 1.15 - 8; System.out.println("Das neue Gehalt ist: " + gehalt); } } 6W\eSWa( 7\ RS` S`abS\ HSWZS TSVZb RS` ;]RWTWS` _dQ[XR ROa PSRScbSb ROaa RS` HcU`WTT OcT RWSaS 9ZOaaS PSU`S\hb Wab OcT ROa >OQYOUS eSWbS`S 3`ZÉcbS`c\US\ aWSVS $%! 2WS HSWZS " S\bVÉZb SW\S\ hcaO[[S\USaSbhbS\ /caR`cQY 3` PSabSVb Oca =^S`O\RS\ c\R Oca =^S`Ob]`S\ 2WS =^S`Ob]`S\ aW\R RWS PSWRS\ Ag[P]ZS c\R 2WS =^S`O\ RS\ aW\R VTWP[c $ c\R ' 3W\ >_TaPc^a Wab SW\ a^ShWSZZSa Ag[P]Z ]RS` SW\S 9][PW\ObW]\ d]\ [SV`S`S\ Ag[P]ZS\ ROa SW\S PSabW[[bS /YbW]\ dS`O\ZOaab h0 SW\S /RRWbW]\ Rc`QV ROa >ZcahSWQVS\ ]RS` SW\ DS`UZSWQV d]\ ES`bS\ Rc`QV 5`rzS` ]RS` 9ZSW\S`hSWQVS\ , * fPb a]ZZ USbO\ eS`RS\- 3W\ >_TaP]S Wab SW\S DO`WOPZS SW\S 9]\abO\bS ]RS` SW\ :WbS`OZ [Wb RS[ USO`PSWbSb eW`R f^\Xc a]ZZ SbeOa US[OQVb eS`RS\- 4X] 0dbSadRZ WPc TX]T] 3PcT]ch_
3W\ /caR`cQY VOb W[[S` SW\S\ 2ObS\bg^ c\R ROa Wab RS` 2ObS\bg^ RSa 3`USP\WaaSa C\R RWSaS` eW`R PSabW[[b d][ Bg^ RS` SW\hSZ\S\ =^S`O\RS\ 0SWa^WSZ(
# %
6WS` Wab RS` 4OZZ YZO` 2S` 2ObS\bg^ RWSaSa /caR`cQYa Wab X]c 7\bSUS` eSWZ PSWRS = ^S`O\RS\ d][ Bg^ X]c aW\R 3beOa Y][^ZSfS` aW\R RWS @SUSZ\ eS\\ RWS SW\hSZ\S\ =^S`O\RS\ c\bS`aQVWSRZWQVS 2ObS\bg^S\ VOPS\ 2O\\ eS`RS\ aWS UZSWQV\O[WU US [OQVb ROhc a^ÉbS` [SV` 0dbSa¶RZT \Xc =TQT]TUUTZc 7\ /ca\OV[STÉZZS\ YO\\ Sa aSW\ ROaa SW\ /caR`cQY \WQVb \c` SW\S\ \ScS\ ES`b S` [WbbSZb RS` RO\\ eSWbS` dS`O`PSWbSb eW`R a]\RS`\ ROaa UZSWQVhSWbWU OcQV RS` ES`b SW \Sa RS` =^S`O\RS\ W[ A^SWQVS` dS`É\RS`b eW`R h0 PSW[ 7\Y`S[S\b P* 2WSaS "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&
>_TaP]ST] d]S >_TaPc^aT]
/\eSWac\U S\bVÉZb RS\ /caR`cQY P 2WS EW`Yc\U RSa /caR`cQYa PSabSVb RO`W\ ROaa RS` ES`b RS` DO`WOPZS\ O c[ S`VrVb eW`R 5ZSWQVhSWbWU VOb S` RS\ <SPS\ST TSYb ROaa RWSaS` \Sc S`[WbbSZbS ES`b OcQV RS` DO`WOPZS\ O hcUSeWSaS\ eW`R 7\ a]Z QVS\ 4ÉZZS\ a^`WQVb [O\ d]\ SW\S[ /caR`cQY [Wb <SPS\STTSYb =Pe]VZ RS` 0SU`WTT <SPS\STTSYb W\ RS` 7\T]`[ObWY VÉcTWU dS`Pc\RS\ Wab [Wb RS` D]`abSZZc\U d]\ c\S` eº\aQVbS\ <SPS\eW`Yc\US\ PSW RS` DS`O`PSWbc\U d]\ DO`WOPZS\ Wab W\ RWSaS[ 4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 ÎQd]V id\ ?a^VaP\\ 0dbSadRZ 4ºUS\ AWS W\ RS\ /caR`cQY RS` HSWZS " RWS `c\RS\ 9ZO[[S`\ SW\ DS`UZSWQVS\ AWS ROa 3`USP\Wa BSabS\ AWS RO\OQV O\RS`S DO`WO\bS\ RS` 9ZO[[S`\aSbhc\U EWS eWQVbWU ROa ASbhS\ d]\ 9ZO[[S`\ aSW\ YO\\ RS[]\ab`WS`b ROa T]ZUS\RS >`] U`O[[ 2c`QV RWS 9ZO[[S`c\U RS` ;cZbW^ZWYObW]\ eW`R RWSaS` @SQVS\d]`UO\U hcS`ab OcaUSTºV`b PSd]` RO\\ ROa 3`USP\Wa W\ SW\S\ X]cBg^ Y]\dS`bWS`b eW`R ?a^VaP\\ 0dbSadRZ!) :[P\\Ta] eTaÊ]STa] SXT 0dbfTacd]VbaTXWT]U^[VT
class Ausdruck02 { public static void main(String[] args) { // int z1 = (int)1.23 * 100; // Zuerst 1.23 in int konvertieren int z1 = (int) (123 * 100); // Zuerst multiplizieren System.out.println(z1); } }
#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
'XOZNSKZOYINK5VKXGZUXKT
*OK-X[TJXKINKTGXZKT 3a UWPb Tº` RWS dWS` 5`c\R`SQVS\O`bS\ XSeSWZa SW\S\ =^S`Ob]`( 2WS =^S`O\RS\ [ºaaS\ \c[S`WaQVS Bg^S\ aSW\ Hc RS\ \c[S`WaQVS\ 2ObS\bg^S\ USVr`S\ OZZS ^`W [WbWdS\ Bg^S\ [Wb SW\S` /ca\OV[S( 0]]ZSO\Bg^S\ aW\R \WQVb \c[S`WaQV [Wb WV\S\ YO\\ [O\ \WQVb `SQV\S\ ?a^VaP\\ 0aXcW\TcXZ ) 1TXb_XT[ U¶a SXT eXTa 6ad]SaTRWT]PacT]
class Arithmetik01 { public static void main(String[] args) { float a = 25.7f; float b = 5f; short x = 212; int y = 148; System.out.println("x System.out.println("x System.out.println("x System.out.println("a
+ / /
y y y b
= = = =
" " " "
+ + + +
(x (x (x (a
+ / /
y)); y)); y)); b));
} } ÎQd]VT] id\ ?a^VaP\\ 0aXcW\TcXZ ÎQd]V ( AbO`bS\ AWS ROa >`]U`O[[ c\R ºPS`^`ºTS\ AWS RWS 3`USP\WaaS 7ab ROa ZSbhbS 3`USP\Wa Y]``SYb- EOV`aQVSW\ZWQV eW`R SW\ >`]U`O[[WS`O\TÉ\US` hcaO[[S\hcQYS\( 9r\\S\ 1][^cbS` \WQVb `SQV\S\- EW` eS`RS\ C`aOQVS c\R :rac\U RWSaSa >VÉ\] [S\a a^ÉbS` PSa^`SQVS\ ÎQd]V !) 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa RWS dWS` DO`WOPZS\ O P f c\R g \SUObWdS 7\WbWOZeS`bS VOPS\ h0 ÍPS`^`ºTS\ AWS RWS 3`USP\WaaS <SPS\ RS\ dWS` 5`c\R`SQVS\O`bS\ UWPb Sa \]QV SW\S\ hcaÉbhZWQVS\ O`WbV[SbWaQVS\ =^S`Ob]`( >`]hS\bhSWQVS\ 2WSaS` eW`R OcQV ;]RcZ] ]RS` @Sab=^S`Ob]` US \O\\b ;O\ YO\\ RORc`QV RS\ @Sab SW\S` 2WdWaW]\ S`[WbbSZ\ 0SWa^WSZ( 2S` UO\hhOVZW US @Sab RS` 2WdWaW]\ # USbSWZb Rc`QV ! Wab ?a^VaP\\ 0aXcW\TcXZ!) 0]fT]Sd]V STb _TaPc^ab
class Arithmetik02 { public static void main(String[] args) { int y = 15; System.out.println(y % 4); } } $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&!
0aXcW\TcXbRWT >_TaPc^aT]
ATRW]T] \Xc QhcT ^STa RWPa3PcT]ch_T] 3beOa c\USerV\ZWQV Wab aWQVS`ZWQV ROaa OcQV [Wb DO`WOPZS\ RS` 2ObS\bg^S\ QhcT ]RS` RWPa US`SQV\Sb eS`RS\ YO\\ BSQV\WaQV Wab RWSa YSW\S 0Sa]\RS`VSWb RS\\ OcQV RWS aS 2ObS\ eS`RS\ PW\É` RO`USabSZZb c\R heO` OPVÉ\UWU d]\ RS` >]aWbW]\ RSa HSWQVS\a W[ C\WQ]RS /cQV eS\\ Sa eOV`aQVSW\ZWQV \c` W\ /ca\OV[STÉZZS\ aW\\d]ZZ Wab @SQVS\]^S`ObW] \S\ OcT RWSaS 2ObS\bg^S\ O\hceS\RS\ a]ZZ ROa \ÉQVabS 0SWa^WSZ SW\S [rUZWQVS /\ eS\Rc\U RS[]\ab`WS`S\ 2OPSW PS\cbhS\ eW` SW\ a] US\O\\bSa 7\Y`S[S\b 2WSa S` VrVb RS\ 7\VOZb SW\S` \c[S`WaQVS\ DO`WOPZS\ c[ aWSVS c\É`S =^S`Ob]`S\ ?a^VaP\\ ITXRWT] ) ATRW]T] \Xc RWPaEPaXPQ[T] public class Zeichen01 { public static void main(String args[]) char zeichen = 'A'; System.out.println(++zeichen); } }
{
2S` YZSW\abS 2ObS\bg^ [Wb RS[ W\ 8OdO US`SQV\Sb eS`RS\ YO\\ Wab X]c RV aQV[OZS `S Bg^S\ eS`RS\ hc X]c Y]\dS`bWS`b ?a^VaP\\ 1hcT ) 4aVTQ]XbePaXPQ[T WPc UP[bRWT] 3PcT]ch_ public class Byte01 { public static void main(String args[]) { byte b1 = 10; byte b2 = 11; byte erg = b1 + b2; System.out.println(erg); } } ES\\ AWS dS`acQVS\ RWSaSa >`]U`O[[ c[hceO\RSZ\ UWPb Sa SW\S 4SVZS`[SZRc\U _^bbXQ[T [^bb ^U _aTRXbX^] U^d]S X]c aT`dXaTS QhcT AW\\US[Éz PSRScbSb ROa ROaa OZa 3`USP\Wa RS` /RRWbW]\ W\ RS` HSWZS # SW\ 7\bSUS`eS`b USTc\RS\ ec`RS RSaVOZP [caa OcQV RWS 3`USP\WadO`WOPZS [W\RSabS\a RS\ Bg^ X]c VOPS\ ÎQd]VT] id\ ?a^VaP\\ 1hcT ÎQd]V ) 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa ROa `WQVbWUS 3`USP\Wa OcaUS USPS\ eW`R ÎQd]V !) ÍPS`ZSUS\ AWS ]P ROa ]PWUS >`]U`O[[ TSVZS`T`SW c[USeO\RSZb eS`RS\ YO\\ eS\\ RS` 2ObS\bg^ OZZS` R`SW DO`WOPZS\ d]\ QhcT \OQV RWPa USÉ\RS`b eW`R :r ac\UaVW\eSWa( 3W\S RWPaDO`WOPZS Wab 0gbS ZO\U SW\S X]cDO`WOPZS Wab " 0gbS ZO\U ÍPS`^`ºTS\ AWS ROa 3`USP\Wa 7V`S` 2S\YO`PSWb %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
ATRW]T] \Xc 6[TXcZ^\\P3PcT]ch_T] ES\\ PSW UO\hhOVZWUS\ 2ObS\bg^S\ SW\S 2WdWaW]\ Rc`QV ]aWbW]\S\ `SQVba d][ 9][[O( 2ShW[OZeS`b(
ROa VSWzb(
S\ba^`WQVb W[ 2cOZagabS[(
# # # $ # ! #
" & $ !
cae
2WS 2cOZhOVZ Wab OZa] c[US`SQV\Sb OZa 2ShW[OZhOVZ ! $ + '!%# C[ RS\ 2ShW[OZeS`b PW\É` RO`hcabSZZS\ PS\rbWUS\ eW` SW\S c\S\RZWQV ZO\US 2cOZhOVZ 2O Sa OPS` YSW\S Y][^ZSbbS 2O`abSZZc\U SW\S` c\S\RZWQV ZO\US\ HOVZ UWPb [caa RS` @SQV\S` RWSaS OPYº`hS\ OPaQV\SWRS\ h0 OZa a^SW QVS`\ 2O[Wb eW`R RWSaS` 2ShW[OZP`cQV W[ 2cOZagabS[ c\US\Oc ?a^VaP\\ 0aXcW\TcXZ
) D]VT]PdXVZTXc QTX FTRWbT[ STb BcT[[T]fTacbhbcT\b
public class Arithmetik11 { public static void main(String args[]) double d1 = 0.17; float f1 = 0.000001f; System.out.println(d1 / f1); System.out.println(d1 * f1); } }
{
;»bd]V) 0aQTXcT] \Xc STa :[PbbT 1XV3TRX\P[ P]bcT[[T e^] 6[TXcZ^\\PiPW[T] 2WS :rac\U RSa >`]PZS[a PSabSVb OcQV VWS` W[ ESQVaSZ RSa 2ObS\bg^a /\abSZZS RS` ^`W[WbWdS\ c\R aSV` STTWhWS\bS\ 2ObS\bg^S\ S^dQ[T ]RS` U[^Pc [caa RS` 9ZOaaS\bg^ 1XV3TRX\P[ US\][[S\ eS`RS\ 2WSaS` 2ObS\bg^ O`PSWbSb eSWbS`VW\ [Wb RS[ AbSZZS\eS`b ROa VSWzb XSRS HWTTS` SW \S` HOVZ eW`R Tº` aWQV OZZSW\ PW\É` dS`aQVZºaaSZb h0 W\ SW\S[ 6OZPPgbS c\R RWS SW\hSZ\S\ 6OZPPgbSa PSVOZbS\ XSeSWZa RWS ES`bWUYSWb RSa 2ShW[OZagabS[a 2WSaS 1] RWS`c\U \S\\b [O\ 012 PW\É` Q]RWS`bS 2ShW[OZhOVZS\ %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
0SWa^WSZ( 2WS 2ShW[OZhOVZ ! c\bS`aQVWSRZWQV dS`aQVZºaaSZb( `SW\ PW\É`( 0121]RS ^`] HWTTS` SW\ 6OZPPgbS(
0000 0000 0111 1011 0000 0001 0010 0011
2S` ESQVaSZ d][ SW\TOQVS\ 2ObS\bg^ hc[ 9ZOaaS\bg^ PSRScbSb OcQV ROaa \WQVb [Wb RS\ [ObVS[ObWaQVS\ =^S`Ob]`S\ Tº` RWS 5`c\R`SQVS\O`bS\ USO`PSWbSb eS` RS\ YO\\ a]\RS`\ ROaa ;SbV]RS\ Tº` RWS DS`O`PSWbc\U OcTUS`cTS\ eS`RS\ [ºaaS\ /czS`RS[ Wab Sa a] ROaa RWS [SWabS\ 1][^cbS` a^ShWSZZS 6O`ReO`S S\bVOZbS\ Tº` ROa @SQV\S\ [Wb 5ZSWbY][[OhOVZS\ 2Oa OZZSa TºV`b ROhc ROaa ROa /`PSWbS\ [Wb RS` 9ZOaaS 1XV3TRX\P[ OcTeÉ\RWUS` Wab OZa ROa /`PSWbS\ [Wb RS\ SW\USPOcbS\ Bg^S\ 2O Tº` aW\R RWS 3`USP\WaaS OPS` OcQV W\ XSRS[ 4OZZ `WQVbWU ?a^VaP\\ 1XV3TRX\P[ ) 9Tcic Xbc SPb 4aVTQ]Xb Z^aaTZc
import java.math.*; public class BigDecimal01 { public static void main(String args[]) { BigDecimal d1 = new BigDecimal("0.17"); BigDecimal d2 = new BigDecimal("0.000001"); System.out.println(d1.divide(d2)); System.out.println(d1.multiply(d2)); } } ÎQd]V id\ ?a^VaP\\ 1XV3TRX\P[ ÍPS`^`ºTS\ AWS ]P RWS /caUOPS RSa >`]U`O[[a OcQV [Wb T]ZUS\RS[ /caUOPSPSTSVZ [rUZWQV Wab( System.out.printf("%s", d1.divide(d2)); &!"$ Ad]Sd]V STa 4aVTQ]XbbT 8Sbhb PZSWPb \c` \]QV SW\S 4`OUS( C\R eWS Wab Sa [Wb RS[ /cT ]RS` /P`c\RS\ RS` 2ShW[OZabSZZS\- 5S`ORS W[ /ZZbOU c\R W[ YOcT[É\\WaQVS\ 0S`SWQV eW`R [Wb SW\S` dS`SW\PO`bS\ 5S\OcWUYSWb RS` 2ShW[OZabSZZS\ VW\bS` RS[ 9][[O USO`PSWbSb 0SW[ /`PSWbS\ [Wb EÉV`c\US\ VOb ROa 3`USP\Wa \]`[OZS`eSWaS \c` heSW AbSZZS\ VW\bS` RS[ 9][[O RO\OQV eW`R OcT ]RS` OPUS`c\RSb 2WS 9ZOaaS 1XV3TRX\P[ S`ZOcPb RS[ >`]U`O[[WS`S` RWS d]ZZS 9]\b`]ZZS ºPS` RWS dS` aQVWSRS\S\ ;rUZWQVYSWbS\ RSa @c\RS\a 3a UWPb W\aUSaO[b aWSPS\ dS`aQVWSRS\S ;rU ZWQVYSWbS\ 2WSaS aW\R ºPS` `]U`O[[ Wab SW\ ^`W[WbWdS` 3c`]C[`SQV\S` Sa `SQV\Sb SW\S\ 2; ES`b c[ W\ 3c`] ?a^VaP\\ 4da^ ) ATRW]T] ^W]T SPb 4aVTQ]Xb id ad]ST]
public class Euro01 { public static void main(String args[]) double dm = 100.00; double euro = dm / 1.95583; System.out.println(euro); } }
{
2Oa 3`USP\Wa Wab( # '&&'$ ÎQd]V id\ ?a^VaP\\ 4da^ 0WbbS É\RS`\ AWS ROa >`]U`O[[ 4da^ YPeP a] ROaa Sa [Wb RS` 9ZOaaS 1XV3TRX\P[ O`PSWbSb c\R ROaa SW\S YOcT[É\\WaQVS @c\Rc\U OcT heSW AbSZZS\ PSW RS` /caUOPS S` T]ZUb
'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
?a^VaP\\ 4da^!) ;»bd]Vbe^abRW[PV
import java.math.*; public class Euro02 { public static void main(String args[]) { BigDecimal dm = new BigDecimal("100.00"); BigDecimal kurs = new BigDecimal("1.95583"); BigDecimal euro = dm.divide(kurs,2, BigDecimal.ROUND_HALF_UP); System.out.printf("%s", euro); } }
2Oa T]ZUS\RS >`]U`O[[ S``SQV\Sb RWS DS`hW\ac\U SW\Sa A^O`PSb`OUSa d]\ 3c`] Oca Tº` 8OV`S PSW SW\S[ HW\aaObh d]\ $# ]V\S HW\aSahW\a ?a^VaP\\ 0aXcW\TcXZ !) IX]baTRW]d]V public class Arithmetik12 { public static void main(String[] args) { double start = 100000.0; int jahre = 20; float zinssatz = 1.065f; // 6.5% double total; total = zinssatz * jahre * start; System.out.println("Neues Kapital: " + total); } } ÎQd]V id\ ?a^VaP\\ 1XV3TRX\P[" 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa Sa [Wb RS` 9ZOaaS 1XV3TRX\P[ O`PSWbSb c\R dS`UZSWQVS\ AWS RWS 3`USP\WaaS ?a^VaP\\ 1XV3TRX\P[") ;»bd]Vbe^abRW[PV
import java.math.*; public class BigDecimal03 { public static void main(String[] args) { MathContext def = MathContext.DECIMAL32; BigDecimal start = new BigDecimal(100000); BigDecimal jahre = new BigDecimal(20); BigDecimal zinssatz = new BigDecimal("1.065"); // 6.5% BigDecimal total; total = zinssatz.multiply(jahre).multiply(start); System.out.println("Neues Kapital: " + total.toString()); } }
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&"
ETaV[TXRWb^_TaPc^aT]
IdbP\\T]UPbbd]V) 5X]VTa ^STa 5Pdbc. 2S` >`]U`O[[WS`S` VOb PSW[ @SQV\S\ W\ 8OdO RWS EOVZ ROa aSV` STTWhWS\bS 2cOZaga bS[ hc[ @SQV\S\ hc PS\cbhS\ ]RS` W[ 2ShW[OZagabS[ hc PZSWPS\ ES\\ RWS DO`W OPZS\ SW\S\ RS` SW\USPOcbS\ 2ObS\bg^S\ X]c U[^Pc cae VOPS\ RO\\ eW`R aSV` aQV\SZZ c\R aSV` SW\TOQV USO`PSWbSb /PS` RS` >`]U`O[[WS`S` [caa eWaaS\ eOa S` bcb 3a YO\\ \É[ZWQV hc ÍPS`ZOcT^`]PZS[S\ Y][[S\ ]RS` OcQV hc C\US\OcWUYSWbS\ PSW[ /`PSWbS\ [Wb 9][[OabSZZS\ ES\\ RWSa \WQVb b]ZS`WS`PO` Wab RO\\ [caa RS` 2ObS\bg^ 1XV3TRX\P[ ]RS` 1XV8]cTVTa US\][[S\ eS`RS\ 2WSaS 9ZOaaS\ O`PSWbS\ eSWbS`VW\ [Wb RS[ 2ShW[OZagabS[ 0121]RWS`c\U ES\\ OZZS`RW\Ua RWS >S`T]`[O\QS RS` eWQVbWUabS /a^SYb Wab c\R RWS /caeW`Yc\US\ ºPS`aQVOcPO` aW\R YO\\ Sa aW\\d]ZZ aSW\ [Wb RS\ ^`W[WbWdS\ 2O bS\bg^S\ hc O`PSWbS\ 4º` RWSaS ^`W[WbWdS\ 2ObS\bg^S\ PWSbSb 8OdO =^S`Ob]`S\ Tº` RWS 5`c\R`SQVS\O`bS\ O\ ES\\ RO`ºPS` VW\Oca a^ShWSZZS [ObVS[ObWaQVS ]RS` eWaaS\aQVOTbZWQVSbSQV\WaQVS 4c\YbW]\S\ PS\rbWUb eS`RS\ h0 :]UO`WbV[ca b`WU]\][Sb`WaQVS 0S`SQV\c\US\ [caa OcT RWS 9ZOaaS\ `]U`O[[a a]ZZ Sa aSW\ RWS PSWRS\ DO`WOPZS\ i c\R i! OcT 5ZSWQVVSWb hc ^`ºTS\ ?a^VaP\\ ETaV[TXRW")
5P[bRWTb 4aVTQ]Xb
public class Vergleich03 { public static void main(String[] args) { char z1 = 'a'; char z2 = 'b'; System.out.println(z1 = z2); } } ÎQd]V id\ ?a^VaP\\ ETaV[TXRW" 2Oa >`]U`O[[ UWPb RS\ 0cQVabOPS\ P Oca 3`YZÉ`S\ AWS eO`c[ RWSa a] Wab c\R Y]` `WUWS`S\ AWS ROa >`]U`O[[ a] ROaa RS` DS`UZSWQV Y]``SYb OcaUSTºV`b eW`R D]`aWQVb Wab USP]bS\ PSW[ DS`UZSWQV d]\ 5ZSWbY][[OhOVZS\ 2c`QV RS\ ESQVaSZ RSa AbSZZS\eS`bagabS[a YO\\ Sa hc C\US\OcWUYSWbS\ Y][[S\ ?a^VaP\\ ETaV[TXRW#) ETaV[TXRW e^] 6[TXcZ^\\PiPW[T]
public class Vergleich04 { public static void main(String[] args) float zahl1 = 0.1f; zahl1 = zahl1 / 0.0001f; System.out.println(zahl1 == 1000); System.out.println(zahl1); } }
{
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&"
ETaV[TXRWb^_TaPc^aT]
2Oa 0SWa^WSZ ETaV[TXRW# hSWUb ROaa RS` BSab OcT SfOYbS 5ZSWQVVSWb PSW 5ZSWbY][[O hOVZS\ ^`]PZS[ObWaQV Wab 3a ZWSTS`b OZa 3`USP\Wa UP[bT
3W\S PSaaS`S :rac\U PSabSVb RO`W\ ROa 3`USP\Wa S\beSRS` hc `c\RS\ ]RS` \]QV PSaaS` OPhcT`OUS\ ]P RWS ES`bS a] c\USTÉV` UZSWQV aW\R 2WSa YO\\ Rc`QV BSabS\ SW\S` b]ZS`WS`PO`S\ 2WTTS`S\h OPUST`OUb eS`RS\ ETaV[TXRW e^] >QYTZcT]
2WS =^S`Ob]`S\ ++ Tº` 5ZSWQVVSWb c\R + Tº` C\UZSWQVVSWb aW\R OcQV OcT ]PXSYb eS`bWUS DO`WOPZS\ SW\aSbhPO` /PS`( D]`aWQVb OcQV VWS` [caa [O\ eWaaS\ eOa [O\ bcb eWS ROa T]ZUS\RS >`]U`O[[ hSWUb ?a^VaP\\ ETaV[TXRW$) ETaV[TXRW PdU 8ST]cXcÊc
public class Vergleich05 { public static void main(String[] args) { String s1 = new String("Hallo"); String s2 = new String("Hallo"); System.out.println(s1 == s2); } } 0SWRS =PXSYbS S\bVOZbS\ RWS UZSWQVS\ 2ObS\ b`]bhRS[ eW`R OZa 3`USP\Wa RSa DS` UZSWQVa UP[bT OcaUSUSPS\ EWS Y][[b ROa- 2WS /\be]`b( 8OdO O`PSWbSb ab`S\U Z]UWaQV Sa eS`RS\ \É[ZWQV RWS PSWRS\ @STS`S\hdO`WOPZS\ b c\R b! dS`UZWQVS\
a
6 O Z Z ]
a
6 O Z Z ]
/PP % HeSW BcaX]V =PXSYbS XSeSWZa [Wb @STS`S\hdO`WOPZS c\R =PXSYbeS`b C\R b c\R b! S\bVOZbS\ OZa ES`b RWS /R`SaaS\ RS` PSWRS\ Ab`W\Ua ;O\ aOUb RWSa Wab SW\ DS`UZSWQV OcT 7RS\bWbÉb 2S\\ a] SW\ DS`UZSWQV ^`ºTb ]P Sa aWQV c[ ROaaSZPS =P XSYb VO\RSZb C\R RWS /\be]`b Wab \SW\ eSWZ Sa heSW =PXSYbS W[ /`PSWbaa^SWQVS` UWPb 3W\ W\VOZbZWQVS` DS`UZSWQV Wab \c` [rUZWQV ºPS` RS\ /cT`cT SW\S` ;SbV]RS
!!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
?a^VaP\\ ETaV[TXRW%) ETaV[TXRW PdU X]WP[c[XRWT 6[TXRWWTXc
public class Vergleich06 { public static void main(String[] args) { String s1 = new String("Hallo"); String s2 = new String("Hallo"); System.out.println(s1.equals(s2)); } } 8Sbhb ZOcbSb ROa 3`USP\Wa cadT 0SWRS =PXSYbS aW\R W\VOZbZWQV UZSWQV 4OhWb( 2WS =^S`Ob]`S\ Tº` HceSWac\US\ + c\R Tº` RS\ BSab OcT 5ZSWQVVSWb ++ eW` YS\ OcT RWS ES`bS RS` =^S`O\RS\ 2Oa PSRScbSb( aW\R RWS =^S`O\RS\ @STS`S\hdO`W OPZS\ eW`YS\ aWS OcT RS\ @STS`S\heS`b 7\ RS\ [SWabS\ 4ÉZZS\ S\ba^`WQVb ROa \WQVb RS` /cTUOPS\abSZZc\U RSaVOZP [ºaaS\ Tº` @STS`S\hS\ ;SbV]RS\ OcTUS`cTS\ eS`RS\
2UMOYINK5VKXGZUXKT
=GYYOTJRUMOYINK5VKXGZUXKT% DS`UZSWQVa]^S`Ob]`S\ eS`RS\ VÉcTWU Y][PW\WS`b [Wb Z]UWaQVS\ =^S`Ob]`S\ 2ORc`QV YO\\ [O\ [SV`S`S DS`UZSWQVS dS`Y\º^TS\ hc SW\S` 5SaO[bOcaaOUS 2WS eWQVbWUabS\ Z]UWaQVS\ =^S`Ob]`S\ Q]\RWbW]\OZ ]^S`Ob]` aW\R( jj L
Z]UWaQVS C 0 && x < 10); } } 2WSaS` hcaO[[S\USaSbhbS /caR`cQY VOb OZa 3`USP\Wa cadT eSWZ PSWRS 3W\hSZPSRW\ Uc\US\ x>0 c\R xSbS` `OcQVb P 2S[\OQV UWPb Sa T]ZUS\RS dWS` 3W\UO\UaY][PW\ObW]\S\( !#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
O 9ZOca `OcQVb
P >SbS` `OcQVb
;rUZWQVSa 3`USP\Wa SW\S` @SUSZ(
b`cS b`cS TOZaS TOZaS
b`cS TOZaS b`cS TOZaS
eOV` ]RS` TOZaQV eOV` ]RS` TOZaQV eOV` ]RS` TOZaQV eOV` ]RS` TOZaQV
2WS /caaOUS\Z]UWY S`abSZZb \c\ @SUSZ\ Tº` ROa 3`USP\Wa ROa RWS 0ZOQY 0]f ZWSTS`b OPVÉ\UWU d]\ RS\ 3W\UO\UaeS`b O c\R P 2OPSW Yr\\S\ RWS PSWRS\ EOV`VSWbaeS`bS RS` dWS` 3`USP\WaaS PSZWSPWU [WbSW\O\RS` hc SW\S` @SUSZ dS`Y\º^Tb eS`RS\ 2ORc`QV S`USPS\ aWQV " V]QV + $ 9][PW\ObW]\S\ U !
U "
U #
U $
U %
P
Q
U
U!
U"
U#
U$
U%
U&
U'
U(
U
U
0=3
G>A
>A
/PP % ( 2WS $ heSWabSZZWUS\ 4c\YbW]\S\ 0SWa^WSZS Tº` /\eS\Rc\US\ RWSaS` @SUSZ\( •
34A US\O\\b 2O`ºPS` VW\Oca UWPb Sa W\ 8OdO \]QV
•
RWS PdbbRW[XTvT]ST >34ADS`PW\Rc\U SfYZcaWdSa =23@ F=@ Phe S\beS RS`]RS` RWS \c` RO\\ eOV` Wab eS\\ SW\S RS` PSWRS\ /caaOUS\ OPS` \WQVb PSWRS UZSWQVhSWbWU eOV` Wab
1^^[TbRWT 0[VTQaP ;Wb 6WZTS RS` 0]]ZSaQVS\ /ZUSP`O eS`RS\ RWS 5SaSbh[ÉzWUYSWbS\ RS` /caaOUS\Z]UWY W\ SW\ [ObVS[ObWaQVSa AgabS[ USP`OQVb AWS ec`RS d]\ RS[ S\UZWaQVS\ ;ObVS[ObW !$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&# ;^VXbRWT >_TaPc^aT]
YS` 5S]`US 0]]ZS &# &$" S\beWQYSZb AWS PSabSVb Oca SW\S` ;S\US d]\ heSW 3ZS[S\bS\ /caaOUS\ c\R \c` R`SW [rUZWQVS\ 8c\Yb]`S\ =^S`Ob]`S\( •
/RRWbW]\ C`]U`O[[ dS`abÉ\RZW QVS`( 2S` 4ZcU TW\RSb abObb eS\\ OcT RS[ BWQYSb / ]RS` 0 c\R OZa 2Obc[ ]RS` abSVb 3W\ UºZbWUSa BWQYSb YO\\ OZa] SW\S RS` T]ZUS\RS dWS` 9][PW\ObW]\S\ S\bVOZbS\( / / 0 ]RS` 0 /ZZS O\RS`S\ aW\R c\UºZbWU ?a^VaP\\ 0dbSadRZ#) ?^bXcXeT CTX[PdbbPVT] eTaZ]¶_UT] class Ausdruck04 { public static void main(String[] args) { char ticket = 'B'; int datum = 12; if ((ticket == 'A' || ticket == 'B') && (datum == 11 || datum == 12)) System.out.println("Flug"); else System.out.println("Kein Flug"); } } 2WS @SUSZ Tº` RWS C[T]`[c\U \S\\b [O\ RWS ST c\Yb /`WbV[SbWY d]` Ab`WQV/`WbV[SbWY
•
2O\OQV eS`RS\ `SZObW]\OZS =^S`Ob]`S\ DS`UZSWQVS Rc`QVUSTºV`b
•
C\R RO\\ eS`RS\ SdbZ d]`VO\RS\S Z]UWaQVS DS`Y\º^Tc\US\ RS` 3`USP\WaaS RWS aS` DS`UZSWQVS OcaUSeS`bSb
•
3a UWPb \c` SW\ 3`USP\Wa c\R ROa eW`R UO\h hc[ AQVZcaa SW\S` DO`WOPZS\ hcUS eWSaS\ TOZZa Sa SW\S\ HceSWac\Ua]^S`Ob]` UWPb
?a^VaP\\ ?aX^aXcPTc ) 1TXb_XT[ U¶a d]cTabRWXTS[XRWT ?aX^aXcÊcT] class Prioritaet01 { public static void main(String[] args) { int x = 5; int y = 9; System.out.println(x + 15 / 5); System.out.println(x != 6 && y < 8); System.out.println(x == 5 ^ y > 0); System.out.println(x < 3 || y == 5); } } ?a^VaP\\ ?aX^aXcPTc!) 1TXb_XT[ ! U¶a d]cTabRWXTS[XRWT ?aX^aXcÊcT] class Prioritaet02 { public static void main(String[] args) { System.out.println(2 + 15 / 3 < 7 && 5 < 3); } } 2S` /caR`cQY W[ >`]U`O[[ ?aX^aXcPTc!YPeP PSabSVb Oca heSW BSWZOcaR`ºQYS\ RWS aS aW\R [Wb RS[ Z]UWaQVS\ C`]U`O[[ RS[]\ab`WS`b ROa /`PSWbS\ [Wb Z]YOZS\ DO`WOPZS\ OZZS`RW\Ua eW`R PSW RS[ DS`acQV RWSaSa >`]U`O[[ c[hceO\RSZ\ SW\S 4SVZS`[SZRc\U OcaUSUSPS\
?a^VaP\\ ;^ZP[ ) 0aQTXcT] \Xc [^ZP[T] EPaXPQ[T] 5TW[TaWPUc public class Lokal01 { public static void main(String[] a) { int zahl1 = 10; "&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'
4X]UPRWT d]S idbP\\T]VTbTcicT 0]fTXbd]VT]
{ int zahl2 = 5; System.out.println(zahl2++); } System.out.println(zahl1 + zahl2); } } ÎQd]VT] \Xc ?a^VaP\\ ;^ZP[ ÎQd]V ( 0WbbS Y]``WUWS`S\ AWS RS\ 4SVZS` 6W\eSWaS hc` C`aOQVS aWSVS d]`VS`WUS\ /PaObh( 0Z]QYPWZRc\U c\R Z]YOZS DO`WOPZS\ ÎQd]V !) 9ZÉ`S\ AWS Rc`QV >`]U`O[[É\RS`c\U RWS 4`OUS ]P RS` DO`WOPZS\\O[S iPW[ OcQV W\\S`VOZP RSa 0Z]QYa h 0 W\ RS` _aX]c[];SbV]RS PS\cbhb eS`RS\ RO`T 2WS 3`YS\\b\Wa Oca RWSaS\ ÍPc\US\ Wab ROaa SW\ /\eSWac\UaPZ]QY RS\ 5ºZbWUYSWba PS`SWQV d]\ DO`WOPZS\ RSTW\WS`b 7ab SW\S DO`WOPZS W\ SW\S[ 0Z]QY RSTW\WS`b a] Wab aWS \c` R]`b UºZbWU AWS YO\\ OczS`VOZP RWSaSa 0Z]QYa \WQVb O\USa^`]QVS\ eS`RS\ ;O\ \S\\b RWSaS DO`WOPZS Z]YOZS DO`WOPZS 0Z]QYa Yr\\S\ PSZWSPWU USaQVOQVbSZb eS`RS\ /ZZS`RW\Ua [ºaaS\ W\\S`VOZP SW\S` ;S bV]RS RWS 0ShSWQV\S` RS` Z]YOZS\ DO`WOPZS\ SW\RScbWU aSW\ RV SW\ SW\[OZ RSYZO`WS` bS` 0ShSWQV\S` RO`T \WQVb \]QV SW\[OZ RSYZO`WS`b eS`RS\ OcQV \WQVb W\ SW\S[ C\bS` PZ]QY
9ZK[KXGT]KOY[TMKT ;Wb 6WZTS d]\ AbScS`O\eSWac\US\ YO\\ RS` >`]U`O[[WS`S` RS\ /PZOcT RSa >`] U`O[[a abScS`\ 3a UWPb AbScS`O\eSWac\US\ Tº` DS`heSWUc\US\ XU c\R bfXcRW c\R Tº` RWS AQVZSWTS\PWZRc\U U^a fWX[T S^ AWS aW\R SPS\TOZZa hcaO[[S\USaSbhbS /\ eSWac\US\ RS\\ aWS S\bVOZbS\ O\RS`S /\eSWac\US\ RWS RO\\ S\beSRS` aSZSYbWd UO` \WQVb eSWZ RWS 0SRW\Uc\U \WQVb S`TºZZb Wab ]RS` SW\[OZ Phe [SV`[OZa OcaUS TºV`b eS`RS\ eS\\ RWS ROTº` \]beS\RWUS 0SRW\Uc\U S`TºZZb Wab /ZZS\ AbScS`O\eSWac\US\ US[SW\aO[ Wab ROaa RS` eSWbS`S /PZOcT RSa >`]U`O[[a d]\ SW\S[ /caR`cQY USabScS`b eW`R RS` d][ Bg^ Q^^[TP] aSW\ [caa ?a^VaP\\ 0]fTXbd]V ) 1^^[TbRWTa 0dbSadRZ X\ XU1TUTW[ class Anweisung01 { public static void main(String[] args) { if (5 > 3) System.out.println("5 ist groesser als 3"); } }
"'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
2S` 740STSVZ PSUW\\b [Wb RS[ AQVZºaaSZe]`b XU 2O\\ T]ZUb W\ `c\RS\ 9ZO[[S`\ SW\ /caR`cQY RS` OZa 3`USP\Wa SW\S\ P]]ZSaQVS\ ES`b ZWSTS`b XO ]RS` \SW\ 7[ 0SWa^WSZ S\bVÉZb RWS XU/\eSWac\U RO\OQV SW\S eSWbS`S /\eSWac\U \É[ZWQV RS\ /cT`cT SW\S` _aX]c[];SbV]RS 2WSaS` 0Z]QY eW`R \c` OcaUSTºV`b eS\\ RS` P]]ZSaQVS /caR`cQY cadT ZWSTS`b /cT XSRS\ 4OZZ Wab RS` USaO[bS 740STSVZ S`ab \OQV RS[ AS[WY]Z]\ PSS\ RSb 2Oa AS[WY]Z]\ aQVZWSzb VWS` ROa AbObS[S\b [Wb RS[ ;SbV]RS\OcT`cT OP Hc aO[[S\USaSbhbS /\eSWac\US\ W\ RWSaS[ 4OZZ OZa] ROa XUAbObS[S\b aSZPab eS`RS\ ]XRWc [Wb SW\S[ AS[WY]Z]\ OPUSaQVZ]aaS\ ?a^VaP\\ 0]fTXbd]V!) 0]fTXbd]VbQ[^RZ P]bcT[[T STa 4X]iT[P]fTXbd]V class Anweisung02 { public static void main(String[] args) { if (5 > 3) { System.out.println("Das Ergebnis der Prüefung ist: "); System.out.println("Fuenf ist groesser als 3"); } } } 7\ RS[ >`]U`O[[ 0]fTXbd]V! PSabSVb RS` 8OHeSWU RS` XU/\eSWac\U Oca [SV` OZa SW\S` /\eSWac\U 2SaeSUS\ [caa SW\ /\eSWac\UaPZ]QY USPWZRSb eS`RS\ RS` Rc`QV RWS USaQVeSWTbS\ 9ZO[[S`\ hcaO[[S\USVOZbS\ eW`R 2S` USaO[bS 740STSVZ Wab \OQV RWSaS[ 0Z]QY PSS\RSb 3a eW`R O[ 3\RS YSW\ AS[WY]Z]\ USaSbhb
=KXZK`[]KOY[TM
2c`QV SW\S ES`bShceSWac\U OaaWU\[S\b eW`R RS` 7\VOZb SW\S` DO`WOPZS\ dS`É\ RS`b aWS PSY][[b SW\S\ \ScS\ ES`b hcUSeWSaS\ 2S` =^S`Ob]` Tº` RWS HceSWac\U Wab ROa 5ZSWQVVSWbahSWQVS\ + ?a^VaP\\ IdfTXbd]V ) EPaXPQ[T] TX]T] ]TdT] FTac idfTXbT]
class Zuweisung01 { public static void main(String[] args) { int zahl = 15; // Initialisierung System.out.println("Vorher: " + zahl); zahl = 1; // Wertezuweisung System.out.println("Nachher: " + zahl); } } @SQVba d][ 5ZSWQVVSWbahSWQVS\ abSVb RS` AS\RS` ZW\Ya d][ 5ZSWQVVSWbahSWQVS\ abSVb RS` 3[^TÉ\US` 2S` AS\RS` Wab SW\ /caR`cQY OZa] SW\S DO`WOPZS 9]\abO\bS ]RS` SW\ ;SbV]RS\OcT`cT ]RS` SW\S PSZWSPWUS 9][PW\ObW]\ RO`Oca 2S` 3[^TÉ\US` YO\\ \c` Oca SW\S` DO`WOPZS\ PSabSVS\ RV d]` RS[ 5ZSWQVVSWbahSWQVS\ abSVb RS` #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'!
FTacTidfTXbd]V
7RS\bWTWS` RS` DO`WOPZS\ RWS RS\ \ScS\ ES`b RSa /caR`cQYa PSY][[b 2S` PWaVS`WUS ES`b RS` DO`WOPZS\ eW`R Z^\_[Tcc S`aSbhb Rc`QV RS\ SdOZcWS`bS\ ES`b RSa /caR`cQYa Hc` EWSRS`V]Zc\U \]QV SW\[OZ RS` 6W\eSWa( SW\ /caR`cQY PS`SQV\Sb TX]T] c\R \c` SW\S\ ES`b ?a^VaP\\ IdfTXbd]V!) 4X] 0dbSadRZbfTac fXaS TeP[dXTac d]S idVTfXTbT] class Zuweisung02 { public static void main(String[] args) { int zahl = 15; System.out.println("Vorher: " + zahl); zahl = (1 + 6) / 2; System.out.println("Nachher: " + zahl); } } 8SRS` /caR`cQY VOb OZa] \c` TX]T] ES`b 7[ 0SWa^WSZ IdfTXbd]V!YPeP Wab RWSaS` heSWTSZZ]a d][ 2ObS\bg^ X]c RS\\ OZZS =^S`O\RS\ RWSaSa AbObS[S\ba VOPS\ RS\aSZ PS\ Bg^ c\R Sa UWPb RSaeSUS\ OcQV YSW\S`ZSW /\^Oaac\Ua^`]PZS[S 2O[Wb Wab OcQV UZSWQVhSWbWU RS` 2ObS\bg^ RSa /caR`cQYa TSabUSZSUb 2WSaS` 2ObS\bg^ RSa AS\RS` /caR`cQYa [caa ºPS`SW\abW[[S\ [Wb RS[ 2ObS\bg^ RS` 3[^TÉ\US`dO`WOPZS\ EOa ^OaaWS`b OPS` eS\\ •
RS` 2ObS\bg^ RSa AS\RS`/caR`cQYa \WQVb ºPS`SW\abW[[b [Wb RS[ 2ObS\bg^ RS` S[^TO\US\RS\ DO`WOPZS\ ]RS`
•
RWS =^S`O\RS\ RSa /caR`cQYa c\bS`aQVWSRZWQVS 2ObS\bg^S\ VOPS\-
D]cTabRWXTS[XRWT 3PcT]ch_T] QTX BT]STa d]S 4\_UÊ]VTa 5S\S`SZZ YO\\ RS` 3[^TÉ\US` \c` 2ObS\ a^SWQVS`\ RWS [Wb aSW\S[ Bg^ ºPS`SW\ abW[[S\ 2SaeSUS\ eW`R RS` 2ObS\bg^ RSa /caR`cQYa O\ RS\ Bg^ RSa 3[^TÉ\US`a O\US^Oaab OZZS`RW\Ua \c` eS\\ RORc`QV \WQVb RWS 5STOV` PSabSVb ROaa 7\T]`[ObW] \S\ dS`Z]`S\ USVS\ W[^ZWhWbS Bg^c[eO\RZc\U /\RS`\TOZZa UWPb Sa 4SVZS` PSW RS` C[eO\RZc\U ?a^VaP\\ IdfTXbd]V") D\fP]S[d]VbUTW[Ta fTVT] UP[bRWTa IdfTXbd]V public class Zuweisung03 { public static void main(String args[]) { int zahl1 = 10; short zahl2 = 5; zahl2 = zahl1; zahl1 = zahl2; } } #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
2Oa >`]U`O[[ IdfTXbd]V"YPeP YO\\ \WQVb TSVZS`T`SW c[USeO\RSZb eS`RS\ eSWZ RWS S[^TO\US\RS DO`WOPZS iPW[! hc YZSW\ Wab Tº` SW\S\ X]cES`b ÎQd]V id\ ?a^VaP\\ IdfTXbd]V" 9]``WUWS`S\ AWS RS\ 4SVZS` W\RS[ AWS RS\ 2ObS\bg^ RS` S[^TO\US\RS\ DO`WOPZS\ É\RS`\ 3W\ \WQVb UO\h a] ]TTS\aWQVbZWQVS` 4SVZS` abSQYb W[ >`]U`O[[ IdfTXbd]V# ?a^VaP\\ IdfTXbd]V#) D\fP]S[d]VbUTW[Ta fTVT] UP[bRWTa IdfTXbd]V
public class Zuweisung04 { public static void main(String args[]) float s1 = 5.0; } }
{
ÎQd]V id\ ?a^VaP\\ IdfTXbd]V # 9]``WUWS`S\ AWS RS\ 4SVZS` W[ >`]U`O[[ IdfTXbd]V#YPeP 6W\eSWaS hc` :rac\U TW\RS\ AWS W[ 9O^WbSZ # PSW[ BVS[O 4Z]ObW\U^]W\b:WbS`OZS 2]`b Wab PSaQV`WSPS\ eWS SW\ :WbS`OZ d][ Bg^ U[^Pc Q]RWS`b eW`R D]cTabRWXTS[XRWT 3PcT]ch_T] X]]TaWP[Q TX]Tb 0dbSadRZb Bg^O\^Oaac\US\ aW\R OcQV \]beS\RWU eS\\ RWS =^S`O\RS\ W\\S`VOZP SW\Sa /ca R`cQYa c\bS`aQVWSRZWQVS Bg^S\ VOPS\ aWSVS VWS`hc OcQV 9O^WbSZ % 1TXb_XT[ IdfTXbd]V$) Ch_P]_Pbbd]V STa >_TaP]ST] X\ 0dbSadRZ
public class Zuweisung05 { public static void main(String args[]) { String str = "Bahnhofstr."; int nr = 125; System.out.println(str + nr); } } 0SW[ /cT`cT RS` ;SbV]RS _aX]c[] eS`RS\ heSW /`Uc[S\bS ºPS`USPS\ SW\ BcaX]V /`Uc[S\b c\R SW\ X]c/`Uc[S\b 2WS ES`bS [ºaaS\ UZSWQV\O[WU US[OQVb eS`RS\ RS\aSZPS\ Bg^ PSY][[S\ c\R RWSa USaQVWSVb Ocb][ObWaQV ]V\S Sf^ZWhWbS /\UOPS Rc`QV RS\ >`]U`O[[WS`S` eSWZ YSW\ 7\T]`[ObW]\adS`Zcab RORc`QV S\babSVb
@[YGSSKTMKYKZ`ZK@[]KOY[TMYUVKXGZUXKT <SPS\ RS[ PWaVS` PSa^`]QVS\S\ 5ZSWQVVSWbahSWQVS\ + OZa =^S`Ob]` Tº` RWS ES`bS hceSWac\U UWPb Sa W\ 8OdO hcaO[[S\USaSbhbS HceSWac\Ua]^S`Ob]`S\ AWS eS`RS\ W\ T]ZUS\RS` 4]`[ dS`eS\RSb( #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'!
FTacTidfTXbd]V
empfänger
operator=
sendeausdruck)
2Oa 5ZSWQVVSWbahSWQVS\ eW`R OZa] Y][PW\WS`b [Wb SW\S[ eSWbS`S\ =^S`Ob]` h0 SW \S[ @SQVS\ ]RS` SW\S[ DS`UZSWQVa]^S`Ob]` HeWaQVS\ =^S`Ob]` c\R RS[ 5ZSWQV VSWbahSWQVS\ RO`T YSW\ :SS`hSWQVS\ abSVS\ 0SWa^WSZ( zahl
+= 5;
2WS 0SRScbc\U RWSaSa /caR`cQYa Wab É_cWdOZS\b hc( zahl = zahl + 5; ?a^VaP\\ IdfTXbd]V%) :^\QX]XTacT IdfTXbd]Vb^_TaPc^aT]
public class Zuweisung06 { public static void main(String args[]) { int x = 1; int y = 10; x += 13; // x = x + 13; System.out.println(x); y *= y + 5; // y = y * (y + 5); System.out.println(y); } } =Pe]VZ ROa /`PSWbS\ [Wb RWSaS\ Y][PW\WS`bS\ =^S`Ob]`S\ hc SW\S` dS`Yº`hbS\ AQV`SWPeSWaS TºV`b eW`R RS` 3W\aObh \WQVb S[^T]VZS\ eSWZ RWS :SaPO`YSWb RO`c\bS` ZSWRSb 2WSa RS[]\ab`WS`b PSa]\RS`a RWS d]`ZSbhbS HSWZS RSa >`]U`O[[a IdfTX bd]V%YPeP
3KNXKXK5VKXGTJKTGRY+SVLoTMKXJKX@[]KOY[TM 3W\S eSWbS`S DO`WO\bS RSa HceSWac\Ua]^S`Ob]`a S`ZOcPb ROa /`PSWbS\ [Wb [SV`S`S\ 3[^TÉ\US`=^S`O\RS\ ?a^VaP\\ IdfTXbd]V&) `]U`O[[bSWZS eWSRS`V]Zb OZa] [SV` OZa SW\[OZ OcaUSTºV`b eS`RS\ 3W\S AQVZSWTS eW`R \]`[OZS`eSWaS PSS\RSb eS\\ SW\ PSabW[[bS` HcabO\R S``SWQVb Wab AWS PSabSVb Oca SW\S[ 9]^T c\R RS[ @c[^T 2WS OZZUS[SW\S Ag\bOf aWSVb a] Oca( schleifenbefehl (Boolescher ausdruck) { // Schleifenrumpf (Ausführungsblock) } 2Oa 3`USP\Wa RSa 0]]ZSaQVS\ /caR`cQYa S\baQVSWRSb RO`ºPS` ]P RS` 0Z]QY Rc`QV ZOcTS\ eW`R ]RS` \WQVb 3`T]`RS`ZWQV aW\R \]`[OZS`eSWaS /\eSWac\US\ W[ AQVZSWTS\ `c[^T RWS RWS 0SRW\Uc\U a] []RWTWhWS`S\ ROaa SW\ PSabW[[bS` HcabO\R S``SWQVb eW`R RS` RWS AQVZSWTS\Rc`QVTºV`c\U PSS\RSb /\RS`\TOZZa eº`RS SW\S 3\RZ]a AQVZSWTS ^`]U`O[[WS`b /PVÉ\UWU d][ HSWb^c\Yb eO\\ RWSaS ÍPS`^`ºTc\U abObbTW\RSb c\bS`aQVSWRSb [O\ W\ 8OdO heSW /`bS\ d]\ AQVZSWTS\/\eSWac\US\( •
RWS Z^_UVTbcTdTacT fWX[T/\eSWac\U OPeSWaS\RS AQVZSWTS c\R
•
RWS UdvVTbcTdTacS S^/\eSWac\U \WQVbOPeSWaS\RS AQVZSWTS
/czS`RS[ UWPb Sa SW\S eSWbS`S /`b \É[ZWQV •
RWS IÊW[bRW[TXUT U^aAQVZSWTS ROa Wab SW\S PSa]\RS`S 4]`[ RS` OPeSWaS\RS\ AQVZSWTS
=NORK9INRKOLK ;Wb RS` EVWZSAQVZSWTS YO\\ [O\ S``SWQVS\ ROaa >`]U`O[[bSWZS a]ZO\US eWSRS`V]Zb eS`RS\ PWa SW\S 0SRW\Uc\U UP[bT S`UWPb Ag\bOf RS` fWX[TAQVZSWTS( $%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
eVWZS 0]]ZSaQVS` /caR`cQY i AQVZSWTS\0Z]QY k
2S` 0]]ZSaQVS /caR`cQY eW`R OcaUSeS`bSb ES\\ S` cadT S`UWPb eW`R RS` AQVZSWTS\ PZ]QY OcaUSTºV`b 2O\OQV eW`R RS` /caR`cQY S`\Scb OcaUSeS`bSb c\R OPVÉ\UWU d][ 3`USP\Wa RS` 0Z]QY \]QV SW\[OZ eWSRS`V]Zb ]RS` \WQVb ES\\ RS` 0]]ZSaQVS /ca R`cQY UP[bT ZWSTS`b eW`R [Wb RS[ \ÉQVabS\ 0STSVZ \OQV RS[ AQVZSWTS\`c[^T T]`bUS aSbhb ESWZ e^a /caTºV`c\U RSa 0Z]QYa RS` /caR`cQY ºPS`^`ºTb eW`R \S\\b [O\ RWS fWX[T AQVZSWTS Y]^TUSabScS`b ]RS` OPeSWaS\R 2S` AQVZSWTS\`c[^T eW`R a]ZO\US OcaUS TºV`b eWS RWS 0SRW\Uc\U S`TºZZb Wab
/PP &"( Ab`cYb]U`O[[ Tº` fWX[TAQVZSWTS OPeSWaS\RS AQVZSWTS
?a^VaP\\ FWX[T ) 0dbVPQT STa IPW[T] e^] QXb #
public class While01 { public static void main(String[] args) int zahl = 1; while (zahl < 5) System.out.println(zahl++); } }
{
3W\S AQVZSWTS VOb R`SW 0SabO\RbSWZS( •
9]^T RS` AQVZSWTS
•
@c[^T RS` AQVZSWTS
•
;]RWTWYObW]\ RS` 0SRW\Uc\U O\RS`\TOZZa 3\RZ]aaQVZSWTS
ÎQd]VT] id\ ?a^VaP\\ FWX[T ÎQd]V ) 7RS\bWTWhWS`S\ AWS Tº` RWSaSa >`]U`O[[ RWS ! 0SabO\RbSWZS SW\S` XSRS` d]ZZ abÉ\RWUS\ AQVZSWTS W\RS[ AWS RWS XSeSWZWUS HSWZS\`]U`O[[ a] ROaa RWS Ac[[S RS` HOVZS\ " US PWZRSb c\R O[ 3\RS RS` AQVZSWTS OcaUSUSPS\ eW`R
$&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'$
BRW[TXUT] 8cTaPcX^] FXTSTaW^[d]V ;^^_
?a^VaP\\ FWX[T!YPeP) 0dbVPQT STa :[TX]QdRWbcPQT] e^] P QXb i
public class While02 { public static void main(String[] args) char buchstabe = 'a'; while (buchstabe `]U`O[[ FWX[T"YPeP []RWTWhWS`b ROa >`]U`O[[ FWX[T!YPeP a] ROaa heO` eSWbS`VW\ 9ZSW\PcQVabOPS\ WbS`WS`b eS`RS\ OPS` RS` S\ba^`SQVS\RS 5`]zPcQVabOPS OcaUSUSPS\ eW`R :Ocb C\WQ]RSBOPSZZS Wab RWS >ZObhZObh`]U`O[[ 3^!YPeP VOb SW\S ÉV\ZWQVS /cTUOPS\abSZZc\U OZZS`RW\Ua a]ZZS\ XSbhb RWS HOVZS\ d]\ # OcaUSUSPS\ eS`RS\ RV d]\ # PSUW\\S\R `ºQYeÉ`ba ?a^VaP\\ 3^!) 0dbVPQT STa IPW[T] e^] $ QXb a¶RZfÊacb public class Do02 { public static void main(String[] args) int zahl = 5; do System.out.println(zahl--); while (zahl > 0); } }
{
ÎQd]V id\ ?a^VaP\\ 3^! :raS\ AWS RWS /cTUOPS [Wb RS` fWX[TAQVZSWTS O\abSZZS RS` S^/\eSWac\U ;»bd]Vbe^abRW[PV
public class While99 { public static void main(String[] args) int zahl = 5; while (zahl > 0) System.out.println(zahl--); } }
{
7[ >`]U`O[[ 3^"YPeP a]ZZ SW\S HOVZ US`ObS\ eS`RS\ 2WS HOVZ ZWSUb heWaQVS\ c\R ' 2WS `WQVbWUS /\be]`b Wab OZa :WbS`OZ W[ >`]U`O[[ TSab Q]RWS`b AWS ZOcbSb " ?a^VaP\\ 3^") 4X]T IPW[ aPcT] import java.util.*; public class Do03 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); int zahl; do { System.out.println("Bitte Zahl zwischen 0-9 eingeben:"); zahl = eingabe.nextInt(); } while (zahl != 4); System.out.println("Treffer! Richtig geraten"); } }
%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'$
BRW[TXUT] 8cTaPcX^] FXTSTaW^[d]V ;^^_
,UX9INRKOLK
*OK-X[TJLUXSJKX,UX9INRKOLK
2WS 4]`AQVZSWTS S`[rUZWQVb SW\S aSV` Y][^OYbS AQV`SWPeSWaS Tº` SW\S :]]^ Ag\bOf( for (Initialisierung; Bedingung; Modifikation) { // Schleifenblock } 7\ RS\ `c\RS\ 9ZO[[S`\ VW\bS` RS[ AQVZºaaSZe]`b U^a abSVS\ OZZS /\UOPS\ RWS Tº` RWS AbScS`c\U SW\S` AQVZSWTS \]beS\RWU aW\R( •
7\WbWOZWaWS`c\U( 4SabZSUS\ RS` /\TO\UaeS`bS Tº` RWS 3\baQVSWRc\U ]P SW\ AQVZSW TS\Rc`QVZOcT S`T]ZUS\ a]ZZ ]RS` \WQVb
•
0SRW\Uc\U( 4]`[cZWS`S\ RSa /caR`cQYa RS` ºPS` RWS 0SS\RWUc\U RS` AQVZSWTS S\baQVSWRS\ a]ZZ
•
;]RWTWYObW]\( Ò\RS`c\US\ RS` ES`bS RWS BSWZ RS` 0SRW\Uc\U aW\R RO[Wb RWS AQVZSWTS W`US\ReO\\ bS`[W\WS`b eS`RS\ YO\\
/Za dWS`bS` BSWZ SW\S` XSRS\ AQVZSWTS [caa RO\\ \]QV RS` AQVZSWTS\PZ]QY Q]RWS`b eS` RS\
/PP &$( Ab`cYb]U`O[[ Tº` 4]`AQVZSWTS HÉVZaQVZSWTS
?a^VaP\\ 5^a ) Zahlen von 1 - 10 ausgeben public class For01 { public static void main(String[] args) { for (int zahl = 1; zahl < 11; zahl++) System.out.println(zahl); } } 7[ 9]^T RWSaS` AQVZSWTS abSVS\ RWS R`SW \]beS\RWUS\ /\UOPS\( •
2SYZO`ObW]\ c\R 7\WbWOZWaWS`c\U RS` 0SRW\Uc\UadO`WOPZS\ iPW[ OcQV :OcTdO`WOP ZS US\O\\b ESWZ RWS :OcTdO`WOPZS VWS` RSYZO`WS`b eW`R VO\RSZb Sa aWQV c[ SW\S Z]YOZS DO`WOPZS RWS OcQV \c` W[ 0Z]QY RS` 4]`AQVZSWTS O\a^`SQVPO` Wab /czS` VOZP RS` AQVZSWTS Wab aWS \WQVb aWQVbPO`
•
4]`[cZWS`c\U RS` 0SRW\Uc\U aSZPab iPW[ +
%!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
•
;]RWTWYObW]\ RS` :OcTdO`WOPZS\ iPW[
2WS 4]`AQVZSWTS eW`R OcQV d]\PWaAQVZSWTS US\O\\b eSWZ RWS :OcTdO`WOPZS RS\ AbO`beS`b O\UWPb RWS bg^WaQVS`eSWaS Rc`QV 7\Y`S[S\b V]QVUShÉVZb eW`R PWa RS` 3\R eS`b S``SWQVb Wab 8] fT[RWTa ATXWT]U^[VT fXaS SXT 5^aBRW[TXUT PdbVTU¶Wac- D]` 3W\b`Wbb W\ RWS AQVZSWTS eW`R RS` AbO`beS`b TSabUSZSUb Rc`QV 7\WbWOZWaWS`c\U RS` :OcTdO`WOPZS\ 2WSa S`T]ZUb \c` SW\[OZ RO\OQV \WS eWSRS` /\aQVZWSzS\R eW`R RWS 0SRW\Uc\U ºPS`^`ºTb 7ab ROa 3`USP\Wa cadT a] eW`R S`ab RS` AQVZSWTS\PZ]QY c\R O\ aQVZWSzS\R RWS ;]RWTWYObW]\ OcaUSTºV`b 0SW UP[bT eW`R O\ ROa 3\RS RS` AQVZSWTS dS` heSWUb c\R R]`b [Wb RS[ T]ZUS\RS\ 0STSVZ eSWbS` US[OQVb A][Wb Wab RWS 4]`AQVZSWTS OcQV Y]^TUSabScS`b aWS eW`R \cZZ[OZ SW\[OZ ]RS` [SV`TOQV Rc`QVUSTºV`b 2WS AQVZSWTS\Y]\ab`cYbS aW\R OcabOcaQVPO` ?a^VaP\\ FWX[T&( U^aBRW[TXUT X\ ?a^VaP\\ 5^a TabTciT] SdaRW fWX[T public class While07 { public static void main(String[] args) { int zahl = 1; while (zahl < 11) { System.out.println(zahl); zahl++; } } } ÎQd]V id\ ?a^VaP\\ 5^a ;]RWTWhWS`S\ AWS ROa >`]U`O[[ a] ROaa \c` XSRS heSWbS HOVZ d]\ PWa OcaUSUS PS\ eW`R OZa] RWS c\US`ORS\ HOVZS\ ! # % ' ;»bd]VbWX]fTXb)
3a `SWQVb RWS 7\Y`S[S\bWS`c\U RS` :OcTdO`WOPZS\ hc É\RS`\ RV RWS AQV`WbbeSWbS d]\ OcT hc S`VrVS\ 2Oa >`]U`O[[5^a!YPeP []RWTWhWS`b ROa >`]U`O[[ 5^a YPeP a] ROaa RWS Ac[[S RS` HOVZS\ d]\ S`[WbbSZb c\R OcaUSUSPS\ eW`R( ?a^VaP\\ 5^a!) Bd\\T STa IPW[T] e^] QXb public class For02 { public static void main(String[] args) { int sum = 0; for (int zahl = 1; zahl ABRW[TXUT) 0QfTXbT]S ^STa ]XRWcPQfTXbT]S. 2Oa ZSbhbS 0SWa^WSZ a]ZZ \]QV SW\[OZ SW\RScbWU RWS 4`OUS YZÉ`S\ ]P RWS 4=@AQVZSWTS SW\S OPeSWaS\RS ]RS` SW\S \WQVbOPeSWaS\RS AQVZSWTS Wab 2Ohc aQV`SWPS\ eW` SW\ >`]U`O[[ ROa hSWUb eWS RS` /PZOcT RSa >`]U`O[[a Wab eS\\ RWS BSabPSRW\Uc\U RS` 4=@AQVZSWTS \WS[OZa S`TºZZb aSW\ YO\\ ?a^VaP\\ 5^a#) 3XT 1TSX]Vd]V Xbc ]XT TaU¶[[c
public class For04 { public static void main(String[] args) { for (int i=0; i < 0;) System.out.println("Ich werde nie ausgegeben"); System.out.println("Programmende"); } } 4OhWb( 2WS 4]`AQVZSWTS Wab SW\S Y]^TUSabScS`bS SW\S OPeSWaS\RS AQVZSWTS W\ RWSaS` 6W\aWQVb dS`UZSWQVPO` [Wb RS` fWX[TAQVZSWTS eSWZ RWS >`ºTc\U RSa P]]ZSaQVS\ /ca R`cQYa d]` 3W\b`Wbb W\ RWS AQVZSWTS S`T]ZUb 1Tb^]STaWTXcT]) •
2WS R`SW /caR`ºQYS W[ 9]^T RS` 4]`AQVZSWTS [ºaaS\ \WQVb W[[S` OZZS d]`VO\ RS\ aSW\ 4SVZb RS` S`abS ]RS` RS` heSWbS /caR`cQY eW`R S` Rc`QV SW\ AS[WY]Z]\ S`aSbhb %#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
?a^VaP\\ 5^a$) 8]XcXP[XbXTad]V PdvTaWP[Q `]U`O[[ 2WS S`abS c\R RWS R`WbbS 9][^]\S\bS W[ 9]^T SW\S` 4=@AQVZSWTS Yr\\S\ Oca SW\S` /cThÉVZc\U d]\ [SV`S `S\ BSWZOcaR`ºQYS\ PSabSVS\ 2WS SW\hSZ\S\ BSWZOcaR`ºQYS eS`RS\ eWS US\S`SZZ PSW /cThÉVZc\US\ W\ 8OdO RO\\ Rc`QV 9][[O OPUSb`S\\b ?a^VaP\\ 5^a%) `ºTc\U OcT AQVZSW TS\S\RS a]ZZbS US\S`SZZ d]\ 5O\hhOVZS\ OPVÉ\UWU US[OQVb eS`RS\ \WQVb hc S[^ TSVZS\ Wab RWS /PT`OUS SW\Sa 5ZSWbY][[OeS`ba 2WSa YO\\ hc 3\RZ]aaQVZSWTS\ TºV`S\ ?a^VaP\\ 5^a&) D]VTf^[[cT 4]S[^bbRW[TXUT fTX[ 6[TXcZ^\\PFTac d]VT]Pd public class For07 { public static void main(String[] args)throws Exception for (float i=0; i != 5.0; i=i+0.2f) { System.out.println(i); if (i > 5) break; } } } %$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
{
'$
BRW[TXUT] 8cTaPcX^] FXTSTaW^[d]V ;^^_
`]PZS[ab`cYbc` eWRS`a^WSUSZ\ c\R OcQV ROa OcaR`ºQYS\ eOa RS` >`]U`O[[WS`S` PSOPaWQVbWUb RO[Wb ROa >`]U`O[[ dS` abÉ\RZWQV eW`R A] Wab h0 RWS 4]`AQVZSWTS PSa]\RS`a USSWU\Sb Tº` ROa 2c`QVZOcTS\ d]\ /``Oga O\RS`S`aSWba Wab ROa 1]RWS`S\ SW\S` 3\RZ]aaQVZSWTS Rc`QV U^a** heO` [rUZWQV dS`abÉ\RZWQVS` Wab OPS` SW\S fWX[TcadTAQVZSWTS ES\\ PS`SWba PSW[ 9]RWS`S\ RS` AQVZSWTS RWS /\hOVZ RS` 2c`QVZÉcTS TSabUSZSUb eS` RS\ YO\\ PWSbSb aWQV RWS HÉVZaQVZSWTS O\ d]\PWaAQVZSWTS ES\\ RWS :OcTdO`WOPZS OcQV \OQV AQVZSWTS\S\RS PS\rbWUb eW`R Wab RWS 5^aAQVZSWTS \WQVb USSWU\Sb RO\\ a]ZZbS RWS FWX[TAQVZSWTS SW\USaSbhb eS`RS\ ES\\ RWS :OcTdO`W OPZS W[ @c[^T [O\W^cZWS`b eW`R Wab RWS 4]`AQVZSWTS SPS\TOZZa \WQVb a] Ucb SW\aSbhPO`
%%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
9INGINZKR[TM\UT9INRKOLKT 5S\Oc a] eWS 740STSVZS USaQVOQVbSZb eS`RS\ Yr\\S\ Wab OcQV SW\S AQVOQVbSZc\U d]\ AQVZSWTS\PSTSVZS\ [rUZWQV h0 YO\\ SW\S EWSRS`V]Zc\U SW\S eSWbS`S EWSRS` V]Zc\U S\bVOZbS\ eS\\ W\\S`VOZP SW\S` U^a/\eSWac\U W[ @c[^T SW\S eSWbS`S U^a AQVZSWTS abSVb /ZZS AbScS`PSTSVZS aW\R OcQV PSZWSPWU Y][PW\WS`PO` ?a^VaP\\ 5^a') 5^aBRW[TXUT bRWPRWcT[]
public class For08 { public static void main(String[] args) { for (int zahl1 = 1; zahl1 `]U`O[[a 5^a(YPeP [Wb SW\S` USaQVOQV bSZbS\ fWX[TAQVZSWTS ;»bd]Vbe^abRW[PV
public class While08 { public static void main(String[] args) { int zahl1 = 1; while (zahl1 `]U`O[[ 1aTPZ YPeP a]ZZ SW\S 7bS`ObW]\ [OfW[OZ [OZ Rc`QVTºV`S\ c\R ROPSW HOVZS\ OcTac[[WS`S\ 2WS Ac[[S RS` HOVZS\ RO`T XSR]QV RS\ ES`b \WQVb ºPS`aQV`SWbS\ 7ab RWSa RS` 4OZZ eW`R RWS AQVZSWTS d]`hSWbWU OPUSP`]QVS\ ?a^VaP\\ 1aTPZ ) 0QQadRW STa BRW[TXUT fT]] Bd\\T TaaTXRWc import java.util.*; public class Break01 { public static void main(String[] args) { int zahl; int summe = 0; Scanner eingabe = new Scanner(System.in); for (int i=0; i < 10; i++) { System.out.println("Bitte Zahl eingeben: "); zahl = eingabe.nextInt(); if ((summe + zahl) > 1000) { System.out.println("Die Summe ist > 1000"); break; } else { summe = summe + zahl; System.out.println("Summe = " + summe); } } } } Bg^WaQVSa /\eS\Rc\UaPSWa^WSZ Tº` RWS QaTPZ/\eSWac\U Wab RS` /PP`cQV SW\S` 3\R Z]aaQVZSWTS( &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'%
B_ad]V0]fTXbd]VT] QaTPZ R^]cX]dT
for (; true ;) { ... if (....) break; }
// Die komplette Schleife wird beendet
0SW USaQVOQVbSZbS\ AQVZSWTS\ eW`R \c` RWS W\\S`S AQVZSWTS OPUSP`]QVS\
IUTZOT[K'T]KOY[TM ;Wb RS` 1]\bW\cS/\eSWac\U eW`R \c` RS` OYbcSZZS AQVZSWTS\Rc`QVZOcT d]`hSWbWU PS S\RSb 3a eW`R hc[ AQVZSWTS\O\TO\U USa^`c\US\ c\R Sa eW`R SW\S S`\ScbS /caeS` bc\U RSa 0]]ZSaQVS\ /caR`cQYa S`hec\US\ 1TXb_XT[) for (int i=0; i`]U`O[[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\ YZOaaWaQVSa /\eS\Rc\UaPSWa^WSZ W[ >aScR]Q]RS aWSVS 9O^WbSZ ' Tº` RWS PSWRS\ ;rUZWQVYSWbS\ SW\S\ AQVZSWTS\Rc`QVZOcT d]`hSWbWU OPhcP`SQVS\ 2Oa >`]U`O[[T`OU[S\b a]ZZ SW\S 3\RZ]aaQVZSWTS S\bVOZbS\ W\ RS` RWS 2ObS\ USZSaS\ eS`RS\ 7\\S`VOZP RS` AQVZSWTS eW`R ºPS`^`ºTb ]P SW\S DS`O`PSWbc\U RS` 2ObS\ S`T]`RS`ZWQV Wab ]RS` \WQVb 0SW 2ObSWS\RS Wab RWS AQVZSWTS PSS\RSb &!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
eVWZS b`cS i WT RObSWS\RS QaTPZ) AQVZSWTS PSS\RS\ WT `]PZS[ hc ZraS\( 6ÉcTWU Wab RWS 0SRW\Uc\U Tº` RWS EWSRS`V]Zc\U ROa D]`VO\RS\aSW\ eSWbS`S` 2ObS\ W[ 3W\ UOPSab`][ ]RS` W\ RS` 1]ZZSQbW]\ /Za] eW`R RWSaS 0SRW\Uc\U e^a RS` /caTºV`c\U RSa AQVZSWTS\`c[^Ta US^`ºTb /PS` eWS Wab RWSaS >`ºTc\U [rUZWQV eS\\ R]QV PSW[ S`abS\ 2c`QVZOcT \]QV UO` \WQVb dS`acQVb e]`RS\ Wab hc ZSaS\- 4]ZUS\RSa 0SWa^WSZ a]ZZ RWSaS >`]PZS[ObWY dS`RScbZWQVS\ ?a^VaP\\ =Tgc ) CTgc e^] BhbcT\X] [TbT] d]S eTaPaQTXcT] import java.io.*; public class Next01 { public static void main (String[] args) throws Exception { BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); String str = " "; while (str != null) { System.out.println("Bitte Text eingeben: "); str = in.readLine(); System.out.println("Verarbeitet wird; " + str); } System.out.println("Programmende"); } } &"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'&
;»bd]Vb\dbcTa U¶a BRW[TXUT]
2Oa >`]U`O[[ a]ZZ BSfb d][ 0WZRaQVW`[ ZSaS\ c\R OZa 3QV] eWSRS` OcaUSPS\ 2WS :SaSaQVZSWTS eW`R PSS\RSb eS\\ RWS 3W\UOPS d][ 0SRWS\S` ]d[[ Wab eS\\ OZa] YSW \S 2ObS\ USZSaS\ e]`RS\ aW\R 2WSa Wab RO\\ RS` 4OZZ eS\\ ROa >`]U`O[[ PSS\RSb eW`R ]V\S 2ObS\SW\UOPS c\bS` ;AEW\R]ea Rc`QV 1B@:1 ÎQd]V id\ ?a^VaP\\ =Tgc 0WbbS bSabS\ AWS ROa >`]U`O[[ Rc`QV 3W\UOPS SW\WUS` HSWZS\ 0SS\RS\ AWS RO\\ ROa >`]U`O[[ c\R abO`bS\ AWS Sa \Sc 5SPS\ AWS RWSa[OZ UO` \WQVba SW\ a]\RS`\ PSS\RS\ AWS Sa a]T]`b EW`R RWS 3W\UOPS ]d[[ dS`O`PSWbSb- EWS dS`VÉZb aWQV ROa >`]U`O[[ eS\\ RWS DO`WOPZS bca [Wb ]d[[ W\WbWOZWaWS`b eW`R- 2WS :rac\U W[ >`]U`O[[ =Tgc YPeP Wab \WQVb PST`WSRWUS\R eSWZ RWS EWSRS`V] Zc\UaPSRW\Uc\U bca , ]d[[ PSW[ S`abS\ 2c`QVZOcT OPUST`OUb eW`R ]Pe]VZ aWS S`ab a^ÉbS` USaSbhb eW`R Rc`QV ROa :SaS\ 4º` RWSaSa W[[S` eWSRS`YSV`S\RS >`]PZS[ ROaa SW\S /PT`OUS RS` 0SRW\Uc\U PSW[ S`abS\ 2c`QVZOcT \]QV \WQVb [rUZWQV Wab eSWZ RWS D]`OcaaSbhc\U TSVZb UWPb Sa dS` aQVWSRS\S :rac\UadO`WO\bS\ ?a^VaP\\ =Tgc!) 4abcTa ;»bd]Vbe^abRW[PV TX]T 4]S[^bbRW[TXUT import java.io.*; public class Next02 { public static void main (String[] args) throws Exception { BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); String str = " "; while (true) { System.out.println("Bitte Text eingeben: "); str = in.readLine(); if (str == null) break; System.out.println("Verarbeitet wird: " + str); } System.out.println("Programmende"); } } 2WS :rac\U Tc\YbW]\WS`b Ucb R]QV eW`R aWS RORc`QV ZSWQVb c\ºPS`aWQVbZWQV eSWZ \WQVb S`YS\\PO` Wab ROaa RWS 3\RZ]aaQVZSWTS \c` d]`USbÉcaQVb Wab eSWZ Sa aSV` e]VZ SW\S YZO` hc T]`[cZWS`S\RS 0SRW\Uc\U Tº` RWS 3\baQVSWRc\U ºPS` ROa AQVZSWTS\S\RS UWPb 2S` ?cSZZbSfb a]ZZ ROa OcaR`ºQYS\ eOa RS` >`]U`O[[WS`S` PSOPaWQVbWUb 2WSaSa HWSZ eW`R VWS` \WQVb S``SWQVb
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
?a^VaP\\ =Tgc") IfTXcTa ;»bd]Vbe^abRW[PV ?a^QT[TbT] e^a ST\ TabcT] BRW[TXUT]SdaRW[PdU
import java.io.*; public class Next03 { public static void main (String[] args) throws Exception { BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); System.out.println("Bitte Text eingeben: "); String str = in.readLine(); while (str != null) { System.out.println("Verarbeitet wird: " + str); System.out.println("Bitte Text eingeben: "); str = in.readLine(); } System.out.println("Programmende"); } } 2WSaSa >`]U`O[[ O`PSWbSb `WQVbWU 2S` /cTPOc Wab Z]UWaQV c\R dS`abÉ\RZWQV /ZZS`RW\Ua VOb Sa RS\ `]PSZSaS\ Rc`QVTºV`S\ 7\ RWSaS[ 0SWa^WSZ Wab ROa RWS ;SbV]RS WPb =Tgc RS` 9ZOaaS BRP]]Ta AWS ZWSTS`b OZa 3`USP\Wa RSa D]`OcaZSaS\a RS\ ES`b cadT eS\\ RS` 3W\UOPSab`][ \]QV eSWbS`S 2ObS\ S\bVÉZb ]RS` UP[bT eS\\ YSW\S 2ObS\ [SV` d]`VO\RS\ aW\R &$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'&
;»bd]Vb\dbcTa U¶a BRW[TXUT]
?a^VaP\\ =Tgc$)
EXTacTb 1TXb_XT[ 2[Pbb 8cTaPc^a U¶a TX]T 2^[[TRcX^] QT]dc iT] import java.util.*; public class Next05 { public static void main (String[] args) { // Erstellen einer Objektsammlung im Speicher ArrayList list = new ArrayList(); list.add(new String("Erstes Objekt")); list.add(new String("Zweites Objekt")); list.add(new String("Drittes Objekt")); // Iterieren durch die Objektsammlung Iterator i = list.iterator(); while(i.hasNext()) { System.out.println(i.next()); } } } 2WS AbO\RO`RPWPZW]bVSY d]\ 8OdO S\bVÉZb dS`aQVWSRS\S 9ZOaaS\ Tº` RWS DS`eOZbc\U d]\ =PXSYbS\ W[ /`PSWbaa^SWQVS` 2WSaSa 0SWa^WSZ PS\cbhb VWS`Tº` RWS 9ZOaaS YP ePdcX[0aaPh;Xbc 2O\\ eW`R SW\S 7\abO\h RS` 9ZOaaS 8cTaPc^a S`hScUb C\R R]`b Wab SW\ AbO\RO`ROZU]`WbV[ca Tº` ROa 7bS`WS`S\ Rc`QV RS`O`bWUS 2ObS\aO[[Zc\US\ W\ RS\ ;S bV]RS\ WPb=Tgc c\R ]Tgc d]`^`]U`O[[WS`b ÎQd]V id\ ?a^VaP\\ =Tgc$ EO\RSZ\ AWS ROa >`]U`O[[ c[ PSW RS` C[eO\RZc\U [Wb 8 A3 # Y][[b SW\S EO`\c\U RWS XSR]QV WU\]`WS`b eS`RS\ YO\\ BSabS\ AWS ROa >`]U`O[[ Ò\RS`\ AWS Sa RO\OQV a] OP ROaa SW\ dWS`bSa =PXSYb VW\hcUSTºUb eW`R c\R RO\OQV ROa =PXSYb ºPS` RS\ 7\RSf [Wb RS` ;SbV]RS aT\^eT USZraQVb eW`R 7X]fTXbT U¶a ST] ;TWaT]ST]) 2WS 9ZOaaS 0aaPh;Xbc Wab BSWZ RSa 1]ZZSQbW]\4`O[Se]`Ya ASWb 8 A3 # aW\R RWS 1]Z ZSQbW]\ OZa ^O`O[Sb`WaWS`PO`S Bg^S\ 5S\S`WQa ^`]U`O[[WS`b 2Oa /`PSWbS\ [Wb 5S \S`WQa Wab SW\ BVS[O Tº` 4]`bUSaQV`WbbS\S c\R eW`R RSaVOZP W\ RWSaS[ 0cQV \WQVb PS VO\RSZb C[ RWS EO`\c\U PSW RS` C[eO\RZc\U hc SZW[W\WS`S\ Wab ROa >`]U`O[[ eWS T]ZUb hc É\RS`\( ?a^VaP\\ =Tgc%)
9!B4 $ aTPSh import java.util.*; public class Next06 { public static void main (String[] args) { // Erstellen einer Objektsammlung im Speicher &%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
ArrayList<String> list = new ArrayList<String>(); list.add(new String("Erstes Objekt")); list.add(new String("Zweites Objekt")); list.add(new String("Drittes Objekt")); // Iterieren durch die Objektsammlung Iterator<String> i = list.iterator(); while(i.hasNext()) { System.out.println(i.next()); } } } 2WS 9ZOaaS BcaX]VC^ZT]XiTa PWSbSb SPS\TOZZa ;SbV]RS\ O\ RWS ^`]PSeSWaS ZSaS\ 2WSaS bSabS\ ]P eSWbS`S B]YS\ W[ Ab`W\U dS`TºUPO` aW\R c\R ZWSTS`\ cadT ]RS` UP[bT OZa 3`USP\Wa 3`ab RO\OQV S`T]ZUb RO\\ [Wb ]TgcC^ZT] ROa SQVbS :SaS\ ?a^VaP\\ =Tgc&) 5¶]UcTb 1TXb_XT[ 2[Pbb BcaX]VC^ZT]XiTa
import java.util.*; public class Next07 { public static void main (String[] args) { String s ="Dies ist nur ein Test"; StringTokenizer st = new StringTokenizer(s); while (st.hasMoreTokens()) System.out.println(st.nextToken()); } }
9ZORLXGMKT 1UT\KTZOUTKT`[S6XUMXGSSOKXYZOR
7\ RS` >`OfWa aW\R W[[S` eWSRS` Ò\RS`c\US\ c\R /\^Oaac\UaO`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 9]\ab`cYbS [caa Oca RS[ ?cSZZbSfb S`YS\\PO` aSW\
•
3W\S HSWZS W[ ?cSZZbSfb a]ZZbS \WQVb [SV` OZa SW\ AbObS[S\b S\bVOZbS\ 0SWa^WSZ(
•
O) f ) O) O )
Y]``SYb Y]``SYb 9SW\ UcbS` AbWZ
0SW 9]\b`]ZZO\eSWac\US\ Tº` AQVZSWTS\PWZRc\U c\R /ZbS`\ObWdS\ a]ZZ SW\US`ºQYb eS`RS\ c[ RWS Ab`cYbc` h0 SW\S` DS`aQVOQVbSZc\U ]^bWaQV Ucb aWQVbPO` hc [OQVS\ 0SWa^WSZS Tº` 74( if (condition) { statements; }
&'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
2Oa T[bT [caa OcT RS`aSZPS\ A^OZbS abSVS\ eWS ROa ROhc USVr`S\RS XU
0Sa]\RS`a eWQVbWU Wab ROa 3W\`ºQYS\ PSW USaQVOQVbSZbS\ /\eSWac\US\(
if (condition) { if (condition) statements; else statements; else statements; }
•
8SRSa bfXcRWAbObS[S\b a]ZZbS SW\ STUPd[c1OaS VOPS\ /czS`RS[ a]ZZbS U`c\R aÉbhZWQV ROa QaTPZAQVZºaaSZe]`b PS\cbhb eS`RS\ /ca\OV[S\ aW\R hc R]Yc[S\ bWS`S\
•
4º` RWS PSa^`]QVS\S\ AbScS`O\eSWac\US\ XU T[bT fWX[T U^a c\R S^ a]ZZbS W[[S` SW\ 0Z]QY Q]RWS`b eS`RS\ OcQV eS\\ RWSaS` Oca \c` SW\S` HSWZS PSabSVb ]RS` a]UO` ZSS` Wab 0SWa^WSZ( while (condition) { statement; }
•
8OdO S`ZOcPb O\ dWSZS\ AbSZZS\ SW\S 9c`haQV`SWPeSWaS OZbS`\ObWd hc RS` OcaTºV`ZW QVS\ 1]RWS`c\U 0SWa^WSZ( O + P + Q) 2WSaS dS`Yº`hbS AQV`SWPeSWaS PSRScbSb \WQVb ROaa O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\R [O\QV[OZ aW\R aWS \c` # HSWZS\ ZO\U 7QV \SV[S RS\ BORSZ O\ c\R P`W\US 7V\S\ VScbS [OZ SW\ aSV` Y][^ZSfSa 0SWa^WSZ Oca RS` >`OfWa C\R RO\\ P`OQVbS S` SW\ >`]U`O[[ ROa eO` heSW 271; z2--) { erg = erg * z1; } return erg; } static void ausgabe(int erg) { System.out.println("Das Ergebnis ist: " + erg); } }
2Oa TS`bWUS >`]U`O[[ ^`]RchWS`b ZSWRS` \]QV SW\S\ C[eO\RZc\UaTSVZS`( "TopDown01d.java uses or overrides a deprecated API." 3`ZÉcbS`c\U( /Za RS^`SQObSR eS`RS\ A^`OQVPSabO\RbSWZS USYS\\hSWQV\Sb RWS dS`OZ bSb aW\R c\R RWS W\ a^ÉbS`S\ DS`aW]\S\ RS` 8OdOA^`OQVS S\bTOZZS\ eS`RS\ 2SaeSUS\ a]ZZbS\ eW` c\aS` >`]U`O[[ \]QV SW\[OZ []RWTWhWS`S\ c[ Sa hcYc\TbaaWQVS` hc [O QVS\ 2Ohc eS`RS\ eW` W[ 3W\UOPS[]RcZ RWS dS`OZbSbS aTPS;X]T;SbV]RS Z^\_[Tcc VTVT] TX]T ]TdT ETabX^] PdbcPdbRWT] 2O[Wb Wab V]TTS\bZWQV SW\ eWQVbWUS` D]` bSWZ RS` ;]RcZO`WaWS`c\U SW\R`cQYad]ZZ RS[]\ab`WS`b ÎQd]V id\ ?a^VaP\\ C^_3^f] S BOcaQVS\ AWS ROa dS`OZbSbS ;]RcZ TX]VPQT Oca USUS\ T]ZUS\RS dS`PSaaS`bS DS`aW]\ `]U`O[[ `SOZWaWS`b Rc`QV RWS AQVZºaaSZer`bS` QaTPZ R^]cX]dT c\R aTcda] 3a UWPb heO` ROa `SaS`dWS`bS E]`b V^c^ RWSaSa eW`R W\ 8OdO OPS` \WQVb US\cbhb
•
2Oa >`]U`O[[ a]ZZbS d]\ ]PS\ \OQV c\bS\ ZSaPO` aSW\ 2OPSW a]ZZbS R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OQVS\ W\bSU`WS`b VOb RWS 8OdOBSQV\]Z]UWS OczS`RS[ RS\ D]`bSWZ ROaa 8OdO Rc`QVUÉ\UWU RWS SW\hWUS >`]U`O[[WS`a^`OQVS Wab dS` eS\RPO` Tº` OZZS /cTUOPS\abSZZc\US\( OcT 1ZWS\b d]S AS`dS`agabS[S\ Tº` A^WS ZS ]RS` C\bS`\SV[S\aO\eS\Rc\US\ Tº` 6O\Rga c\R >2/a Tº` U`OTWaQVS =PS` TZÉQVS\ c\R Tº` 2ObS\PO\Y c\R F;:/\eS\Rc\US\ 2WSaS 3W\VSWbZWQVYSWb dS` SW\TOQVb \Obº`ZWQV \WQVb \c` RWS /caPWZRc\U RS` ;WbO`PSWbS` a]\RS`\ d]` OZZS[ OcQV RWS EO`bc\U RS` >`]U`O[[S %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
•
7[ 0S`SWQV RS` 7\bS`\Sb/\eS\Rc\U c\R RS` 7\bS`\ObW]\OZWaWS`c\U d]\ /^^ZWYO bW]\S\ PWSbSb 8OdO PSabS D]`OcaaSbhc\US\( 2WS >`]U`O[[S aW\R c\WdS`aSZZ SW\ aSbhPO`( Rc`QV AbO\RO`RWaWS`c\U RS` SW\USPOcbS\ 2ObS\bg^S\ Rc`QV RWS DS` eS\Rc\U RSa C\WQ]RSa c\R d]` OZZS[ Rc`QV RWS ;rUZWQVYSWbS\ RS` :]YOZWaWS `c\U RV Rc`QV RWS /\^Oaac\U O\ `SUW]\OZS ]RS` ZÉ\RS`a^ShWTWaQVS 0Sa]\RS` VSWbS\ 0SWa^WSZ Tº` S\UZWaQVS c\R RScbaQVS EÉV`c\UaOcTPS`SWbc\U( import java.util.*; import java.text.*; class Locale01 { public static void main(String[] args) { // Default-Locale (wenn nicht deutsch, dann bitte angegeben) NumberFormat nf1 = NumberFormat.getInstance(); System.out.println(nf1.format(1245.23)); // Englisches Format NumberFormat nf2 = NumberFormat.getInstance(Locale.ENGLISH); System.out.println(nf2.format(1245.23)); } }
•
8OdO >`]U`O[[S aW\R aWQVS` Rc`QV dWSZTÉZbWUS SW\USPOcbS ASQc`Wbg;SQVO\Wa[S\
7\ RS` >`OfWa VOPS\ aWQV W[ 0S`SWQV RS` /\eS\Rc\UaS\beWQYZc\U SW\WUS D]`US VS\aeSWaS\ S\beWQYSZb RWS US`ORS OcQV Tº` 8OdO bg^WaQV aW\R( •
3a eW`R aSV` abO`Y [Wb `]b]bg^W\U
•
3a eW`R VÉcTWU OcT ObbS`\ h0 ;]RSZDWSe1]\b`]Z2SaWU\^ObbS`\ 2Oa BVS[O 1]RWS`^ObbS`\ VOPS\ eW` W[ /PaQV\Wbb &% :rac\Ua[cabS` Tº` AQVZSWTS\ PS`SWba PSVO\RSZb ROa BVS[O 2SaWU\^ObbS`\ eS`RS\ eW` W[ 9O^WbSZ PSa^`SQVS\
+TZ][XLYYVXGINKT
0SW ==AgabS[S\ eW`R SW\ >`]U`O[[agabS[ \WQVb ^`W[É` OZa SW\S /\hOVZ d]\ 4c\Y bW]\S\ USaSVS\ a]\RS`\ OZa SW\S /\aO[[Zc\U d]\ Y]]^S`WS`S\RS\ =PXSYbS\ ;] RcZS\ ]RS` Y]\Y`SbS`( 9ZOaaS\ PSb`OQVbSb 2OPSW YO\\ XSRSa =PXSYb [Wb OZZS\ O\RS `S\ Y][[c\WhWS`S\ Rc`QV ROa AS\RS\ d]\ `]U`O[[PZrQYS\ UWPb Sa SPS\TOZZa RWdS`aS ^`]U`O[[WS` a^`OQVS\c\OPVÉ\UWUS 6WZTa[WbbSZ( h0 >aScR]Q]RS ]RS` Ab`cYb]U`O[[S 2WSaS
&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
($
4]cfdaUbb_aPRWT]
6WZTa[WbbSZ eS`RS\ dS`eS\RSb c[ W\ SW\S` T`ºVS\ 3\beWQYZc\Ua^VOaS Ab`cYbc` c\R /PZOcTT]ZUS RS`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( 2S` >aScR]Q]RS Wab ZSWQVb S`abSZZb ^S` 6O\R ]RS` [Wb XSRS[ PSZWSPWUS\ BSfbSRWb]` 3` Wab ZSWQVb S`ZS`\PO` dS`abÉ\RZWQV c\R aSV` TZSfWPSZ 3W\S ;]RWTWYObW]\ Wab ]V\S >`]PZS[S [rUZWQV 2S` aScR]Q]RS PSaQV`WSPS\S\ /ZU]`WbV[ca W\ 8OdO ;»bd]Vbe^abRW[PV)
public class Kaefer01 { public static void main(String[] args) throws Exception { for (int spinne=1; spinne4( /ca RS[ 8=33RWb]` VS`Oca Wab RWS 2]Yc[S\bObW]\ RW`SYb ºPS` SW\S\ ;S\c^c\Yb S``SWQVPO`( Rc`QV - 6WZTS c\R RO\\ c\bS` 829 2]Yc[S\bObW]\ 2WS />7A^ShWTWYObW]\ Wab ]`UO\WaWS`b \OQV >OQYOUSa 3\beSRS` eÉVZb [O\ RO\\ OcT RS` ZW\YS\ ASWbS UShWSZb SW\ >OYSb Oca c\R ZÉaab aWQV RWS 9ZOaaS\ W\ RWSaS[ >OYSb O\ hSWUS\ ]RS` [O\ PSY][[b OZZS >OQYOUSa [Wb OZZS\ 9ZOaaS\ OZ^VOPSbWaQV a]`bWS`b O\ UShSWUb 2O`ºPS` VW\Oca PWSbS\ RWS 0`]eaS` ºPS` 03/@037B3<jA37B3 2C@16AC 163< RS\ UShWSZbS\ 2W`SYbhcU`WTT OcT SW\S UO\h PSabW[[bS 9ZOaaS 8SRS SW\hSZ\S 9ZOaaS eW`R R]Yc[S\bWS`b [Wb WV`S[ d]ZZS\ OYSbhcUSVr`WUYSWb WV`S` 3W\]`R\c\U W\ RWS DS`S`Pc\UaVWS`O`QVWS c\R [Wb OZZS\ 3ZS[S\bS\ RWS RWSaS 9ZOaaS S\bVÉZb
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! <XcVT[XTUTacT O`O[SbS`eS`b ZWSUb /ca RS` AWQVb RSa /cT`cTS`a Wab SW\S ;SbV]RS SW\S 0ZOQY0]f S` eSWz \WQVb c\R WV\ a]ZZbS OcQV \WQVb W\bS`SaaWS`S\ eWS RWS ;SbV]RS W\bS`\ W[^ZS[S\bWS`b Wab 4º` WV\ Wab \c` eWQVbWU eOa RWS ;SbV]RS ZSWabSb c\R eWS RWS AQV\WbbabSZZS OcaaWSVb FPb eTabcTWc \P] d]cTa BXV]Pcda TX]Ta O`O[SbS`
2WSaS /\UOPS\ aW\R RWS T]`[OZS 4SabZSUc\U eWS SW\S ;SbV]RS OcTUS`cTS\ eW`R RO [Wb RS` 1][^WZS` ºPS`^`ºTS\ YO\\ ]P RS` ;SbV]RS\OcT`cT ag\bOYbWaQV W\ =`R\c\U Wab c\R ]P S` Tº` ROa O\USUSPS\S =PXSYb Phe RWS 9ZOaaS S`ZOcPb Wab 2WS 9ZOaaS AP]S^\ Wab BSWZ ROa >OQYOUSa YPePdcX[ S`YS\\PO` W\ RS` S`abS\ HSWZS RS` 2]Yc[S\ bObW]\ RWSaS` 9ZOaaS !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
O`O[S bS` 2WS /cTUOPS RWSaSa ;SbV]RS\OcT`cTa Wab Sa SW\S HcTOZZahOVZ heWaQVS\ c\R # hc US\S`WS`S\ 2WSaS HOVZ eW`R \OQV /caTºV`c\U RS` ;SbV]RS OZa 3`USP\Wa hc`ºQY USZWSTS`b c\R O\ RWS AbSZZS RWSaSa /cT`cTa USaSbhb a] ROaa RO\OQV RWS ES`bShceSW ac\U O\ RWS DO`WOPZS idUP[[biPW[ S`T]ZUS\ YO\\ ÎQd]V id\ ?a^VaP\\ `]U`O[[ O`O[SbS`a OcT RS` AbO\RO`ROcaUOPS3W\VSWb OcahcUSPS\ EWS Oca RS` />72]Yc[S\bObW]\ hc S`YS\\S\ Wab UWPb Sa SbeO hSV\ dS`aQVWSRS\S ;SbV]RS\ [Wb RS[ O `O[SbS`bg^S\ 7\\S`VOZP SW\S` 9ZOaaS YO\\ Sa OZa] [SV`S`S ;SbV]RS\ USPS\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_aX]c[] ?a^VaP\\ BhbcT\ ) 0aQTXcT] \Xc STa BhbcT\2[Pbb
class System01 { public static void main(String[] args) throws Exception { String name; name = System.getProperty("user.name"); System.out.println(name); } } F^id Z»]]T] bcPcXR X\_^ac0]fTXbd]VT] VT]dcic fTaST]. 3W\S DO`WO\bS Wab RS` 3W\aObh d]\ bcPcXR7[^]`b 2ORc`QV YO\\ RS` /cT`cT d]\ abObW aQVS\ ;S[PS`\ SW\S` 9ZOaaS dS`SW\TOQVb eS`RS\ ?a^VaP\\ BhbcT\!) BcPcXR8\_^ac Ta[PdQc d]`dP[XUXiXTacT] IdVaXUU import static java.lang.System.*; class System02 { public static void main(String[] args) throws Exception { String name; name = getProperty("user.name"); out.println(name); } } 2S` D]`bSWZ Wab RWS Yº`hS`S AQV`SWPeSWaS PSW[ @STS`S\hWS`S\ d]\ bcPcXR;S[PS`\
'XHKOZKTSOZ3KZNUJKTJKXSOZMKROKLKXZKT1RGYYK/TZKMKX
2WS 8OdOAbO\RO`R0WPZW]bVSY S\bVÉZb Tº` XSRS\ ^`W[WbWdS\ 2ObS\bg^ SW\S Y]``Sa^]\ RWS`S\RS 9ZOaaS h0 Tº` RS\ X]cBg^ RWS 9ZOaaS 8]cTVTa ]RS` Tº` RS\ Q^^[TP]Bg^ RWS 9ZOaaS 1^^[TP] 2WSaS 9ZOaaS\ eS`RS\ E`O^^S`9ZOaaS\ 6ºZZS\YZOaaS\ US \O\\b eSWZ aWS RS\ ^`W[WbWdS\ Bg^ SW\^OQYS\ W\ SW\S\ 9ZOaaS\bg^ %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
`]U`O[[WS`S` hcaÉbhZWQVS DS`O` PSWbc\Ua[rUZWQVYSWbS\ RS\\ RWS 9ZOaaS\ S\bVOZbS\ ;SbV]RS\ RWS hcaÉbhZWQV hc RS\ SW\USPOcbS\ =^S`Ob]`S\ OcT RWSaS 2ObS\bg^S\ ]^S`WS`S\ A] S\bVÉZb RWS 9ZOaaS 8]cT VTa h0 RWS T]ZUS\RS ;SbV]RS( static int
parseInt(String s)
Parses the string argument as a signed decimal integer.
?a^VaP\\ 8]cTVTa ) 0aQTXcT] \Xc FaP__Ta:[PbbT] public class Integer01 { public static void main (String[] args) { String str = "125"; int ergebnis = Integer.parseInt(str); System.out.println(ergebnis); } } ESWbS`S 6W\eSWaS hc E`O^^S`9ZOaaS\ TW\RS\ AWS W[ 9O^WbSZ ##
3KZNUJKTG[LX[L
3W\ 4OhWb Oca RS\ PWaVS`WUS\ ÍPc\US\ Wab T]ZUS\RS @SUSZ( Hc[ /cT`cT SW\S` ;SbV]RS [caa RS`S\ AWU\Obc` O`O[SbS` PSYO\\b aSW\ 0STW\RSb aWQV RWS ;SbV]RS \WQVb W\ RS`aSZPS\ 9ZOaaS a] [caa RS` /cT`cT _cOZW TWhWS`b S`T]ZUS\ RV S\beSRS` [Wb RS[ =PXSYb\O[S\ PSW 7\abO\h[SbV]RS\ ]RS` [Wb RS[ 9ZOaaS\\O[S\ PSW 9ZOaaS\[SbV]RS\ ÎQd]V id\ ?a^VaP\\ 8]cTVTa Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa [Wb 6WZTS SW\S` ;SbV]RS RS` 9ZOaaS 8]cTVTa RS` VSfORShW[OZS ES`b RS` DO`WOPZS\ TaVTQ]Xb OcaUSUSPS\ eW`R ;»bd]Vbe^abRW[PV public class Integer02 { public static void main (String[] args) { String str = "125"; int ergebnis = Integer.parseInt(str); System.out.println(Integer.toHexString(ergebnis)); } }
&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" OYSba 2S` d]ZZS _cOZWTWhWS`bS `]U`O[[ S\bVÉZb RWS S`abS HSWZS SW\S X\_^ac/\eSWac\U RSaeSUS\ YO\\ W[ \OQV T]ZUS\RS\ ?cSZZbSfb RWS 9c`haQV`SWPeSWaS PS\cbhb eS`RS\ ÎQd]VT] id\ ?a^VaP\\ 1XV3TRX\P[ ÎQd]V ( 0WbbS YZÉ`S\ AWS Tº` a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USPS\ eS`RS\
"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
O`O[SbS` PSW[ ;SbV] RS\OcT`cT SfOYb W\ RS` @SWVS\T]ZUS S`T]ZUS\ [caa eWS aWS d]\ RS` S[^TO\US\RS\ ;SbV]RS OZa T]`[OZS >O`O[SbS` RSYZO`WS`b ec`RS\ 6WS`hc SW\ 0SWa^WSZ( 3TZ[PaPcX^] PSW[ 3[^TÉ\US`(
void berechnen(int z1, int z2, String s, float z3);
0dUadU Rc`QV(
berechen(zahl1,zahl2,text,zahl3);
2WS 2SYZO`ObW]\ PSaQV`SWPb dWS` T]`[OZS >O`O[SbS` AWS VOPS\ RWS 2ObS\bg^S\ X]c X]c BcaX]V c\R U[^Pc 2WS O`O[SbS` aW\R Tº` RS\ /cT`cTS` c\eWQVbWU RS\\ RWSaS VOPS\ \c` 0SRScbc\U Tº` RS\ 0Z]QY RS` ;SbV]RS OZa] Tº` RWS 7[^ZS[S\bWS`c\U EWQVbWU Tº` RS\ Y]``SYbS\ /cT`cT Wab OZZS`RW\Ua ROaa RWS dWS` >O`O[SbS` W\ RS` @SW VS\T]ZUS O\USZWSTS`b eS`RS\ eWS Sa d][ 3[^TÉ\US` dS`ZO\Ub eW`R 4OhWb( 8OdO O`PSWbSb [Wb >]aWbW]\a^O`O[SbS`\ RV RWS ÍPS`UOPS S`T]ZUb SfOYb S\ba^`S QVS\R WV`S` >]aWbW]\ c\R \WQVb SbeO OZa O`O[SbS` dS` eSQVaSZ\ eº`RS TºV`bS ROa hc TOZaQVS\ 3`USP\WaaS\ ]V\S ROaa PSW RS` 1][^WZWS `c\U ]RS` PSW RS` /caTºV`c\U RSa >`]U`O[[a SW\S 4SVZS`[SZRc\U [rUZWQV eÉ`S 4X]T fXRWcXVT 5aPVT VX[c Tb ]^RW id Z[ÊaT]( ES`RS\ >O`O[SbS` a] O\ RWS OcT`cTS\RS ;SbV]RS USZWSTS`b ROaa RWS =`WUW\OZW\T]`[O bW]\S\ R]`b O\Y][[S\ c\R R]`b OcQV USUSPS\S\TOZZa USÉ\RS`b eS`RS\ Yr\\S\ ]RS` eS`RS\ 9]^WS\ ºPS`USPS\- 9PeP PaQTXcTc X\\Ta \Xc 2P[[ Qh EP[dT
2S` /cT`cT SW\S` ;SbV]RS S`T]ZUb W[[S` a] ROaa RWS ES`bS RS` >O`O[SbS` Y]^WS`b c\R RWSaS 9]^WS\ O\ RS\ /cT`cTS` ºPS`b`OUS\ eS`RS\ RV W\ RWS A^SWQVS`hSZZS RS` T]`[OZS\ >O`O[SbS` Y]^WS`b eS`RS\ 2WSaS` ;SQVO\Wa[ca eW`R 1/:: 0G D/:C3 US\O\\b 2]QV [caa [O\ ROPSW U`c\RaÉbhZWQV heWaQVS\ RS\ heSW /`bS\ d]\ 2ObS\bg^S\ ^`W [WbWdS Bg^S\ c\R @STS`S\hbg^S\ c\bS`aQVSWRS\
"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% ?PaP\TcTa ¶QTaVTQT] d]S T\_UP]VT]
6XOSOZO\K:_VKTGRY6GXGSKZKX
2Oa \OQVT]ZUS\RS >`]U`O[[ RS[]\ab`WS`b eWS RWS >O`O[SbS`ºPS`UOPS S`T]ZUb eS\\ Sa aWQV c[ ^`W[WbWdS 2ObS\bg^S\ VO\RSZb ?a^VaP\\ ]aW bW]\ OcT SW\S` F c\R SW\S` G/QVaS a^SWQVS`\ c\R ºPS`^`ºTb PSW 0SRO`T ]P PSWRS 5O\hhOVZS\eS`bS RS\ ES`b S\bVOZbS\ 2O\\ eW`R SW\S ;SZRc\U O[ 1]\a]ZPWZR aQVW`[ OcaUSUSPS\ ?a^VaP\\ ?d]Zc ) 4\_UP]VT] e^] X]cFTacT] P[b ?PaP\TcTa public class Punkt01 { private int x; private int y; void speichern(int a, int b) { x = a; y = b; } void pruef() { if (x < 0 || y < 0) System.out.println("Der Punkt liegt ausserhalb"); else System.out.println("Der Punkt liegt im Fenster"); } }
"!
(( merker2.doc
Stand: 22.12.2005 13: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\\ ;TTaiTX[T]!) O`O[SbS` OZa DO`WOPZS OZa :WbS`OZ ]RS` OZa /caR`cQY O\USUSPS\ eS`RS\ 2Oa \OQVT]ZUS\RS >`]U`O[[ RS[]\ab`WS`b eWS RWS >O`O[SbS`ºPS`UOPS OZa /caR`cQY Q]RWS`b eS`RS\ YO\\ ?a^VaP\\ ;TTaiTX[T]#) ?PaP\TcTa X] 5^a\ TX]Tb 0dbSadRZb
public class Leerzeilen04 { public static void main (String[] args) int zahl = 5; leerzeilen(zahl / 2 + 1); } static void leerzeilen(int anzahl) { for (int i = 1; i1; z2--) { erg = erg * z1; } return erg; } } 2WSaSa >`]U`O[[ VOb SW\S bcPcXR;SbV]RS hc[ 3``SQV\S\ RS` >]bS\h heSWS` HOVZS\ e]PSW RWS S`abS 5O\hhOVZ OZa 0OaWa c\R RWS heSWbS OZa 3f^]\S\b hc` 0OaWa W\bS` ^`SbWS`b eW`R 7\ RS` 9]^ThSWZS RS` ;SbV]RS _^cT]iXTaT] Wab OZa 3`USP\Wabg^ X]c SW\US b`OUS\ 2Oa PSRScbSb ROaa RS` 1][^WZS` ºPS`^`ºTb ROaa OcQV eW`YZWQV SW\ 3`USP\Wa [Wb aTcda] USZWSTS`b eW`R c\R ROaa RWSaS` ES`b OcQV eW`YZWQV d][ Bg^ X]c Wab 3a UWPb OcQV bg^Z]aS ;SbV]RS\ ROa aW\R ;SbV]RS\ RWS YSW\ 3`USP\Wa ZWSTS`\ 2WSaS eS`RS\ PSW RS` 2SYZO`ObW]\ Rc`QV ROa AQVZºaaSZe]`b e^XS USYS\\hSWQV\Sb O\abSZZS RSa @ºQYUOPSbg^a 2WSa Wab RS` 6W\eSWa ROaa RS` /cT`cTS` \WQVba hc S`eO`bS\ VOb 3\bVÉZb RWS 2SYZO`ObW]\ SW\S` ;SbV]RS ]XRWc ROa AQVZºaaSZe]`b e^XS a] \dbb [Wb aTcda] SW\ 3`USP\Wa hc`ºQYUSUSPS\ eS`RS\ /cQV RWSa eW`R d][ 1][^WZS` ºPS` ^`ºTb 4OhWb( 6Ob SW\S ;SbV]RS SW\S\ @ºQYUOPSbg^ a] [caa VW\bS` AQVZºaaSZe]`b aTcda] SW\ ES`b RWSaSa Bg^a abSVS\) S\bVÉZb RWS 2SYZO`ObW]\ ROUSUS\ ROa AQVZºaaSZe]`b e^XS a] RO`T YSW\ @Sbc`\eS`b d]`VO\RS\ aSW\ 7\\S`VOZP SW\S` ;SbV]RS eW`R RS` /caR`cQY VW\bS` RS[ AQVZºaaSZe]`b aTcda] Y]^WS`b c\R O\ RS\ /cT`cTS` USZWSTS`b Ch_P]_Pbbd]V QTX ST\ ATcda]fTac 4º` RS\ 2ObS\bg^ RSa @Sbc`\eS`ba USZbS\ RWS UZSWQVS\ @SUSZ\ eWS PSW[ /`PSWbS\ [Wb >O`O[SbS`\( •
3a Yr\\S\ a]e]VZ ^`W[WbWdS 2ObS\bg^S\ OZa OcQV @STS`S\hbg^S\ ºPS`USPS\ eS`RS\ 0SW @STS`S\hbg^S\ eW`R RWS @STS`S\h O\ RS\ /cT`cTS` ºPS`USPS\ a] ROaa RWSaS` [Wb RS[ =`WUW\OZ]PXSYb O`PSWbSb
•
5`c\RaÉbhZWQV [caa RS` ES`b RS[ RSTW\WS`bS\ Bg^ S\ba^`SQVS\ 0SW hceSWac\Ua dS`b`ÉUZWQVS\ Bg^S\ TW\RSb SW\S Ocb][ObWaQVS /\^Oaac\U abObb "'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
`]U`O[[ S`[WbbSZb Oca heSW UO\hhOVZWUS\ ES`bS\ RS\ U`rzbS\ US [SW\aO[S\ BSWZS` 2OPSW eSWQVS\ RWS 2ObS\bg^S\ RS` T]`[OZS\ >O`O[SbS` d]\ RS\ Bg^S\ RS` OYbcSZZS\ >O`O[SbS` OP c\R OcQV RS` @Sbc`\bg^ Wab O\RS`a RSYZO`WS`b OZa RS` ES`b RS` 3`USP\WadO`WOPZS\ EWQVbWU ROPSW Wab ROaa RWS Bg^S\ hceSWac\UadS` b`ÉUZWQV aW\R ?a^VaP\\ ATcda] ) IdfTXbd]VbeTacaÊV[XRWT 3PcT]ch_T] public class Return01 { public static void main (String[] args) { short zahl1 = 15; short zahl2 = 48; System.out.println(teiler(zahl1, zahl2)); } static int teiler(int z1, int z2) { int rest; do { rest = z1 % z2; z1 = z2; z2 = rest; } while (rest > 0); return z1; } l 6W\bS` aTcda] YO\\ SW\ /caR`cQY abSVS\ 2S` Bg^ RWSaSa /caR`cQYa PSabW[[b RS\ @ºQYUOPSbg^ RS` ;SbV]RS ?a^VaP\\ ATcda]!) 4X] 0dbSadRZ P[b A¶RZVPQTfTac public class Return02 { public static void main (String[] args) System.out.println(ausgabe("Erwin")); } static String ausgabe(String name) { return "Hallo " + name; } }
{
2S` /caR`cQY VW\bS` RS[ AQVZºaaSZe]`b aTcda] YO\\ OcQV W\ `c\RS 9ZO[[S`\ SW\US TOaab eS`RS\ /czS`RS[ Wab Sa [rUZWQV ROa AQVZºaaSZe]`b aTcda] ]V\S W`US\RSW\S\ ES`b hc PS\cbhS\ RO\\ eW`R RWS AbScS`c\U O\ RS\ /cT`cTS` hc`ºQYUSUSPS\ ]V\S SW\S\ 3`USP\Wabg^ hc ZWSTS`\ D]`OcaaSbhc\U ROTº` Wab \Obº`ZWQV ROaa W[ 9]^T RS` ;S bV]RS O\abSZZS RSa @ºQYUOPSbg^a e^XS SW\USb`OUS\ Wab
#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' IdbP\\T]UPbbd]V
@[YGSSKTLGYY[TM
;SbV]RS\ ZraS\ SWUS\abÉ\RWUS BSWZOcTUOPS\ W\\S`VOZP SW\S` 9ZOaaS AWS VOPS\ SW\S\ `]U`O[[WS`c\U
•
c[ eWSRS`YSV`S\RS >`]U`O[[bSWZS SW\[OZ hc ^`]U`O[[WS`S\ c\R RWSaS RO\\ d]\ dS`aQVWSRS\S\ AbSZZS\ OcThc`cTS\ + EWSRS`dS`eS\RPO`YSWb d]\ 1]R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aS\ aWQV USUS\aSWbWU PS\cb hS\ c\R eSZQVS 0SRScbc\U ROPSW RWS DS`S`Pc\UabSQV\WY VOb)
•
eOa [O\ c\bS` ^eTaaXST d]\ ;SbV]RS\ dS`abSVb)
•
eO\\ RWS AQVZºaaSZer`bS` cWXb c\R bd_Ta PS\rbWUb eS`RS\)
•
ROaa Sa eSWbS`S A^`OQV[WbbSZ UWPb Tº` RWS 0SaQV`SWPc\U d]\ 9ZOaaS\bg^S\ h0 X]cTaUPRT c\R T]d\
=GYYZKNZOTKOTKX1RGYYKTHKYINXKOH[TM%
3W\S 9ZOaaS S\bVÉZb RWS 0SaQV`SWPc\U Tº` SW\S ;S\US d]\ =PXSYbS\ 2Ohc eS`RS\ RWS 2ObS\ RWS 4SZRS` RSYZO`WS`b c\R RS` /caTºV`c\UaQ]RS hc` DS`O`PSWbc\U RWSaS` 2ObS\ Q]RWS`b 3W\S 9ZOaaS VOb W\ 8OdO T]ZUS\RS\ /cTPOc( class identifier { // Class-Body, bestehend aus : // Konstruktoren // Instanz-/Klassen-Variablen und // Instanz-/Klassen-Methoden }
#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
FPb bcTWc X] TX]Ta :[PbbT]QTbRWaTXQd]V.
2WS 9ZOaaS PSabSVb Oca heSW BSWZS\ RS` 9ZOaaS\RSYZO`ObW]\ c\R RS[ 9ZOaaS\`c[^T 2WS 2SYZO`ObW]\ PSUW\\b [Wb RS[ AQVZºaaSZe]`b R[Pbb 2O\OQV T]ZUb RS` `]U`O[[ S\bVÉZb SW\S 9ZOaaS\PSaQV`SWPc\U Tº` RWS DS`O`PSWbc\U d]\ 2ObS\ RS` 5SaQVÉTba^O`b\S` SW\S` 4W`[O 2WS 9ZOaaS Wab aSV` SW\TOQV c\R VOb RWS /cT UOPS 2ObS\ hc a^SWQVS`\ c\R hc dS`O`PSWbS\ RWS a]e]VZ Tº` 9c\RS\ OZa OcQV :WS TS`O\bS\ PS\rbWUb eS`RS\ 2WS 9ZOaa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RGYYK-XKMUXOGT)GRKTJGX
/ZZSW\ Tº` ROa /`PSWbS\ [Wb 2Obc[ c\R CV`hSWb UWPb Sa hOVZ`SWQVS d]`USTS`bWUbS :r ac\US\ OPVÉ\UWU d]\ HSWbh]\S\ c\R Z]YOZS\ 0Sa]\RS`VSWbS\ AWS aW\R BSWZ RSa AbO\RO`R/>7 2O Sa eSZbeSWb c\bS`aQVWSRZWQVS 9OZS\RS` UWPb RWS cO OPVÉ\UWU aW\R d][ 0SUW\\ RS` HSWb`SQV\c\U VOPS\ RWS 8OdO3\beWQYZS` SW\S A^ShWOZWaWS`c\U SW\US TºV`b \É[ZWQV RS\ 6aTV^aXP]2P[T]SPa 2WS 2]Yc[S\bObW]\ S\bVÉZb ROTº` SW\S Oca TºV`ZWQVS 0SaQV`SWPc\U 6WS` SW\ /caaQV\Wbb( java.util Class
GregorianCalendar
Field Summary static int AD
Value of the ERA field indicating the common era (Anno Domini), also known as CE.
static int BC
Value of the ERA field indicating the period before the common era (before Christ), also known as BCE.
is a concrete subclass of Calendar and provides the standard calendar system used by most of the world.
GregorianCalendar
Constructor Summary Constructs a default GregorianCalendar using the current time in the default time zone with the default locale.
GregorianCalendar()
GregorianCalendar(int year, int month, int dayOfMonth) Constructs a GregorianCalendar with the given date set in the
default
time zone with the default locale
Method Summary void add(int field, int amount)
Adds the specified (signed) amount of time to the given calendar field, based on the calendar's rules.
Object clone()
Creates and returns a copy of this object.
proteccomputeFields() Converts the time value ted void from the Epoch) to calendar field values.
(millisecond offset
#&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" <XcVT[XTUTacT :[PbbT QT]dciT]
c\Yb ^ OcT f + c\R g + # 0S\cbhS\ AWS ROhc RWS ;SbV]RS \^eT 5SPS\ AWS RWS \ScS\ =PXSYbeS`bS Oca 0S\cbhS\ AWS ROhc RWS ;SbV]RS VTc;^RPcX^] ÎQd]V !( 3`VrVS\ AWS RS\ fES`b c[ # c\R RS\ gES`b c[ 0S\cbhS\ AWS ROhc RWS ;SbV]RS caP]b[PcT
(KOYVOKR 1RGYYK)URUX
/cQV RWS 9ZOaaS 2^[^a Wab BSWZ RSa YPePPfc>OQYOUSa AWS YO^aSZb 4O`PO\UOPS\ \OQV RS[ @50 4O`P[]RSZZ 8SRS 4O`PS eW`R ROPSW Oca SW\S` ;WaQVc\U d]\ @]b 5`º\ c\R 0ZOc PSaQV`WSPS\ e]PSW XSRS 4O`PS SW\S\ /\bSWZ d]\ ## VOPS\ YO\\ RWS ;WaQVc\U YO\\ OcQV ^`]hS\bcOZ OZa TZ]ObES`b heWaQVS\ c\R O\USUSPS\ eS`RS\ A] S`USPS\ h0 RWS ES`bS ## XSeSWZa Tº` @]b c\R 5`º\ Y][PW\WS`b [Wb RS[ ES`b Tº` 0ZOc RWS 4O`PS USZP EW` e]ZZS\ SW\ >`]U`O[[ S`abSZZS\ ROa [SV`S`S 1]Z]`=PXSYbS [Wb c\bS`aQVWSRZW QVS\ dS`aQVWSRS\S\ 4O`PSW\abSZZc\US\ S`abSZZb 2WSaS =PXSYbS Yr\\bS\ RO\\ PSW a^WSZaeSWaS Tº` ROa /`PSWbS\ [Wb U`OTWaQVS\ 0S\cbhS`]PS`TZÉQVS\ US\cbhb eS`RS\ ?a^VaP\\ 5PaQT] ) 3XT :[PbbT YPePPfc2^[^a
import java.awt.*; class Farben01 { public static void main (String[] args) { Color c1 = new Color(255,0,0); Color c2 = c1.darker(); System.out.println("Farbe 1 " + c1); System.out.println("Farbe 2 " + c2); System.out.println(c1.getRed()); } } 2Oa S`abS AbObS[S\b W\ RS` \PX];SbV]RS S`hScUb SW\S 7\abO\h RS` 9ZOaaS 2^[^a 2O PSW eS`RS\ RS[ 9]\ab`cYb]` RWS R`SW 4O`PeS`bS Tº` `]b U`º\ c\R PZOc ºPS`USPS\ ÎQd]VT] id\ ?a^VaP\\ 5PaQT] ÎQd]V ) 9ZÉ`S\ AWS O\VO\R RS` />72]Yc[S\bObW]\ RWS /`PSWbeSWaS RS` ;SbV]RS\ SPaZTa c\R VTcATS ÎQd]V !) 7\abO\hWWS`S\ AWS SW\ R`WbbSa 1]Z]`]PXSYb Tº` RWS 4O`PS USZP c\R USPS\ AWS RWS =PXSYbeS`bS [Wb _aX]c[] Oca
$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
+OMKTK1RGYYKTKXYZKRRKT
/Za Ag\]\g[ Tº` SW\S 9ZOaaS YO\\ RS` 0SU`WTT aSZPab S`abSZZbS` 2ObS\bg^ VWZT`SWQV aSW\ 2WS 9ZOaaS PSaQV`SWPb RS\ /cTPOc d]\ A^SWQVS`^ZÉbhS\ 4SZRS` c\R RWS ROTº` [rUZWQVS\ =^S`ObW]\S\ ;SbV]RS\ US\Oc a] eWS Sa PSW RS\ SW\USPOcbS\ SW\TO QVS\ 2ObS\bg^S\ OcQV RS` 4OZZ Wab ES\\ RWS W\ RS` 9ZOaaS RSYZO`WS`bS\ A^SWQVS`^ZÉb hS W[ /`PSWbaa^SWQVS` O\USZSUb c\R [Wb ES`bS\ USTºZZb eS`RS\ a]ZZS\ RO\\ USaQVWSVb RWSa Rc`QV ROa 3`hScUS\ d]\ 7\abO\hS\ [Wb RS[ AQVZºaaSZe]`b ]Tf EW` eS`RS\ \c\ SWUS\S 9ZOaaS\ PSaQV`SWPS\ c\R RO[Wb O`PSWbS\
(KOYVOKRLXKOT.GRRU=KRZ6XUMXGSSGRYYKVGXGZK1RGYYK ?a^VaP\\ 7P[[^ ) 4X]T VP]i TX]UPRWT :[PbbT public class Hallo01 { private String text = new String("Hallo Welt"); void ausgeben() { System.out.print("Die Variable text enthaelt: "); System.out.println(text); } } 2WSaS 9ZOaaS YO\\ SW\S BcaX]VDO`WOPZS a^SWQVS`\ c\R PSW 0SRO`T Rc`QV /cT`cT RS` ;SbV]RS PdbVTQT] O[ 9]\a]ZPWZRaQVW`[ eWSRS` OcaUSPS\ 7 [WbUSZWSTS`b ÎQd]V id\ ?a^VaP\\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?cSZZbSfbRObSW hcaO[[S\ hc TOaaS\ 3W\S 4`OUS RWS RO PSW USYZÉ`b eS`RS\ [caa Wab( EWS [caa RS` `] U`O[[ Oca /PaQV\Wbb hc`ºQY 2]`b ec`RS RWS 9ZOaaS 5SaQVÉTba ?Pac]Ta RS TW\WS`b =PXSYbS Yr\\S\ 9c\RS\ ]RS` OcQV :WSTS`O\bS\ aSW\ 2WSaS 9ZOaaS e]ZZS\ eW` OZa 0OaWaYZOaaS dS`eS\RS\ aWS aWSVb XSbhb ZSWQVb []RWTWhWS`b eWS T]ZUb Oca( ?a^VaP\\ ?Pac]Ta) 1TbRWaTXQd]V e^] :d]ST] d]S ;XTUTaP]cT]^QYTZcT]
class Partner { private int nr; private String name; Partner(int nr1, String name1) { nr = nr1; name = name1; } void ausgeben() { System.out.println(nr + " " + name); } void setName(String name1) { %#
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
name = name1; } } 5SUS\ºPS` RS` c`a^`º\UZWQVS\ DS`aW]\ S\bVÉZb RWSaS 9ZOaaS SW\S\ 9]\ab`cYb]` ROTº` Wab RWS ;SbV]RS ]Td S\bTOZZS\ 4afTXcTad]V STa 0dUVPQT]bcT[[d]V
/\US\][[S\ eW` e]ZZS\ W\ SW\S[ C\bS`\SV[S\ b_TiXT[[T 8]U^a\PcX^]T] ºPS` :d]ST] a^SWQVS`\ c\R dS`O`PSWbS\ 2WSaS 7\T]`[ObW]\S\ PSabSVS\ Oca T]ZUS\RS\ 4SZRS`\( 9c\RS\\c[[S` O`b\S`9ZOaaS SW\ VO\RUSaQV`WSPS\S` 9]\ab`cYb]` SW\US TºUb ec`RS eW`R RS` 2STOcZb9]\ab`cYb]` \WQVb Ocb][ObWaQV S`abSZZb a]\RS`\ [caa OcQV VO\RUSaQV`WSPS\ eS`RS\ /Za] [caa ZSRWUZWQV SW\S HSWZS VW\hcUSTºUb eS`RS\ 3XT ]TdT :[PbbT ?Pac]Ta P bXTWc YTcic b^ Pdb) class Partner01a { private int nr; private String name; Partner01a() {} Partner01a(int nr1, String name1) { nr = nr1; name = name1; } void ausgeben() { System.out.println(nr + " " + name); } void setName(String name1) { name = name1; } }
// neu
ÎQd]V id\ ?a^VaP\\ ?Pac]Ta P 3`UÉ\hS\ AWS RWS PSabSVS\RS ?cSZZbSfbRObSW [Wb RS\ PSWRS\ 9ZOaaS\ ?Pac]Ta P c\R :d]ST c[ SW\S \ScS 9ZOaaS ;XTUTaP]c 2WSaS 9ZOaaS a]ZZ RWS /bb`WPcbS c\R ;SbV]RS\ RS` 9ZOaaS ?Pac]Ta P S`PS\ HcaÉbhZWQV a]ZZ aWS ROa /bb`WPcb aPQPcc d][ 2ObS\bg^ U[^Pc PSY][[S\ c\R S\ba^`SQVS\RS ;SbV]RS\ hc[ /caUSPS\ c\R C^RObS\ RWSaS` ;S[PS`dO`WOPZS\ ;»bd]Vbe^abRW[PV
class Lieferant extends Partner01a { private float rabatt; void ausgeben() { super.ausgeben(); System.out.println("Rabatt: " + rabatt); } void setRabatt(float rabatt) { this.rabatt = rabatt; } k
%%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
8Sbhb VOPS\ eW` TX]T D\fP]S[d]VbTX]WTXc [Wb RS\ R`SW 9ZOaaS\ ?Pac]Ta P :d] ST /QVbc\U( [caa OcQV d]\ ?Pac]Ta P OPUSZSWbSb aSW\ ;XTUTaP]c 2WS 0ShWSVc\ US\ heWaQVS\ RWSaS\ 9ZOaaS\ PS`cVS\ OcT DS`S`Pc\UabSQV\WY C\R RWSa YO\\ U`O TWaQV RO`USabSZZb eS`RS\ [Wb RS` C;:O`b\S`O /bb`WPcbS( \` \O[S ;SbV]RS\( OcaUSPS\ aSb`]U`O[[agabS[a [ºaaS\ \]QV S`ZÉcbS`b eS`RS\( •
2WS 9ZOaaS ?Pac]Ta P Wab RWS =PS`YZOaaS ]RS` Ac^S`YZOaaS ]RS` DObS`YZOaaS Tº` RWS PSWRS\ O\RS`S\ 9ZOaaS\
•
2WS 9ZOaaS\ :d]ST c\R ;XTUTaP]c eS`RS\ OZa C\bS`YZOaaS ]RS` AcPYZOaaS ]RS` 9W\RYZOaaS PShSWQV\Sb
3W\S 9ZOaaS Wab RSTW\WS`b Rc`QV WV`S\ `]U`O[[ ?a^VaP\\ 4]d\CTbc!) Ch_bXRWTaWTXc ]XRWc VTfÊWa[TXbcTc
public class EnumTest02 { // Tageszeit static final int MORGENS = 0; static final int MITTAG = 1; static final int ABENDS = 2; // Farben static final int ROT static final int BLAU
= 0; = 1;
public static void main(String[] args) { int tageszeit = BLAU; // FALSCH ! Keine Kontrolle if (tageszeit == MITTAG) System.out.println("Guten Tag"); } } 2Oa >`]U`O[[ UWPb RS\ ;WbbOUaU`cz Oca ]Pe]VZ RS` 7\VOZb RS` DO`WOPZS\ cPVTbiTXc PZOc Wab 2S\\( 7[ 5SUS\aObh hc[ T]d\Bg^ UWPb Sa YSW\S Bg^aWQVS`VSWb RS` ES`b RS` DO`WOPZS\ cPVTbiTXc YO\\ SW\ PSZWSPWUS` 7\bSUS`eS`b aSW\ ESWbS`S D]`bSWZS PSW[ 3W\aObh d]\ T]d\ O\abSZZS d]\ UX]P[9]\abO\bS\( •
ES\\ SW\S eSWbS`S 9]\abO\bS VW\hcY][[b ]RS` SW\S PSabSVS\RS aWQV É\RS`b [caa ZSRWUZWQV RWS T]d\0SaQV`SWPc\U USÉ\RS`b eS`RS\ c\R \WQVb OZZS 9ZOaaS\ [Wb RS` /cThÉVZc\U d]\ UX]P[4SZRS`\ 2Oa S`VrVb RWS EO`bc\UaT`Sc\RZWQVYSWb
'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
•
3a UWPb SW\S OZZUS[SW\S 0OaWaYZOaaS Tº` OZZS 3\c[S`ObW]\abg^S\ RWS 9ZOaaS 4 ]d\ 2Od]\ S`Pb XSRS T]d\0SaQV`SWPc\U 2Oa VSWzb Sa abSVS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UabS >`W\hW^ PSW RS` 3\beWQYZc\U d]\ 32DAgabS[S\ RWS ;]RcZO`WaWS`c\U Wab 3W\ >`] U`O[[WS`S` POcb aSW\S /\eS\Rc\U Oca ^`W[WbWdS\ 5`c\RPOcabSW\S\ Oca ;]RcZS\ hcaO[[S\ dS`UZSWQVPO` RS` >ZObbS\POceSWaS W[ E]V\c\UaPOc ]RS` RS` ;]RcZ POceSWaS PSW bSQV\WaQVS\ 5S`ÉbS\ =PXSYbPOaWS`bS >`]U`O[[agabS[S eS`RS\ OcT RS` 5`c\RZOUS WV`S` 2ObS\ab`cYbc` []RcZO`WaWS`b c\bS` 0S`ºQYaWQVbWUc\U OZZS` =^S`ObW]\S\ RWS [Wb RWSaS` 2ObS\ab`cYbc` OcaUSTºV`b eS`RS\ Yr\\S\ 7\ RWSaS[ 9O^WbSZ PSY][[S\ AWS /\be]`bS\ OcT T]ZUS\RS 4`OUS\( •
EOa dS`abSVb [O\ c\bS` RS[ AQVZOUe]`b ;]RcZ Wab Sa SW\S 9ZOaaS SW\ =PXSYb SW\ >OYSb-
•
ESZQVS 5`º\RS a^`SQVS\ Tº` RWS ;]RcZO`WaWS`c\U-
•
EO`c[ Wab Sa eWQVbWU RWS >`W\hW^WS\ S\QO^acZObW]\ c\R W\T]`[ObW]\ VWRW\U hc PSOQVbS\-
•
EWS Wab RWS ]PXSYb]`WS\bWS`bS D]`USVS\aeSWaS PSW[ @SOZWaWS`S\ d]\ A]TbeO`Saga bS[S\- EOa Wab ==/ ==2 c\R ==>-
•
EOa Wab C;: c\WTWSR []RSZW\U ZO\UcOUS c\R eO\\ eW`R RWSaS ObbS`\ c\R 4`O[Se]`Y-
'"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! FPb Xbc TX] `]U`O[[bSWZS RWS U^[VT]ST 4XVT]bRWPUcT] VOPS\( •
;]RcZS TOaaS\ =^S`ObW]\S\ c\R 2ObS\ hc SW\S[ >`]U`O[[bSWZ hcaO[[S\
•
;]RcZS S`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ObWaWS`S\ RS` W\bS`\S\ 3ZS [S\bS 7\aPSa]\RS`S RWS 2ObS\SZS[S\bS a]ZZS\ d]\ OczS\ \WQVb hcU`SWTPO` aSW\ ESRS` ROa RW`SYbS :SaS\ c\R S`ab `SQVb \WQVb ROa DS`É\RS`\ RWSaS` /bb`WPcbS a]ZZS\ Rc`QV ;SbV]RS\ O\RS`S` 9ZOaaS\ [rUZWQV aSW\ ;O\QV[OZ eS`RS\ ;]RcZS RWSaS` /`b OcQV OZa OPab`OYbS 2ObS\bg^S\ PShSWQV\Sb RO[Wb eW`R OcaUSR`ºQYb ROaa RWS 2ObS\ Ocb]\][ W[^ZS[S\bWS`b aW\R c\R d]\ WV\S\ \c` /Pab`OYbW]\S\ PSYO\\b aW\R 2Oa VSWzb RWS @SOZWaWS`c\U PZSWPb dS`P]`US\ c\R RS` HcU`WTT OcT RWS 2ObS\TSZRS` YO\\ \c` [WbbSZa hcUSZOaaS\S` =^S`ObW]\S\ S`T]ZUS\ ÍPS` HcU`WTTa[]RWTWS` aWSVS 9O^WbSZ $ eW`R ^`] 3ZS[S\b RWS AbcTS RS` 9O^aSZc\U _aXePcT _a^cTRcTS ]RS` _dQ[XR TSabUSZSUb •
2c`QV 9S\\hSWQV\c\U RS` 2ObS\ OZa _aXePcT aW\R aWS d]` c\PS`SQVbWUbS[ HcU`WTT USaQVºbhb eSWZ aWS \c` W\\S`VOZP RS` SWUS\S\ 9ZOaaS PS\cbhb eS`RS\ Yr\\S\
'$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!! QYTZc^aXT]cXTacT BhbcT\T]cfXRZ[d]V
/YG(K`OKN[TMTSWZ OcaUSVS\R d]\ RS` AcPYZOaaS W\ @WQVbc\U Ac^S`YZOaaS RO`USabSZZb
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!
`W\hW^WS\ RS` 9O^aSZc\U c\R RSa 7\T]`[ObW]\ 6WRW\U Y]\ aS_cS\b SW\USVOZbS\ eS`RS\ 2WS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OTbS\ RO` aWS eW`R OcQV OZa WabSW\0ShWSVc\U PS hSWQV\Sb
!%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!
/> eW`R Rc`QV /YbWdWbÉbaRWOU`O[[S RS` 9]\b`]ZZTZcaa U`OTWaQV RO`USabSZZb E^acTX[ STa D/> ]RS` `]U`O[[WS`c\U c\bS`aQVSWRSb aWQV d]\ ab`cYbc`WS`bS` >`]U`O[[WS `c\U \WQVb \c` RORc`QV ROaa 2ObS\ c\R 4c\YbW]\S\ Y]\aS_cS\b USYO^aSZb c\R RO [Wb USaQVºbhb ^`WdOb aW\R a]\RS`\ OcQV RORc`QV ROaa RWS A]TbeO`SagabS[S Oca c\S\RZWQV dWSZS\ YZSW\S\ =PXSYbS\ PSabSVS\ RWS [WbSW\O\RS` `OfWa PS`cVS\ 0SaQV`WSPS\ eS`RS\ RWSaS 3[^TSVZc\US\ W\ a] US\O\\bS\ 2SaWU\ >ObbS`\ 2WSaS 3\bec`Ta[cabS` PSaQV`SWPS\ aQVS[ObWaQVS :]ac\US\ \WQVb \c` Tº` 2SaWU\^`]PZS[S eWS RS` `]U`O[[WS`a^`OQVS AWS PSaQV`SWPS\ RWS :rac\Ua O\aÉbhS Tº` VÉcTWU eWSRS`YSV`S\RS AbO\RO`R^`]PZS[S hcaO[[S\USb`OUS\ c\R YObO Z]UWaWS`b d]\ S`TOV`S\S\ >`]U`O[[WS`S`\ 3a UWPb [WbbZS`eSWZS dWSZS 6c\RS`b >ObbS`\ dS`rTTS\bZWQVb W\ SW\WUS\ 2cbhS\R 0ºQVS`\ 9]\Y`Sb VO\RSZb Sa aWQV ROPSW c[ W\ RS` >`OfWa PSeÉV`bS :rac\US\ W\ 4]`[ d]\ 3[^TSVZc\US\ 2WSaS Yr\\S\ RO\\ [Wb US`W\US[ ;]RWTWYObW]\aOcTeO\R a] ]RS` a] ÉV\ZWQV SW\USaSbhb eS`RS\ 2SaWU\ >ObbS`\ POaWS`S\ RO[Wb OcT heSW PS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Uc\U [Wb 2SaWU\ >ObbS`\ Wab ROaa VÉcTWU eWSRS`YSV`S\ RS >`]PZS[S RORc`QV SW\S\ ZÉbhS [Wb SW\S[ 7\RSf d]\ PWa @STS`S\hDO`WOPZS
d\bPci
!
/PP!( /``Og W[ /`PSWbaa^SWQVS` 4OhWb( 0SW RS` 2STW\WbW]\ eW`R SXT 0]iPW[ RS` 3ZS[S\bS O\USUSPS\ c\R \WQVb SbeO RWS VrQVabS >ZObhZÉbhS RS` @SWVc\U [Wb ES`bS\ USTºZZb eS`RS\
!"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"! 8]XcXP[XbXTaT] e^] 0aaPhb
2WS /\UOPS RS` 9][^]\S\bS\O\hOVZ YO\\ TSVZS\ eS\\ ROa /``Og OZa T]`[OZS` >O `O[SbS` SW\S` ;SbV]RS RSTW\WS`b eW`R SW\ bg^WaQVSa 0SWa^WSZ ROTº` S\bVÉZb RWS \PX] ;SbV]RS R]`b Wab SW\ Ab`W\U/``Og OZa 3[^TO\Ua^O`O[SbS` RSTW\WS`b /PS` Sa UWPb W\ 8OdO YSW\S ;rUZWQVYSWb RWS /\hOVZ RS` 3ZS[S\bS hc É\RS`\ eS\\ ROa /``Og SW\[OZ W[ /`PSWbaa^SWQVS` O\USZSUb Wab ;O\ aOUb RWS 6a»vT TX]Tb 0aaPhb Xbc bcPcXbRW ES`RS\ Rg\O[WaQVS /``Oga PS\rbWUb a] [caa RWS AbO\RO`RYZOaaS ETRc^a PS\cbhb eS`RS\ ]RS` SW\S O\RS`S 9ZOaaS RSa 4`O[Se]`Ya 2^[[TRcX^] ÎQd]V 3`abSZZS\ AWS SW\ \ScSa >`]U`O[[ [Wb SW\S` @STS`S\hdO`WOPZS\ 2WSaS DO`WOPZS a]ZZ RWS 4ÉVWUYSWb VOPS\ OcT SW\ /``Og [Wb U[^PcDO`WOPZS\ hc `STS`S\hWS`S\ 2WS @STS `S\hdO`WOPZS a]ZZ RS\ 7RS\bWTWS` iPW[T] VOPS\ 2O\OQV a]ZZ ROa /``Og W[ /`PSWbaa^SW QVS` O\USZSUb eS`RS\ 0S\rbWUb eS`RS\ " 3ZS[S\bS ;»bd]Vbe^abRW[PV public class Array02 { public static void main(String[] args) float[] zahlen; zahlen = new float[4]; } }
{
/TOZOGROYOKXKT\UT'XXG_Y
0SW[ /\ZSUS\ RSa A^SWQVS`^ZObhSa Tº` ROa SWUS\bZWQVS /``Og]PXSYb Wab Sa c\PSRW\Ub S`T]`RS`ZWQV ROaa /\UOPS\ hc RS` 5`rzS RSa /``Oga US[OQVb eS`RS\ 2WS 5`rzS S` UWPb aWQV Oca RS` /\hOVZ RS` 9][^]\S\bS\ RS` @SWVc\U c\R RWS YO\\ OcT heSW /` bS\ TSabUSZSUb eS`RS\ Hc\ÉQVab Wab Sa [rUZWQV ROaa W[ 2SYZO`ObW]\aabObS[S\b SW\S 5O\hhOVZ ]RS` SW\ /caR`cQY RS` SW\S 5O\hhOVZ S`UWPb abSVb(
int[] zahlenreihe = new zahlenreihe[a + 5];
0SW RWSaS` AQV`SWPeSWaS eS`RS\ RWS SW\hSZ\S\ 9][^]\S\bS\ [Wb 2STOcZbeS`bS\ W\WbW OZWaWS`b OPVÉ\UWU d][ 2ObS\bg^ 3W\S O\RS`S ;rUZWQVYSWb PSabSVb RO`W\ RWS 3ZS[S\bS PSW WV`S` 2SYZO`ObW]\ [Wb W\RWdW RcSZZS\ /\TO\UaeS`bS\ hc TºZZS\ hc W\WbWOZWaWS`S\ 7\ RWSaS[ 4OZZ YO\\ RWS /\UOPS RS` /\hOVZ S\bTOZZS\ aWS S`UWPb aWQV Oca RS` /\hOVZ RS` ES`bS RWS OZa Y][[OUS b`S\\bS :WabS W\ USaQVeSWTbS\ 9ZO[[S`\ abSVb(
int[] zahlenreihe = {5, 3, 4, 17, 21};
0SW RWSaS` 9c`haQV`SWPeSWaS S\bTÉZZb OcQV ROa AQVZºaaSZe]`b ]Tf RS` 1][^WZS` S` [WbbSZb RWS /\hOVZ RS` 3ZS[S\bS Oca RS` :WabS aSZPab !#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"
ATXWd]VT] QT]dciT] PaaPhb
?a^VaP\\ 0aaPh") 3TZ[PaPcX^] d]S X]SXeXSdT[[T 8]XcXP[XbXTad]V TX]Tb 0aaPhb public class Array03 { public static void main(String[] args) int[] umsatz = {100,200,300,0,0}; umsatz[4] = 1100; System.out.println(umsatz[1]); } }
{
7\ RS` HSWZS ! eW`R RWS @STS`S\hdO`WOPZS d\bPci RSYZO`WS`b 5ZSWQVhSWbWU eW`R ROa /` `Og]PXSYb S`hScUb c\R RS\ Tº\T 9][^]\S\bS\ RWS ES`bS Oca RS` :WabS RS` Tº\T X]c :WbS`OZS hcUSeWSaS\ 2ORc`QV eS`RS\ RWS 9][^]\S\bS\ RSa /``Oga W\WbWOZWaWS`b 2WS RO`OcT T]ZUS\RS SW\hSZ\S ES`bShceSWac\U OR`SaaWS`b ROa ZSbhbS 3ZS[S\b W\ RS` @SW Vc\U C\R [Wb RS` ZSbhbS\ /\eSWac\U eW`R RS` ES`b RSa heSWbS\ 3ZS[S\ba OcaUSUS PS\ ÎQd]V 3`abSZZS\ AWS SW\ \ScSa >`]U`O[[ 0aaPh# 2SYZO`WS`S\ AWS RO`W\ SW\ /``Og ROa Oca # RWPa3ZS[S\bS\ PSabSVb 2WS 3ZS[S\bS a]ZZS\ W\WbWOZWaWS`b eS`RS\ [Wb RS\ 9ZSW\ PcQVabOPS\ d]\ O PWa S 0S\cbhS\ AWS Tº` RWS 7\WbWOZWaWS`c\U RWS 9c`haQV`SWPeSWaS RO[Wb RWS Sf^ZWhWbS /\UOPS RS` /``OgU`rzS 2W[S\aW]\ S\bTOZZS\ YO\\ ;»bd]Vbe^abRW[PV
public class Array04 { public static void main(String[] args) { char[] buchstaben = {'a','b','c','d','e'}; System.out.println(buchstaben[3]); } } ES\\ RS` >`]U`O[[WS`S` YSW\S /\TO\UaeS`bS d]`UWPb eS`RS\ RWS 9][^]\S\bS\ SW \Sa /``Oga [Wb AbO\RO`ReS`bS\ W\WbWOZWaWS`b 0SWa^WSZaeSWaS PSY][[S\ \c[S`WaQVS Bg^S\ RS\ ES`b 2Oa T]ZUS\RS >`]U`O[[ RSTW\WS`b SW\ /``Og Tº` RWS /cT\OV[S d]\ ATUTaT]iT] PdU >QYTZcT aWSVS OcQV /PaQV\Wbb !" /PS` eSWZ \]QV YSW\S =PXSYbS S`hScUb e]`RS\ aW\R S\bVOZbS\ RWS 9][^]\S\bS\ RS\ /\TO\UaeS`b ]d[[ ?a^VaP\\ 0aaPh$) 3XT :^\_^]T]cT] fTaST] \Xc 3TUPd[cfTacT] e^aQT[TVc public class Array05 { public static void main (String args[]) { Object[] obj = new Object[3]; System.out.println(obj[0]); } } !$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"" IdVaXUU PdU SXT 0aaPh:^\_^]T]cT]
ÎQd]V id\ ?a^VaP\\ 0aaPh$ ÍPS`^`ºTS\ AWS Rc`QV >`]U`O[[É\RS`c\U eWS RS` 2STOcZbeS`b ZOcbSb eS\\ ROa /` `Og Oca Q^^[TP]Bg^S\ PSabSVb UP[bT ]RS` cadT. 2Oa T]ZUS\RS >`]U`O[[ YO\\ \WQVb TSVZS`T`SW c[USeO\RSZb eS`RS\ ?a^VaP\\ 0aaPh%) D\fP]S[d]VbUTW[Ta ]^c WPeT QTT] X]XcXP[XiTS public class Array06 { public static void main (String args[]) { float[] zahlen; zahlen[0] = 15.4f; } } ÎQd]V id\ ?a^VaP\\ 0aaPh% 9ZÉ`S\ AWS RWS C`aOQVS RSa Ag\bOfTSVZS`a c\R Y]``WUWS`S\ AWS RS\ 4SVZS` :rac\UaVW\eSWa( /``Og]PXSYbS [ºaaS\ W[ /`PSWbaa^SWQVS` [Wb ]Tf S`hScUb eS`RS\ 4OhWb Oca RS\ ZSbhbS\ PSWRS\ ÍPc\US\( 0SW[ 7\WbWOZWaWS`S\ d]\ /``Og]PXSYbS\ [caa aOcPS` c\bS`aQVWSRS\ eS`RS\ heWaQVS\ RS` 7\WbWOZWaWS`c\U RS` @STS`S\hdO`WOPZS\ RWSa USaQVWSVb Rc`QV /cT`cT d]\ ]Tf c\R RS` 0SZSUc\U RS` SW\hSZ\S\ 9][^]\S\ bS\ [Wb /\TO\UaeS`bS\ RWSa USaQVWSVb ROPSW Ocb][ObWaQV
@[MXOLLG[LJOK'XXG_1USVUTKTZKT
2WS SW\hSZ\S\ DO`WOPZS\ Oca RS\S\ aWQV ROa /``Og hcaO[[S\aSbhb eS`RS\ 9][^] \S\bS\ [O\QV[OZ OcQV 3ZS[S\bS US\O\\b AWS eS`RS\ c\bS`aQVWSRS\ ºPS` WV`S >ZObh`]U`O[[a eW`R aWQVS`USabSZZb ROaa \c` UºZbWUS 7\RWQSa dS`O`PSWbSb eS`RS\ O\RS`\TOZZa UWPb Sa 4SVZS`[SZRc\US\ 3fQS^bW]\a Rc`QV RWS 8OdO DW`bcSZZS ;OaQVW\S 8D; 2WS 7\RWQSa PSUW\\S\ PSW hc hÉVZS\
`]U`O[[WS`S` Q]RWS`b eS`RS\ ÎQd]V
3`abSZZS\ AWS SW\ \ScSa >`]U`O[[ 0aaPh ! 2O`W\ a]ZZ SW\ /``Og RSTW\WS`b eS`RS\ ROa RWS HOVZS\ W\ aSW\S\ 9][^]\S\bS\ a^SWQVS`b 2WS ES`bS RS` 9][^]\S\bS\ a]ZZS\ W\ SW\S` U^aAQVZSWTS Rc`QV ES`bShceSWac\U dS`USPS\ eS`RS\ 2O\OQV a]ZZ W\ SW\S` heSWbS\ U^aAQVZSWTS ROa /``Og WbS`WS`b c\R RWS 7\VOZbS OcTORRWS`b eS`RS\ 2Oa 3`USP\Wa eW`R OcT RS` 9]\a]ZS OcaUSUSPS\ ;»bd]Vbe^abRW[PV)
public class Array12 { public static void main(String[] args) { int[] zahlen = new int[10]; for (int i=0; iQYTRc S`ZOcPb Wab ES\\ XO S`YZÉ`S\ AWS eO`c[ RWS :rac\U abSVb W[ S`abS\ /PaObh RWSaSa /PaQV\Wbba !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"
ATXWd]VT] QT]dciT] PaaPhb
3KZNUJKTJKX)RGYY'XXG_Y
4º` ROa Y][T]`bOPZS /`PSWbS\ [Wb Y][^ZSbbS\ /``Oga UWPb Sa RWS AbO\RO`RYZOaaS 0a aPhb /QVbc\U( ROa O\VÉ\US\RS a Wab eWQVbWU AWS S\bVÉZb SW\WUS bcPcXR;SbV]RS\ RWS d][ >`]U`O[[WS`S` US\cbhb eS`RS\ Yr\\S\ c[ /``Oga h0 hc a]`bWS`S\ b^ac hc dS`UZSWQVS\ T`dP[b ]RS` PW\É` hc Rc`QVacQVS\ QX]PahBTPaRW ?a^VaP\\ 0aaPh $) B^acXTaT] \Xc STa 2[Pbb 0aaPhb public class Array15 { public static void main(String[] args) { int umsatz[] = {100,200,300,50,100,5,0,98,700,50,0,90}; java.util.Arrays.sort(umsatz); for (int wert: umsatz) { System.out.println(wert); } } } 7[ >`]U`O[[ 0aaPh $ eW`R RWS 9ZOaaS 0aaPhb d]ZZ_cOZWTWhWS`b O\USa^`]QVS\ 2O Rc`QV YO\\ OcT SW\S X\_^ac/\eSWac\U dS`hWQVbSb eS`RS\ ÎQd]V 3`abSZZS\ AWS SW\ \ScSa >`]U`O[[ 0aaPh % [Wb SW\S[ /``Og ROa Oca " 7\bSUS` 3ZS[S\bS\ PSabSVb 7\WbWOZWaWS`S\ AWS ROa /``Og [Wb RS\ ES`bS\ & ! # 5SPS\ AWS RWS c\a]`bWS`bS\ ES`bS O[ 0WZRaQVW`[ Oca a]`bWS`S\ AWS RO\OQV RWS ES`bS c\R USPS\ AWS S`\Scb RS\ /``Og7\VOZb Oca /`PSWbS\ AWS [Wb RS` X\_^ac/\eSWac\U ;»bd]Vbe^abRW[PV) import java.util.*; public class Array16 { public static void main(String[] args) int[] zahlen = {11, 23, 4, 15}; for (int zahl: zahlen) System.out.format("%d ", zahl); Arrays.sort(zahlen); System.out.println('\n'); for (int zahl: zahlen) { System.out.format("%d ", zahl); } } } !
{
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"% `]U`O[[ S`hScUb SW\ RW[S\aW]\OZSa /``Og Tº` RWS A^SWQVS`c\U d]\ Ab`W\Ua 3a a]ZZS\ " AÉbhS dS`O`PSWbSb eS`RS\ RWS XSeSWZa Oca [SV`S`S\ Er`bS`\ PS abSVS\ 2WS [OfW[OZS /\hOVZ d]\ Er`bS`\ ^`] AObh Wab ! ?a^VaP\\ 0aaPh! ) IfTXSX\T]bX^]P[Tb 0aaPh \Xc >QYTZcT] public class Array21 { public static void main(String[] args) { String[][] woertermatrix = { {"Wort1", "Wort2", "Wort3"}, {"Wort4", "Wort5", "Wort6"}, {"Wort7", "Wort8", "Wort9"}, {"Wort10","Wort11","Wort12"} }; for(int i=0; i`]U`O[[ a]ZZ Rc`QV ES`bShceSWac\U W\ SW\S` VTbRWPRWcT[cT] U^aBRW[TXUT RWS S`abS\ dWS` RWPa DO`WOPZS\ [Wb RS\ 9ZSW\PcQVabOPS\ O R RWS \ÉQVabS\ [Wb RS\ 0cQVabOPS\ S V c\R RWS ZSbhbS\ dWS` DO`WOPZS\ [Wb RS\ HSWQVS\ W Z USTºZZb eS`RS\ 2WS /caUOPS a]ZZ eWS T]ZUb OcaaSVS\( a b c d e f g h i j k l ;»bd]Vbe^abRW[PV
public class Array22 { public static void main(String[] args) char[][] zeichen; zeichen = new char[3][4]; char unicode = 97; // Fuellen mit Zeichen for(int i=0; iQYTRc
•
4º` ROa /`PSWbS\ [Wb /``Oga UWPb Sa SW\S PSa]\RS`S Ag\bOf h0 PSW[ 3`hScUS\ c\R 7\WbWOZWaWS`S\
•
3W\S /``OgdO`WOPZS Wab SW\S @STS`S\hdO`WOPZS S`YS\\PO` O\ RS` SQYWUS\ 9ZO[[S` VW\bS` RS[ 2ObS\bg^ ]RS` VW\bS` RS[ `]U`O[[É\RS`c\U ]P T]ZUS\RS hcaÉbhZWQVS /\eSWac\U SW\ USTºUb VW\bS` HSWZS $ PSeW`Yb ROaa aWQV OcQV ROa /``Og i! É\RS`b( z1[2] = 100; 2WS BhbcT\9ZOaaS S\bVÉZb RWdS`aS \ºbhZWQVS bcPcXR4SZRS` c\R [SV` OZa bcPcXR ;SbV]RS\ cO OcQV RWS ;SbV]RS PaaPhR^_h RWS PS\cbhb eS`RS\ YO\\ c[ /``Oga Y][^ZSbb ]RS` bSWZeSWaS hc Y]^WS`S\ ?a^VaP\\ 0aaPh"!) <Xc TX]Ta BhbcT\QYTRc Wab RWS ;cbbS` OZZS` 9ZOaaS\ XSRS O\RS`S 9ZOaaS Wab RW`SYb ]RS` W\ RW`SYb ROd]\ OPUSZSWbSb 2Oa PSRScbSb ROaa RWS ;SbV]RS\ RWSaS` 9ZOaaS OZZS\ O\RS `S\ 8OdO9ZOaaS\ hc` DS`TºUc\U abSVS\ 2Ohc USVr`S\ cO RWS ;SbV]RS\ c^BcaX]V T`dP[b c\R OcQV RWS ;SbV]RS R[^]T ?a^VaP\\ 0aaPh"") 1T]dciT] STa VTTaQcT] `]U`O[[É\RS`c\U ]P T]ZUS\RS hcaÉbhZWQVS /\eSW ac\U SW\USTºUb VW\bS` HSWZS " PSeW`Yb ROaa aWQV OcQV ROa /``Og i! É\RS`b(
z1[2] = 100;
! &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# 4abcT[[T] e^] BcaX]V>QYTZcT]
@KOINKTQKZZKTGT]KTJKTYZXOTMY
3W\S HSWQVS\YSbbS PSabSVb Oca \TWaTaT] HSWQVS\ 2ORc`QV c\bS`aQVSWRSb aWS aWQV d]\ RS\ SW\USPOcbS\ 2ObS\bg^S\ eWS X]c ]RS` RWPa RWS Oca \c` TX]Ta HOVZ ]RS` Oca \c` TX]T\ SW\hSZ\S\ HSWQVS\ PSabSVS\ 2WS eWQVbWUabS 9ZOaaS Tº` ROa /`PSWbS\ [Wb HSWQVS\YSbbS\ ab`W\Ua Wab RWS d]`RSTW\WS` bS 9ZOaaS BcaX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OcT RS\ OYbcSZZS\ ES`b RSa Ab`W\U]PXSYba 2WS 2STW\WbW]\ SW\Sa Ab`W\Ua S`T]ZUb W\ heSW AQV`WbbS\ Hc\ÉQVab eW`R RWS @STS`S\hdO `WOPZS RSYZO`WS`b(
String str;
2O\\ [caa RS` A^SWQVS`^ZObh Tº` ROa SWUS\bZWQVS Ab`W\U]PXSYb O\USZSUb c\R [Wb SW \S[ ES`b USTºZZb eS`RS\ h0 Rc`QV SW\ Ab`W\UZWbS`OZ(
str = new String("Dies ist eine Zeichenkette");
0SWRS AQV`WbbS Yr\\S\ hcaO[[S\USTOaab eS`RS\ Rc`QV ! '
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
String str = new String("Dies ist eine Zeichenkette");
3W\S 0Sa]\RS`VSWb RS` Ab`W\UYZOaaS Wab RWS 9c`hT]`[ RS` 2STW\WbW]\ ]V\S ROa AQVZºa aSZe]`b ]Tf(
String str = "Dies ist eine Zeichenkette";
?a^VaP\\ BcaX]V ) ATUTaT]iePaXPQ[T TaiTdVT] UTW[TaWPUc public class String01 { public static void main(String[] args) String vorname; System.out.println(vorname); } }
{
ÎQd]V id\ ?a^VaP\\ BcaX]V 2Oa >`]U`O[[ S`hScUb SW\S\ C[eO\RZc\UaTSVZS` ÍPS`ZSUS\ AWS eOa RS` 5`c\R ROTº` Wab c\R Y]``WUWS`S\ AWS ROa >`]U`O[[ a] ROaa Sa c[USeO\RSZb c\R OcaUSTºV`b eS`RS\ YO\\ ;»bd]VbWX]fTXb
2WS 4SVZS`c`aOQVS Wab ROaa RWS @STS`S\hdO`WOPZS e^a]P\T W[ /caUOPSPSTSVZ PS\cbhb eW`R aWS OPS` \]QV YSW\S\ ES`b S\bVÉZb 4º` RWS :rac\U RS` ÍPc\U UWPb Sa heSW ;rUZWQVYSWbS\( S\beSRS` S`hScUS\ AWS SW\ =PXSYb RS` 9ZOaaS BcaX]V ]RS` AWS aOUS\ RS[ 1][^WZS` ROaa \]QV YSW\ =PXSYb PS\rbWUb eW`R c\R RSaeSUS\ RWS @STS`S\h ZSS` PZSWPS\ a]ZZ 4º` RWS Sf^ZWhWbS HceSWac\U SW\S` ZSS`S\ @STS`S\h UWPb Sa ROa AQVZºaaSZe]`b ]d[[ AW\\US[Éz Wab ROa RWS S\UZWaQVS 0ShSWQV\c\U Tº` HSWUS` W\a <WQVba \WQVb hc dS` eSQVaSZ\ [Wb RS` RScbaQVS\ 0ShSWQV\c\U QYTZcT]
EO\RSZ\ AWS RO\OQV ROa >`]U`O[[ c[ c\R bSabS\ AWS Sa ÍPS`ZSUS\ AWS eSZQVS /` PSWbaa^SWQVS`^ZÉbhS W[ =`WUW\OZ^`]U`O[[ Phe \OQV RWSaS` Ò\RS`c\U PSZSUb aW\R 2Oa T]ZUS\RS >`]U`O[[ [OQVb RS\ C\bS`aQVWSR heWaQVS\ ]d[[ c\R SW\S[ ZSS`S\ =PXSYb \]QV SW\[OZ RScbZWQV ?a^VaP\\ BcaX]V") ]d[[ Xbc ]XRWc Q[P]Z
public class String03 { public static void main(String[] args) String vorname = " "; System.out.println(vorname); } }
{
7[ /`PSWbaa^SWQVS` eS`RS\ Rc`QV ROa >`]U`O[[ T]ZUS\RS >ZÉbhS PS\rbWUb c\R O\US ZSUb( =PXSYbeS`b( Q[P]Z
d]`\O[S `STS`S\hWS`b
/PP"( =PXSYb W[ A^SWQVS`( @STS`S\hdO`WOPZS c\R =PXSYbeS`b 2WS @STS`S\hdO`WOPZS e^a]P\T S\bVÉZb SW\S\ DS`eSWa OcT ROa SWUS\bZWQVS Ab`W\U]PXSYb 2WSaSa Ab`W\U]PXSYb S\bVÉZb RS\ ES`b PZO\Y Phe a^OQS 2Oa Wab ZOcb C\WQ]RSbO PSZZS RS` VSfORShW[OZS ES`b PW\É`( ES\\ ROUSUS\ RWS @STS`S\hdO`WOPZS RS\ ES`b ]d[[ S\bVÉZb a] UWPb Sa YSW\ Ab`W\U]PXSYb OcT ROa aWS dS` eSWab
9ZXOTMROZKXGRKHKT[Z`KT
3W\ Ab`W\UZWbS`OZ Wab SW\ BSfb RS` SW\USaQVZ]aaS\ Wab W\ S^__T[cT] 6]QVY][[Oa \WQVb W\ SW\TOQVS\ 6]QVY][[Oa eWS RWPaES`bS A] eWS RWPa:WbS`OZS YO\\ OcQV SW\ Ab`W\UZWbS`OZ PSZWSPWUS 3aQO^SAS_cS\hS\ S\bVOZbS\ ?a^VaP\\ BcaX]V#) BcaX]V[XcTaP[T d]S 4bRP_TbT`dT]iT] \Xc Bh]cPgUTW[Ta public class String04 { public static void main(String[] args) { String str = 'Text \n mit Zeilenwechsel'; System.out.println(str); } } ÎQd]V id\ ?a^VaP\\ BcaX]V# 2Oa >`]U`O[[ S\bVÉZb SW\S\ Ag\bOfTSVZS` Ab`W\UZWbS`OZS [ºaaS\ W\ /\TºV`c\Uaab`W QVS\ abSVS\ 0WbbS Y]``WUWS`S\ AWS RWSa c\R TºV`S\ AWS ROa >`]U`O[[ Oca !!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
3KZNUJKTJKX)RGYY9ZXOTM
1UTYZX[QZUXKT 0SW[ 3`hScUS\ d]\ \ScS\ =PXSYbS\ eW`R W[[S` SW\ a] US\O\\bS` 9]\ab`cYb]` OcT US`cTS\ 2WSa Wab SW\S PSa]\RS`S 4]`[ SW\S` ;SbV]RS RS` XSeSWZWUS\ 9ZOaaS c\R S` a]`Ub ROTº` ROaa RWS DO`WOPZS\ RWS hc RS[ =PXSYb USVr`S\ W\WbWOZWaWS`b eS`RS\ 4º` ROa 3`abSZZS\ d]\ \ScS\ Ab`W\U]PXSYbS\ UWPb Sa W\ RS` 9ZOaaS BcaX]V dWSZS c\bS` aQVWSRZWQVS 9]\ab`cYb]`S\ h 0 // Leeres String-Objekt erzeugen (das Argument ist blank) String str1 = new String(); ]RS` // Kopie des Argument-Strings als Objekt erzeugen String str2 = new String("Meyer"); 2WS 9ZOaaS BcaX]V S\bVÉZb [SV` OZa # ;SbV]RS\ hc[ /`PSWbS\ [Wb HSWQVS\YSbbS\ h0 Tº` ROa DS`YSbbS\ d]\ Ab`W\Ua ROa 3fb`OVWS`S\ Oca BSWZab`W\Ua ROa >]aWbW]\WS`S\ W\\S`VOZP RSa Ab`W\Ua ROa 3`aSbhS\ d]\ HSWQVS\
R^]RPc bdQbcaX]V RWPa0c aT_[PRT
EW` eS`RS\ XSbhb SW\WUS RS` DS`O`PSWbc\Ua[rUZWQVYSWbS\ Tº` Ab`W\Ua PSa^`SQVS\
`]U`O[[ BcaX]V&YPeP a] ROaa RS` 9][[S\bO` W\ RS` R`WbbZSbhbS\ HSWZS S\bTS`\b eW`R ÍPS`^`ºTS\ AWS RWS /caUOPS RWSaS` HSWZS c\R dS` UZSWQVS\ AWS RWS 3`USP\WaaS ?a^VaP\\ BcaX]V') :^]eTacXTaT] e^] BcaX]Vb X] 0aaPhb e^] 1hcTb public class String08 { public static void main(String[] args) String vorname = "Roman"; byte[] zeichen = vorname.getBytes(); } }
{
2Oa ]PWUS 0SWa^WSZ S\Q]RWS`b RS\ C\WQ]RSAb`W\U W\ SW\S AS_cS\h d]\ /A1770gbSa PS\cbhb ROPSW RS\ 2STOcZb1VO`OQbS`aSb RS` >ZObbT]`[ c\R a^SWQVS`b ROa 3`USP\Wa W\ SW\S[ /``Og d]\ 0gbSa ÎQd]V id\ ?a^VaP\\ BcaX]V' 0WbbS S`UÉ\hS\ AWS ROa >`]U`O[[ c[ SW\S U^aAQVZSWTS W\ RS` RWS SW\hSZ\S\ 0gbSa RSa /``Oga OcaUSUSPS\ eS`RS\
`]U`O[[a SW\S\ 7\bSUS`ES`b OZa >O`O[SbS` [WbUSZWSTS`b ]RS` ]P S` SW\S 6SZ^4c\YbW]\ O\UST]`RS`b VOb Rc`QV 3W\UOPS SW\Sa 4`OUShSWQVS\a - /\RS`\TOZZa eS`RS\ 4SVZS`[SZRc\US\ OcaUSUSPS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`RSW\UOPS3W\VSWb AhbcT\X] hc ZSaS\ c\R ROPSW SW\hSZ\S B]YS\ \OQV PS abW[[bS\ @SUSZ\ hc S`YS\\S\ !"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
?a^VaP\\ BRP]]Ta ) 4X][TbT] d]S 0dUcaT]]T] TX]Tb BPciTb P[b BcaX]V
import java.util.Scanner; public class Scanner01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); eingabe.useDelimiter(","); String s =eingabe.next(); System.out.println("Erster Teil: " + s); s =eingabe.next(); System.out.println("Zweiter Teil: " + s); } } ÎQd]V id\ ?a^VaP\\ BRP]]Ta 5SPS\ AWS hc[ BSabS\ PWbbS T]ZUS\RS\ AObh SW\( C[ =PXSYbS hc S`hScUS\ PS\cbhb [O\ ROa AQVZºaaSZe]`b \Se EWQVbWU Wab ROa 9][[O W[ AObh 2Oa 3`USP\Wa eW`R aSW\ ROaa RWS S`abS AObhVÉZTbS OZa 3QV] eWSRS` OcaUSUSPS\ eW`R Hc[ /\hSWUS\ RS` heSWbS\ AObhVÉZTbS [caa SW\ eSWbS`Sa B`S\\hSWQVS\ 9][[O SW\USUSPS\ eS`RS\ 2WS 9ZOaaS BRP]]Ta O`PSWbSb [Wb SW\S[ d]`OcaaQVOcS\RS\ :SaS\ RSa BSfbSa 2Ohc UWPb Sa RWS ;SbV]RS WPb=Tgc 2WSaS ;SbV]RS Wab PSa]\RS`a VWZT`SWQV PSW[ 4]`[cZWS `S\ d]\ :SaSaQVZSWTS\ aWS ^`ºTb ]P eSWbS`S 2ObS\ d]`ZWSUS\ c\R RO\\ YO\\ hc[ SWUS\bZWQVS\ :SaS\ RWSaS` 2ObS\ RWS ;SbV]RS ]Tgc PS\cbhb eS`RS\ ?a^VaP\\ BRP]]Ta!) ;TbT] X] BRW[TXUT \Xc WPb=Tgc d]S ]Tgc import java.util.Scanner; class Scanner02 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); String zeilenende = System.getProperty("line.separator"); eingabe.useDelimiter(zeilenende); // Delimiter aendern while (eingabe.hasNext()) System.out.println(eingabe.next()); }
} 2Oa ]PWUS >`]U`O[[ ^`ºTb [Wb WPb=Tgc ]P Sa B]YS\ W[ 3W\UOPSab`][ UWPb ES\\ \WQVb PZSWPb Sa a]ZO\US abSVS\ PWa RS` Ab`SO[ 2ObS\ S\bVÉZb 2Oa YO\\ SW\ hcaÉbhZW QVSa E]`b ]RS` SW\ 2SZW[WbS` aSW\ 2O\\ eW`R RS` P]]ZSaQVS ES`b cadT USZWSTS`b RS` AQVZSWTS\`c[^T OcaUSTºV`b c\R WPb=Tgc abO`bSb \Sc 0SS\RSb eW`R ROa >`]U`O[[ Rc`QV 3W\UOPS SW\Sa 2ObSWS\RSHSWQVS\a 7\ ;AEW\R]ea Wab RWSa 1B@:1 2WS `SacZbWS`S\RS\ B]YS\ Yr\\S\ PSW[ :SaS\ Rc`QV a^ShWSZZS ;SbV]RS\ c[USeO\ RSZb eS`RS\ W\ SW\USPOcbS 2ObS\bg^S\ W\RS[ RWS S\ba^`SQVS\RS\ :SaS[SbV]RS\ !"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#% ATVd[ÊaT 0dbSa¶RZT
PS\cbhb eS`RS\ h0 ]Tgc8]c hc[ 3W\ZSaS\ d]\ 5O\hhOVZS\ ]RS` ]Tgc5[^Pc hc[ 3W\ ZSaS\ d]\ 5ZSWbY][[OhOVZS\ ?a^VaP\\ BRP]]Ta") 4X][TbT] e^] TX]VTQPdcT] 3PcT]ch_T] import java.util.Scanner; class Scanner03 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); eingabe.useDelimiter(","); // Delimiter aendern String str = eingabe.next(); // Komplettes Wort lesen int zahl1 = eingabe.nextInt(); // Ganzzahl lesen double zahl2 = eingabe.nextDouble(); // E-Format z.B. 5e3 lesen System.out.printf("%s | %d | %f", str, zahl1,zahl2); } }
BW^^a hc[ BSabS\ RSa >`]U`O[[a BRP]]Ta" •
/QVbS\ AWS PSW RS` 3W\UOPS d]\ Er`bS`\ ]RS` HSWQVS\ RO`OcT ROaa RWSaS Rc`QV 9][[O USb`S\\b eS`RS\ :SS`abSZZS\ aW\R \WQVb S`ZOcPb 0SWa^WSZ SW\S` Y]``SYbS\ 3W\UOPS( Wort,2000,5e3,
•
ES\\ ROa OPaQVZWSzS\RS 9][[O dS`USaaS\ eW`R S`eO`bSb ROa >`]U`O[[ eSWbS `S 3W\UOPS\ c\R PZSWPb abSVS\ a]ZO\US PWa ROa 9][[O SW\USUSPS\ eW`R
•
0SW SW\S` TSVZS`VOTbS\ 3W\UOPS P`WQVb ROa >`]U`O[[ OP [Wb SW\S` AgabS[ 4SVZS`[SZRc\U
2WSaS /`b RSa 3W\ZSaS\a d]\ [SV`S`S\ B]YS\ Wab `SZObWd ^`W[WbWd c\VO\RZWQV c\R TSV ZS`O\TÉZZWU 9][T]`bOPZS` Wab ROa /`PSWbS\ [Wb @SUcZÉ`S\ /caR`ºQYS\
8KM[RoXK'[YJXIQK
@SUcZÉ`S /caR`ºQYS eS`RS\ Tº` ROa Y][T]`bOPZS 2c`QVacQVS\ d]\ BSfbS\ SW\US aSbhb 3a eW`R SW\ AcQVPSU`WTT T]`[cZWS`b) RO\OQV ºPS`^`ºTb 8OdO ]P RWSaSa ;cabS` W[ BSfb USTc\RS\ eW`R c\R abSZZb RS\ USTc\RS\S\ Ab`W\U Tº` RWS eSWbS`S DS`O`PSWbc\U hc` DS`TºUc\U 7\ 8OdO eS`RS\ `SUcZÉ`S /caR`ºQYS Rc`QV ROa >OYSb YPePdcX[aTVTg c\bS`abºbhb 2WSaSa >OYSb S\bVÉZb \c` RWS 9ZOaaS\ ?PccTa] c\R `]U`O[[ZOcThSWb dS`U`rzS`b ]RS` dS`YZSW\S`b eS`RS\
•
1ZOaa BcaX]V1dX[STa( 5S\Oc eWS Ab`W\U0cTTS` OPS` \WQVb bV`SORaOTS A]ZZbS W[ [S` R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bg^S\ UZSWQVO`bWU aW\R 5ZSWQVO`bWU aW\R OZZS \c[S`WaQVS\ Bg^S\ c\R ROa aW\R OczS` Q^^[TP] OZZS O\RS`S\ aWSPS\ SW\USPOcbS\ Bg^S\ <WQVb [rUZWQV Wab OZa] ZSRWUZWQV RWS C[eO\RZc\U SW\Sa Q^^[TP]Bg^a W\ SW\S\ \c[S`WaQVS\ Bg^ ÍPS`VOc^b YSW\S >`]PZS[S S`USPS\ aWQV eS\\ RS` c`a^`º\UZWQVS 2ObS\bg^ a] W\bS` ^`SbWS`b eW`R ROaa SW\S S`eSWbS`\RS C[eO\RZc\U eWRS\W\U Q]\dS`aW]\ S`T]ZUb eS\\ OZa] RS` \ScS Bg^ [SV` A^SWQVS`^ZObh Phe SW\S\ U`rzS`S\ ES`bSPS`SWQV VOb OZa RS` PWaVS`WUS ;O\ YO\\ SW\S 6WS`O`QVWS RS` ^`W[WbWdS\ Bg^S\ S`abSZZS\ OPVÉ\UWU d][ A^SWQVS` ^ZObh RS\ aWS hc` DS`TºUc\U VOPS\( PgbS -
aV]`b -
W\b - Z]\U - TZ]Ob - R]cPZS
>`]PZS[Z]a Wab SW\S Bg^O\^Oaac\U W\ >TSWZ`WQVbc\U OZa] d]\ ZW\Ya \OQV `SQVba A] Wab h0 SW\ X]cES`b Y][^ObWPSZ [Wb SW\S[ [^]VBg^ OPS` \WQVb c[USYSV`b
:_VGTVGYY[TMHKO=KXZK`[]KOY[TM
?a^VaP\\ :^]eTabX^] ) bW^ac PdU [^]V TafTXcTa] Pdc^\PcXbRW public class Konversion01 { public static void main(String[] args) short a = 123; long b = a; } }
{
0SW RS` C[eO\RZc\U d]\ bW^ac W\ [^]V USVS\ YSW\S`ZSW 7\T]`[ObW]\S\ dS`Z]`S\ RS\\ RS` \ScS Bg^ VOb SW\S\ U`rzS`S\ ES`bSPS`SWQV OZa RS` c`a^`º\UZWQVS 2WSaS /`b RS` 2ObS\bg^c[eO\RZc\U S`T]ZUb Ocb][ObWaQV ]V\S EO`\c\U RS\\ aWS Wab US TOV`Z]a /cQV RWS 9]\dS`bWS`c\U d]\ RWPaBg^S\ 0gbSa ZO\U W\ X]cBg^S\ " 0gbSa S`T]ZUb ^`]PZS[ c\R ZOcbZ]a ES\\ W\ SW\S` ES`bShceSWac\U OaaWU\[S\b SW\ :WbS`OZ PS\cbhb eW`R a] eW`R hc \ÉQVab RS` 2ObS\bg^ RSa :WbS`OZa d][ 1][^WZS` TSabUSZSUb OPVÉ\UWU d]\ RS` AQV`SWPeSWaS RSa :WbS`OZa 2O\OQV eW`R W\ SW\S[ heSWbS\ AQV`Wbb RWSaS` 2ObS\bg^ RS` S[^TO\US\RS\ DO`WOPZS\ O\US^Oaab SdS\bcSZZ Wab SW\S 9]\dS`bWS`c\U \]beS\RWU ES\\ W\ SW\S` ES`bShceSW ac\U SW\ /caR`cQY Oca [SV`S`S\ :WbS`OZS\ c\R DO`WOPZS\ PS\cbhb eW`R a] [ºaaS\ hc\ÉQVab RWS 2ObS\bg^S\ RS` =^S`O\RS\ dS`SW\VSWbZWQVb eS`RS\ 2O`Oca PSabW[[b aWQV RS` Bg^ RSa /caR`cQYa !#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ 4afTXcTa]ST :^]eTacXTad]V QTX TX]UPRWT] Ch_T]
?a^VaP\\ :^]eTabX^]!) 3PcT]ch_ TX]Tb ;XcTaP[b Pdc^\PcXbRW QTbcX\\T] public class Konversion02 { public static void main(String[] args) byte b = 66; System.out.println(b); } }
{
2Oa :WbS`OZ $$ eW`R W\bS`^`SbWS`b OZa >ZObh\c[[S` W[ C\WQ]RS c\R \WQVb OZa HOVZ d][ X]c2ObS\bg^ 2S` 0SeSWa YO\\ RORc`QV USTºV`b eS`RS\ ROaa eW` ROa >`]U`O[[ heW\US\ RS\ 7\VOZb RS` DO`WOPZS\ P OZa HSWQVS\ Bg^ RWPa OcahcUSPS\( ?a^VaP\\ :^]eTabX^]") 3XT Z^aaTZcT 8]cTa_aTcPcX^] TX]Tb Ch_b TaifX]VT]
public class Konversion03 { public static void main(String[] args) byte b = 66; System.out.println((char)b); } }
{
2WSa eO` SW\ 0SWa^WSZ Tº` ROa Sf^ZWhWbS 1OabW\U 7[ T]ZUS\RS\ >`]U`O[[ eS`RS\ UZSWQV [SV`S`S Bg^O\^Oaac\US\ S`T]`RS`ZWQV( hc\ÉQVab eS`RS\ RWS 2ObS\bg^S\ RS` :WbS`OZS S`[WbbSZb c\R RO\\ ROa 3`USP\Wa O\US^Oaab O\ RS\ 3[^TÉ\US` RS` HceSW ac\U ?a^VaP\\ :^]eTabX^]$) 8\_[XiXcTb 2PbcX]V QTX IdfTXbd]V public class Konversion05 { public static void main(String[] args) char z1 = 75 + 2; long z2 = 0x4b + 1; System.out.printf("%c %d ", z1,z2); } }
{
4[SKXOI6XUSUZOUTHKO'[YJXIQKT
ES\\ W\ SW\S[ /caR`cQY [Wb c\bS`aQVWSRZWQVS\ Bg^S\ US`SQV\Sb eS`RS\ a]ZZ a] eS`RS\ RWSaS OcT RS\ VrQVabS\ 2ObS\bg^ Y]\dS`bWS`b [W\RSabS\a XSR]QV OcT X]c Bg^ 2WSaS` D]`UO\U eW`R \c[S`WQ ^`][]bW]\ US\O\\b 2Oa T]ZUS\RS 0SWa^WSZ hSWUb RWSaS Ocb][ObWaQVS /\^Oaac\U OZZS` 2ObS\bg^S\ W\ SW\S[ /caR`cQY ?a^VaP\\ :^]eTabX^]%) 0]_Pbbd]V STa d]cTabRWXTS[XRWT] >_TaP]ST]
public class Konversion06
{ !#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ Ch_d\fP]S[d]VT] eTabcTWT] RPbcX]V
public static void main(String[] args) short a = 110; float b = 456789.1f; float erg = a * b; System.out.println(erg); }
{
} 7[ >`]U`O[[ :^]eTabX^]%YPeP eS`RS\ hc\ÉQVab RWS c\bS`aQVWSRZWQVS\ =^S`O\RS\ UZSWQV\O[WU US[OQVb PSd]` US`SQV\Sb eW`R RV RS` bW^acBg^ eW`R hc SW\S[ U[^ PcBg^ Y]\dS`bWS`b 2O\OQV S`T]ZUb RWS ES`bShceSWac\U c\R OcQV ROPSW YO\\ SW\S hcaÉbhZWQVS Bg^O\^Oaac\U S`T]`RS`ZWQV eS`RS\ ÎQd]VT] id\ ?a^VaP\\ :^]eTabX^]% ÎQd]V ( ÍPS`^`ºTS\ AWS ROa @SQVS\S`USP\Wa 7ab Sa [ObVS[ObWaQV SfOYb- =RS` UWPb Sa C\US\OcWUYSWbS\ RWS PSU`º\RSb aW\R Rc`QV RS\ ESQVaSZ RSa HOVZS\agabS[a d]\ 2ShW[OZeS`bWUYSWb OcT 2cOZabSZZS\agabS[- ÎQd]V !( Ò\RS`\ AWS RS\ 2ObS\bg^ RS` S[^TO\US\RS\ DO`WOPZS\ d]\ U[^Pc OcT R^dQ[T 7ab ROa ]V\S eSWbS`Sa [rUZWQV ]RS` É\RS`b ROa SbeOa O[ 3`USP\Wa-
:_VGTVGYY[TMHKO6GXGSKZKXHKXMGHK
2Oa \ÉQVabS 0SWa^WSZ RS[]\ab`WS`b ROaa SW\S Ocb][ObWaQVS Bg^O\^Oaac\U OcQV PSW RS` ÍPS`UOPS d]\ /`Uc[S\bS\ S`T]ZUb 2S` OYbcSZZS >O`O[SbS` eW`R O\US^Oaab O\ RS\ Bg^ RSa T]`[OZS\ >O`O[SbS`a RS` d][ 3[^TÉ\US` S`eO`bSb eW`R ?a^VaP\\ :^]eTabX^]&) Ch_P]_Pbbd]V QTX TX]Ta ?PaP\TcTa¶QTaVPQT public class Konversion07 { public static void main (String[] args) { ausgeben(25); } static void ausgeben(double zahl) { System.out.println(zahl); } } ÎQd]V id\ ?a^VaP\\ :^]eTabX^]& ;OQVS\ AWS T]ZUS\RSa 3f^S`W[S\b( Ò\RS`\ AWS RS\ Bg^ RSa T]`[OZS\ >O`O[SbS`a d]\ S^dQ[T OcT X]c Ò\RS`\ AWS OczS`RS[ RS\ ;SbV]RS\OcT`cT a] ROaa OZa OYbcSZZS` >O `O[SbS` SW\ 5ZSWbY][[OeS`b ºPS`USPS\ eW`R 7ab SW\S TSVZS`T`SWS C[eO\RZc\U [rUZWQV- ES\\ \SW\ TW\RS\ AWS W\ RS[ \ÉQVabS\ /PaQV\Wbb RWS :rac\U Tº` RWSaS /cTUOPS !#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$! 4X]bRWaÊ]ZT]ST :^]eTacXTad]V QTX TX]UPRWT] Ch_T]
+OTYINXoTQKTJK1UT\KXZOKX[TMHKOKOTLGINKT:_VKT
>`]PZS[ObWaQV Wab SW\S C[eO\RZc\U d]\ SW\S[ P`SWbS`S\ 2ObS\bg^ W\ SW\S\ aQV[OZS `S\ Bg^ RS\\ ROPSW Yr\\S\ 7\T]`[ObW]\S\ dS`Z]`S\ USVS\ 2WS d]`VS`WUS ÍPc\U S\bVWSZb SW\ 0SWa^WSZ Tº` RWSaS AWbcObW]\ 2Oa UZSWQVS >`]PZS[ YO\\ OcQV PSW SW\S` ES`bShceSWac\U S\babSVS\ ]RS` PSW RS` \c[S`WQ ^`][]bW]\ d]\ O`WbV[SbWaQVS\ /caR`ºQYS\ Hc\ÉQVab SW\ 0SWa^WSZ Tº` SW\S HceSWac\U SW\S` ZO\US\ DO`WOPZS\ W\ SW\S DO`WOPZS [Wb SW\S[ aQV[OZS`S\ ES`bSPS`SWQV ?a^VaP\\ :^]eTabX^]') 4X] ETabdRW e^] [^]V PdU bW^ac eTaZ¶aiT] public class Konversion08 { public static void main(String[] args) long a = 1234567; short b = a; } }
{
2WSaS 1]RWS`c\U TºV`b hc SW\S[ C[eO\RZc\UaTSVZS` [Wb RS` ;SZRc\U( >]aaWPZS Z]aa ]T ^`SQWaW]\ C[ RS\\]QV RWS 9]\dS`bWS`c\U hc S`heW\US\ [caa RWSa d][ >`] U`O[[WS`S` OcaR`ºQYZWQV Q]RWS`b eS`RS\ c\R heO` Rc`QV 6W\aQV`SWPS\ RSa HWSZRO bS\bg^a W\ `c\RS\ 9ZO[[S`\ ?a^VaP\\ :^]eTabX^]() 4aifX]VT] STa Ch_d\fP]S[d]V SdaRW 2PbcX]V public class Konversion09 { public static void main(String[] args) long a = 123; short b = (short)a; System.out.println(b); } }
{
ÎQd]V \Xc ?a^VaP\\ :^]eTabX^]( 0WbbS É\RS`\ AWS ROa :WbS`OZ W\ HSWZS ! d]\ ! OcT !"#$% c\R ^`ºTS\ AWS ROa 3` USP\Wa 9O\\ TSVZS`T`SW c[USeO\RSZb eS`RS\- 7ab ROa 3`USP\Wa aW\\d]ZZ- 2WS 9]\dS`bWS`c\U SW\Sa U`]zS\ ^`W[WbWdS\ 2ObS\bg^a W\ SW\S\ YZSW\S\ ^`W[WbWdS\ 2ObS\bg^ \S\\b [O\ SW\aQV`É\YS\RS 9]\dS`aW]\ SW\S\US\RS Bg^c[eO\RZc\U \O``]eW\U Q]\dS`aW]\ ESWZ RO[Wb SdS\bcSZZ RS` DS`Zcab d]\ 7\T]`[ObW]\ dS`Pc\ RS\ Wab S`T]ZUb RWS 9]\dS`aW]\ \WQVb Ocb][ObWaQV a]\RS`\ \c` OcT OcaR`ºQYZWQVS\ Ec\aQV RSa >`]U`O[[WS`S`a 2WSaS\ D]`UO\U \S\\b [O\ 2PbcX]V S\UZ Tº` W\ 4]`[ UWSzS\ ]RS` OcQV SW\S @]ZZS PSaSbhS\ 3`T]`RS`ZWQV Wab RWS Sf^ZWhWbS /\UOPS SW\Sa 1Oab=^S`Ob]`a( ROa Wab HWSZRObS\bg^ W\ 9ZO[[S`\ 2c`QV 3W\aObh SW\Sa 1Oab=^S`Ob]`a YO\\ OcQV ROa >`]U`O[[ :^]eTabX^]& T]`[OZ TSVZS`T`SW S`abSZZb eS`RS\ !#!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ Ch_d\fP]S[d]VT] eTabcTWT] RPbcX]V
;»bd]V ida ÎQd]V :^]eTabX^]&
public class Konversion10 i public static void main (String[] args) { ausgeben((int)25.3); } static void ausgeben(int zahl) { System.out.println(zahl); } } 2c`QV RWS Sf^ZWhWbS /\UOPS RSa HWSZbg^a eW`R SW\S C[eO\RZc\U RSa 2ObS\bg^a d][ >`]U`O[[WS`S` S`hec\US\ 2O[Wb ºPS`\W[[b S` OcQV RWS DS`O\be]`bc\U ROTº` ]P ROa 3`USP\Wa aW\\d]ZZ Wab ]RS` \WQVb ?a^VaP\\ :^]eTabX^]
) Ch_d\fP]S[d]V QTX 6[TXcZ^\\PIPW[T]
public class Konversion11 { public static void main(String[] args) double a = 12345678E300; float b = a; // Fehler ! System.out.println(a); } } ÎQd]V \Xc ?a^VaP\\ :^]eTabX^]
{
2Oa >`]U`O[[ S\bVÉZb SW\S\ T]`[OZS\ 4SVZS` RS` PSW RS` C[eO\RZc\U TSabUSabSZZb eW`R 0WbbS Y]``WUWS`S\ AWS RS\ ?cSZZbSfb ?a^VaP\\ :^]eTabX^] !) 4g_[XiXcTb 2PbcX]V \Xc 3PcT]eTa[dbc
public class Konversion12 { public static void main(String[] args) { double a; long b = 12345678912348999L; a = b; // korrekt b = (long)a; // Datenverlust System.out.println(b); } } 2WS 0ShSWQV\c\U Bg^c[eO\RZc\U Yr\\bS acUUS`WS`S\ ROaa RWS DS`Yº`hc\U RSa 2ObS\bg^a ROhc TºV`b ROaa RS` \ScS ES`b RS` DO`WOPZS\ \OQV SW\S[ OcaUSTSWZbS\ DS`TOV`S\ S`[WbbSZb eW`R 7\ EW`YZWQVYSWb Wab Sa UO\h SW\TOQV a] ROaa \WQVb c[USeO\ RSZb a]\RS`\ ZSRWUZWQV OPUSaQV\WbbS\ Phe OcTUSTºZZb eW`R
!#"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$" ETaP[[VT\TX]Ta]ST :^]eTacXTad]V QTX ATUTaT]ich_T]
8Sbhb T]ZUb \]QV SW\ 0SWa^WSZ ROa hSWUb ROaa OcQV SW\S S`eSWbS`\RS 9]\dS`bWS`c\U [O\QV[OZ S`hec\US\ eS`RS\ [caa RO[Wb ºPS`VOc^b SW\ Y]``SYbSa 3`USP\Wa S\babS VS\ YO\\ ?a^VaP\\ :^]eTabX^] ") 4afTXcTa]STb 2PbcX]V TaifX]VT] public class Konversion13 { public static void main(String[] args) { double erg; int x = 5; int y = 3; erg = x / y; // Abschneiden System.out.println(erg); erg = (double)x / y; // Korrekt System.out.println(erg); } }
`]PZS[S UWPb Sa eS\\ RWS @STS`S\h SW\S` C\bS`YZOaaS c[USRScbSb eW`R OcT SW\S @STS`S\h RS` =PS`YZOaaS 8SRS C\bS`YZOaaS S\bVÉZb OZZS 3ZS[S\bS RS` =PS`YZOaaS a] ROaa RWSaS C[RScbc\U heO` hc 7\T]`[ObW]\adS`Zcab TºV`S\ YO\\ OPS` bSQV\WaQV c\R T]`[OZ YSW\S >`]PZS[S dS`c`aOQVb RS\\ RWS AcPYZOaaS YO\\ c\R VOb [W\RSabS\a ROa OZZSa eOa RWS =PS`YZOaaS S\bVÉZb ?a^VaP\\ :^]eTabX^]!) 8\_[XiXcT Ch_P]_Pbbd]V QTX ETaP[[VT\TX]Tad]V public class Konversion20 { public static void main(String[] args) A referenzA = new A(); B referenzB = new B(); referenzA = referenzB; } } class A {} class B extends A {}
{
2WS ES`bShceSWac\U d]\ 0 \OQV / Wab ]V\S >`]PZS[S [rUZWQV ROPSW TW\RSb SW\S Oc b][ObWaQVS 9]\dS`bWS`c\U RSa Bg^a d]\ c\bS\ 0 \OQV ]PS\ / abObb 2OPSW PZSW PS\ W\bS`\ RWS a^ShWSZZS\ 7\T]`[ObW]\S\ ºPS` RWS AcPYZOaaS S`VOZbS\ !##
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ Ch_d\fP]S[d]VT] eTabcTWT] RPbcX]V
9VK`OGROYOKXKTJK1UT\KXZOKX[TMHKO8KLKXKT`Z_VKT
5O\h O\RS`a Wab RWS AWbcObW]\ PSW SW\S` @STS`S\h OcT RWS =PS`YZOaaS RWS \c\ OZa @STS `S\h W\bS`^`SbWS`b eS`RS\ a]ZZ RWS OcT SW\ ROd]\ OPUSZSWbSbSa =PXSYb hSWUb 2WS C\ bS`YZOaaS S\bVÉZb [SV` 7\T]`[ObW]\S\ /bb`WPcbS c\R]RS` ;SbV]RS\ OZa RWS Ac^S` YZOaaS 2SaeSUS\ eW`R RWSaS` DS`acQV d][ 1][^WZS` OPUSZSV\b ?a^VaP\\ :^]eTabX^]! ) ATUTaT]ich_ b_TiXP[XbXTaT] public class Konversion21 { public static void main(String[] args) { A referenzA = new A(); B referenzB = new B(); referenzB = referenzA; // Fehler, inkompatibel } } class A {} class B extends A {} 2S` >`]U`O[[WS`S` YO\\ OPS` OcQV VWS` ROa 1OabW\U S`heW\US\ US\Oc eWS PSW RS\ ^`W[WbWdS\ 2ObS\bg^S\ 2WS 9]\dS`bWS`c\U eW`R OcQV PSW @STS`S\hbg^S\ S`hec\US\ Rc`QV /\UOPS RSa 1Oab=^S`Ob]`a 2S` 1Oab=^S`Ob]` PSabSVb Oca RS[ _TaPc^a QTX ATUTaT]ich_T]
public class Konversion22 { public static void main(String[] args) A referenzA = new A(); B referenzB = new B(); referenzB = (B)referenzA; } } class A {} class B extends A {}
{
8Sbhb Wab SW\S TSVZS`T`SWS C[eO\RZc\U [rUZWQV /PS`( 0SW[ DS`acQV ROa >`]U`O[[ OcahcTºV`S\ UWPb Sa SW\S\ /PP`cQVTSVZS` @c\BW[S3``]`( 1Oab3fQS^bW]\ 2S` 5`c\R Tº` RWSaS\ 4SVZS`( EW` VOPS\ dS`acQVb Oca SW\S[ @STS`S\hbg^ RS` OZZUS [SW\S\ 9ZOaaS / SW\S\ a^ShWOZWaWS`bS\ Bg^ RS` 9ZOaaS 0 hc [OQVS\ 2Oa USVb \WQVb ]RS` PSaaS` USaOUb ROa USVb \c` eS\\ Sa aWQV OcQV eW`YZWQV c[ RWSaS\ a^ShWOZWaWS` bS\ Bg^ VO\RSZb ;SV` AQVSW\ OZa ASW\ ZÉzb RWS 8D; \WQVb hc !#$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$# B_TiXP[XbXTaT]ST :^]eTacXTad]V QTX ATUTaT]ich_T]
EWQVbWUS @SUSZ( `]U`O[[WS`S` aWQV UO\h aWQVS` Wab ROaa RWS @STS`S\h W\ EOV`VSWb SW\S @STS`S\h OcT RWS AcPYZOaaS Wab RO`T ROa 1OabW\U S`hec\US\ eS`RS\ O\RS`\TOZZa TºV`b RS` Sf^ZWhWbS 1Oab hc SW\S[ @c\BW[S4SVZS` FXT ZP]] bXRWTaVTbcT[[c fTaST] SPbb ZTX]T ;PdUiTXcUTW[Ta T]cbcTWT]. 3a UWPb SW\S\ =^S`Ob]` [Wb RSaaS\ 6WZTS hc` :OcThSWb ºPS`^`ºTb eS`RS\ YO\\ OcT eSZQVS\ 2ObS\bg^ SW\S @STS`S\h dS`eSWab( X]bcP]RT^U 2WSa Wab RS` R`W\US\R S[^ T]VZS\S ESU c[ aWQVS` hc abSZZS\ ROaa YSW\ TOZaQVSa 1OabW\U Rc`QVUSTºV`b eW`R ?a^VaP\\ :^]eTabX^]!") ;PdUiTXcch__a¶Ud]V SdaRW X]bcP]RT^U public class Konversion23 { public static void main(String[] args) { A referenzA = new A(); B referenzB = new B(); if (referenzA instanceof B) referenzB = (B)referenzA; else System.out.println("Kein Casting möglich"); } } class A {} class B extends A {} 2Oa \ÉQVabS 0SWa^WSZ RS[]\ab`WS`b PSWRS /`bS\ RS` 9]\dS`bWS`c\U d]\ @STS`S\hS\ ?a^VaP\\ :^]eTabX^]!#) ETaP[[VT\TX]Tad]V d]S B_TiXP[XbXTad]V SdaRW 2PbcX]V
import java.awt.Point; public class Konversion24 { public static void main(String[] args) Point p1, p2; Object object;
{
p1 = new Point(100,200); p2 = new Point(300,400); object = new Object(); object = p1; // generalisierende Konvertierung p2 = (Point)object; // spezialisierende Konvertierung System.out.println(p2); } } !#%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ Ch_d\fP]S[d]VT] eTabcTWT] RPbcX]V
:_V;S]GTJR[TM`]OYINKTKOTLGINKT[TJ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\TOQVS\ 2ObS\bg^ eW`R ]V\S PSa]\RS`S D]`YSV`c\U Rc`QV RS\ >`]U`O[[WS`S` SW\ @STS`S\hbg^ RS` E`O^^S`YZOaaS S`hScUb 2WSaS` D]`UO\U eW`R /cb]P]fW\U US\O\\b C[USYSV`b S`T]ZUb OcQV ROa /ca^OQYS\ c\P]fW\U W\ RS\ [SWabS\ 4ÉZZS\ Ocb][ObWaQV W\bBg^
=PXSYb
@STS`S\hD
/PP #( 0SWa^WSZ Tº` ROa E`O^^S\ SW\S` ^`W[WbWdS\ W\bDO`WOPZS\ 7\ [O\QVS\ AWbcObW]\S\ [caa ROa /`PSWbS\ [Wb RS\ E`O^^S`9ZOaaS\ OPS` OcaR`ºQY ZWQV Q]RWS`b eS`RS\ 2O[Wb hc\ÉQVab SW\[OZ ^`OYbWaQV USºPb eS`RS\ YO\\ eWS [O\ [Wb E`O^^S`YZOaaS\ O`PSWbSb hSWUb ROa >`]U`O[[ FaP__Ta eWS SW\S UO\hS HOVZ OZa =PXSYb S`hScUb c\R dS`O`PSWbSb eW`R ?a^VaP\\ FaP__Ta ) 6P]iiPW[ P[b TX]UPRWTa 3PcT]ch_ d]S P[b ATUTaT]ich_ class Wrapper01 { public static void main(String[] args) int zahl1 = 15; // Integer zahl1 = new Integer(15); System.out.println(zahl1); } }
{
!#&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$$ Ch_D\fP]S[d]V ifXbRWT] TX]UPRWT] d]S ATUTaT]ich_T]
ÎQd]V id\ ?a^VaP\\ FaP__Ta 3`aSbhS\ AWS RWS 2STW\WbW]\ RSa SW\TOQVS\ Bg^a W\ RS` HSWZS ! Rc`QV RWS UZSWQVeS`bWUS 2STW\WbW]\ W\ HSWZS " c\R bSabS\ AWS ROa 3`USP\Wa Ò\RS`b aWQV ROa 3`USP\Wa- HcaO[[S\TOaac\U( 3W\S 9]\dS`bWS`c\U heWaQVS\ @STS`S\hbg^ c\R SW\TOQVS[ Bg^ Wab W\ 8OdO \WQVb [rUZWQV E]VZ [rUZWQV Wab ROa 3W\^OQYS\ P]fW\U d]\ SW\TOQVS\ Bg ^S\ W\ ST] T]cb_aTRWT]ST] Ch_ RS` ROhcUSVr`S\RS\ E`O^^S`YZOaaS Phe ROa /ca^OQYS\ c\P]fW\U d]\ @STS`S\hbg^S\ c[ eWSRS` SW\TOQVS Bg^S\ hc PSY][ [S\
'[ZUHU^OTM;THU^OTM
2Oa 3W\ ]RS` /ca^OQYS\ S`T]ZUb W[[S` RO\\ Ocb][ObWaQV eS\\ 8OdO S`YS\\b ROaa RWSa \]beS\RWU c\R [rUZWQV Wab 0SWa^WSZ( ES\\ ^`W[WbWdS Bg^S\ O\ RWS ;SbV]RS _aX]cU ºPS`USPS\ eS`RS\ RO\\ eS`RS\ RWSaS SW\TOQVS\ Bg^S\ W\ =PXSYbS RS` XSeSW ZWUS\ 9ZOaaS c[USeO\RSZb aWS eS`RS\ SW\US^OQYb W\ SW\S 0]f OcT S\UZWaQV( Oc b]P]fW\U ]RS` Ocb]e`O^^W\U /cQV RS` c[USYSV`bS D]`UO\U ROa 3\b^OQYS\ ] RS` c\P]fW\U YO\\ S`T]ZUS\ ]V\S ROaa RS` >`]U`O[[WS`S` ROTº` PSa]\RS`S D]` YSV`c\US\ b`STTS\ [caa ?a^VaP\\ 1^gX]V ) 0dc^\PcXbRWTb 1^gX]VD]Q^gX]V
class Boxing01 { public static void main(String[] args) int zahl1 = 15; Integer zahl2 = new Integer(25); System.out.println(zahl1 + zahl2); zahl1 = zahl2; System.out.println(zahl1); } }
{
// Autoboxing // Auto-Unboxing
1UT\KXZOKXKTSOZYVK`OKRRKT3KZNUJKT
EWS PS`SWba [SV`TOQV PSb]\b PWSbSb RWS 8OdOA^`OQVS YSW\S ;rUZWQVYSWb c[ [Wb SW \S[ 1OabW\U=^S`Ob]` heWaQVS\ SW\TOQVS\ c\R @STS`S\hbg^S\ hc Y]\dS`bWS`S\ /PS` Sa UWPb ;SbV]RS\ hc[ C[eO\RSZ\ d]\ Ab`W\U]PXSYbS\ W\ ^`W[WbWdS Bg^S\ c\R OcQV ;SbV]RS\ c[ SW\TOQVS Bg^S\ W\ Ab`W\U]PXSYbS hc Y]\dS`bWS`S\ D\fP]ST[] e^] TX]UPRWT] Ch_T] X] BcaX]V^QYTZcT 2WS E`O^^S`YZOaaS\ S\bVOZbS\ SW\S c^BcaX]V;SbV]RS RWS SW\S Ab`W\U@S^`ÉaS\bObW]\ Tº` SW\S\ SW\TOQVS\ 2ObS\bg^ ZWSTS`b EW` eWaaS\ OcQV PS`SWba ROaa c^BcaX]V d]\ PS abW[[bS\ ;SbV]RS\ Ocb][ObWaQV OcTUS`cTS\ eW`R a] h0 d]\ RS` _aX]c[];SbV]RS !#'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ Ch_d\fP]S[d]VT] eTabcTWT] RPbcX]V
?a^VaP\\ :^]eTac`]U`O[[ a] OP ROaa RS` BcaX]V W\ SW\S\ SW\TOQVS\ U[^PcBg^ c[ USeO\RSZb eW`R
!$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$$ Ch_D\fP]S[d]V ifXbRWT] TX]UPRWT] d]S ATUTaT]ich_T]
;»bd]Vbe^abRW[PV
class KonvertMethod04 { public static void main(String[] args) String str = "153E5"; float zahl = Float.parseFloat(str); System.out.println(zahl); } }
{
IdbP\\T]UPbbd]V >`W\hW^WSZZ Wab PSW[ /`PSWbS\ [Wb DO`WOPZS\ RS` d][ >`]U`O[[WS`S` W\ RS` 2SYZO`ObW ]\ TSabUSZSUbS 2ObS\bg^ ab`S\U SW\hcVOZbS\ 2WSa eW`R d][ 1][^WZS` ºPS`^`ºTb c\R aWQVS`USabSZZb >`W\hW^WSZZ Yr\\S\ HceSWac\US\ ]RS` >O`O[SbS`ºPS`UOPS\ \c` Rc`QV USTºV`b eS`RS\ eS\\ RWS 2ObS\bg^S\ SfOYb ºPS`SW\abW[[S\ AbW[[S\ 2ObS\bg^ d]\ AS\RS` c\R 3[^T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Zb OcQV ROhc a^ÉbS` [SV`)
•
Tº` RWS ;rUZWQVYSWb a] US\O\\bS 0RRTbb `]U`O[[É\RS`c\U ]P RS`aSZPS `]U`O[[ YO\\ \WQVb TSVZS`T`SW c[USeO\RSZb eS`RS\ 9]``WUWS`S\ AWS RWSaS\ 4SVZS`
2KHKTYJG[KX\UTO`O[SbS`\ /cQV aWS SfWabWS`S\ \c` Tº` Yc`hS HSWb AWS eS`RS\ W[ 9]^T RS` ;SbV]RS RSYZO`WS`b c\R aW\R \c` W\\S`VOZP RS` ;SbV]RS aWQVbPO` O`O[SbS`a [caa OZa 3`USP\Wa d]\ RS` OcTUS`cTS\S\ ;S bV]RS hc`ºQYUSUSPS\ eS`RS\ c\R PSW[ /cT`cT S[^TO\US\ eS`RS\ !$%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% `]U`O[[ a] ROaa RWS S`abS 7\abO\h RWS ES`bS "%# c\R 0SW a^WSZbSfb S\bVÉZb c\R Tº` RWS heSWbS 7\abO\h RS` 2STOcZb9]\ab`cYb]` OcTUS`cTS\ eW`R
!$'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% OYSb hcU`SWTS\ FXT fXaS PdU SXT 4[T\T]cT idVTVaXUUT]. 7\\S`VOZP SW\S` 9ZOaaS eW`R Rc`QV RS\ SW\TOQVS\ OYSb hc dS`abSVS\ Wab c\R eSZQVS @]ZZS SW\ >OQYOUS Tº` ROa HcU`WTTa`SQVb a^WSZb !%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% `]U`O[[WS`c\U Wab Sa RS\ HcU`WTT OcT 2O bS\ c\R ;SbV]RS\ a] abO`Y eWS [rUZWQV SW\hcaQV`É\YS\ 2ORc`QV eS`RS\ [rUZWQVS 4SVZS`_cSZZS\ `SRchWS`b 0SW Z]YOZS\ DO`WOPZS\ ]RS` PSW RS\ >O`O[SbS`DO`WOPZS\ d]\ ;SbV]RS\ Wab RWS 0SU`S\hc\U W\ RWS A^`OQVS SW\US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ZZS[ RO`W\ •
ROaa XSRSa >OYSb SW\S\ SWUS\S\ OYSbSa SW\RScbWU aSW\ ES\\ W\ O\RS`S\ >OYSbS\ RWSaSZPS\ OYSb\O [S\a c\bS`aQVWSRS\
•
2WS heSWbS eWQVbWUS 0SRScbc\U RS` >OYSbPWZRc\U PSabSVb RO`W\ ROaa OZZS 3ZS [S\bS RWS \WQVb OcaR`ºQYZWQV Rc`QV a^ShWSZZS ;]RWTWS` USYS\\hSWQV\Sb aW\R W\ \S`VOZP RWSaSa >OYSba aWQVbPO` aW\R /cT aWS YO\\ d]\ OZZS\ 9ZOaaS\ RWSaSa >OYSba hcUSU`WTTS\ eS`RS\
A^SWQVS`\ AWS ROa T]ZUS\RS >`]U`O[[ IdVaXUU! W\ SW\S[ SWUS\S\ =`R\S` W\\S`VOZP 7V`S` @]]bRW`SQb]`g OP 2S` >OQYOUS\O[S [caa WRS\bWaQV aSW\ [Wb RS[ OQYOUSO\UOPS W\ RS` S`abS\ HSWZS RWSaS` 2ObSW eW`R RWS 9ZOaaS hc[ 0S abO\RbSWZ SW\Sa >OYSba \É[ZWQV hc[ 3ZS[S\b RSa >OYSba \TaZTa 2S` >OQYOUS`]U`O[[ IdVaXUU! [Wb RS[ /cT `cT RSa 1][^WZS`a Oca RWSaS` 1][[O\RZW\S c[ c\R \WQVb Oca SW\S` 3\beWQYZc\Ua c[USPc\U ÍPS`^`ºTS\ AWS W\ eSZQVS[ =`R\S` aWQV RWS S`hScUbS 1ZOaaRObSW [Wb RS[ 0gbSQ]RS PSTW\RSb A^SWQVS`\ AWS RWS \OQVT]ZUS\RS 2ObSW W\ RS` @]]b2W`SQb]`g RSa =`R\S`a \TaZTa OP OZa] \WQVb W\ RS[aSZPS\ =`R\S` eWS RWS 1ZOaa2ObSW IdVaXUU!YPeP a]\RS`\ W\ RS[ ºPS`US]`R\SbS\ 4]ZRS` ?a^VaP\\ IdVaXUUCTbc!) 1T]dciT] STa :[PbbT TX]Tb ?PZTcb import merker.*; public class ZugriffTest02 { public static void main(String[] a) { Zugriff02 z1 = new Zugriff02(); z1.setZahl1(15); z1.ausgeben(); } } 2c`QV RWS /\UOPS W\ RS` S`abS\ HSWZS RWSaS` 2ObSW YO\\ RWSaSa >`]U`O[[ OcT RWS 1ZOaa4WZS \TaZTaIdVaXUU! hcU`SWTS\ ]V\S W[[S` eWSRS` RS\ >OQYOUS\O[S\ [Wb O\hcUSPS\ /ZbS`\ObWd YO\\ RWSaS /\UOPS OcQV S\bTOZZS\ RO\\ [ºaabS RWS 3`hSc Uc\U RS` 7\abO\h W\ RS` dWS`bS\ HSWZS ZOcbS\( merker.Zugriff02 z1 = new merker.Zugriff02();
!%!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% `]U`O[[ IdVaXUUCTbc! c[ /QVbS\ AWS RO`OcT ROaa RWSa Oca RS` 1][[O\RZW\S USaQVWSVb c\R ROaa AWS d]`VS` W\ RS\ =`R\S` dS`heSWUS\ W\ RS[ aWQV RWSaSa >`]U`O[[ PSTW\RSb 2WS C[eO\RZc\U aQVZÉUb TSVZb Sa Y][[b RWS 4SVZS`[SZRc\U( "merker.Zugriff02 is not public in merker; cannot be accessed from outside package". EWS RWSaS` 4SVZS` hc PSVSPS\ Wab eS`RS\ eW` W[ /PaQV\Wbb $% PSa^`SQVS\ 3a TSVZb ZSRWUZWQV SW\ AQVZºaaSZe]`b FTXcTaT 8]U^a\PcX^]T] id ?PRZPVTb 4º` RWS DS`UOPS d]\ >OQYOUSOQYOUSa Wab OcQV RS` 0S U`WTT :WP`O`g 2WS USaO[bS [WbUSZWSTS`bS 9ZOaaS\PWPZW]bVSY RS` 829 Wab ]`UO\WaWS`b W\ >OYSbS\ 2WS />72]Yc[S\bObW]\ a]e]VZ Tº` RWS AbO\RO`R3RWbW]\ OZa OcQV Tº` RWS 3\bS`^`WaS c\R ;WQ`]3RWbW]\ Wab \OQV >OYSbS\ c\bS`bSWZb 2Oa T]ZUS\RS 0SWa^WSZ^`] U`O[[ S`[WbbSZb RWS /\hOVZ RS` >OYSbS ?a^VaP\\ ?PRZPVT;Xbc ) FXTeXT[ ?PZTcT VXQc Tb X] STa 9!B4. public class PackageList01 { public static void main(String[] a) { java.lang.Package[] all = java.lang.Package.getPackages(); System.out.println("Es gibt " + all.length + " Pakete"); } }
ÎQd]V id\ ?a^VaP\\ ?PRZPVT;Xbc Ò\RS`\ AWS ROa >`]U`O[[ ?PRZPVT;Xbc YPeP a] OP ROaa OcQV RWS OYSbS c\R \WQVb \c` RWS 5SaO[bO\hOVZ OcaUSUSPS\ eS`RS\ ;»bd]Vbe^abRW[PV
public class PackageList02 { public static void main(String[] a) { java.lang.Package[] all = java.lang.Package.getPackages(); for (int i=0; i ?
2? !$! 2? '$ EW\R]ea
2 = A
SPACE EXCLAMATION MARK QUOTATION MARK NUMBER SIGN DOLLAR SIGN PERCENT SIGN AMPERSAND APOSTROPHE LEFT PARENTHESIS RIGHT PARENTHESIS ASTERISK PLUS SIGN COMMA HYPHEN-MINUS FULL STOP SOLIDUS DIGIT ZERO DIGIT ONE DIGIT TWO DIGIT THREE DIGIT FOUR DIGIT FIVE DIGIT SIX DIGIT SEVEN DIGIT EIGHT DIGIT NINE COLON SEMICOLON LESS-THAN SIGN EQUALS SIGN GREATER-THAN SIGN QUESTION MARK
BSWZ d]\ &( 1]RS^]W\b ! $!( HWTTS`\ c\R A]\RS`hSWQVS\ WRS\bWaQV [Wb CA /A177
!&%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
2 3XT TabcT] !$% D]XR^STITXRWT] UUUU
1]RS ^]W\b RSh
VSfO RSh
Ag[ P]Z D]XR^ST VOb OPeSWQVS\RS 0SZSUc\U
!'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
2 3XT TabcT] !$% D]XR^STITXRWT] UUUU
1]RS ^]W\b RShW[ 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
VSfO RSh
Ag[ P]Z D]XR^ST # c\R &' WRS\bWaQV 1> VOb OPeSWQVS\RS 0SZSUc\U
!'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
Ŋ ŏ Ŏ Ō ņ Ő ã Ã ś ŕ Ū ŧ š ő ŭ ¤ ð Ð Ê Ë È ı Í Î Ï ŋ ň Ű ů ¦ Ì Ů
2
3XT TabcT] !$% D]XR^STITXRWT] UUUU
1]RS ^]W\b RShW[ 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
VSfO RSh 0x00E0 0x00E1 0x00E2 0x00E3 0x00E4 0x00E5 0x00E6 0x00E7 0x00E8 0x00E9 0x00EA 0x00EB 0x00EC 0x00ED 0x00EE 0x00EF 0x00F0 0x00F1 0x00F2 0x00F3 0x00F4 0x00F5 0x00F6 0x00F7 0x00F8 0x00F9 0x00FA 0x00FB 0x00FC 0x00FD 0x00FE 0x00FF
Ag[ P]Z D]XR^ST VOb OPeSWQVS\RS 0SZSUc\U
!'!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
3 :^\_[TccQTXb_XT[ TX]Ta eTacTX[cT] 0__[XRPcX^]
*
1USVRKZZHKOYVOKRKOTKX\KXZKORZKT'VVROIGZOUT
2Oa 9O^WbSZ $! Ab`SO[a S\bVÉZb T]ZUS\RSa 0SWa^WSZ^`]U`O[[ hc[ AQV`SWPS\ c\R :SaS\ ºPS` SW\S B1>7>:SWbc\U ?a^VaP\\ BcaTP\#) BTaeTa U¶a :^\\d]XZPcX^] ¶QTa C2?8?ETaQX]Sd]V import java.net.*; import java.io.*; class Stream04 { public static void main(String[] args) throws Exception ServerSocket ss = new ServerSocket(1500); Socket s = ss.accept();
{
DataInputStream ein = new DataInputStream(s.getInputStream()); int zahl = ein.read(); System.out.println(zahl); } } Hc[ drZZWUS\ DS`abÉ\R\Wa aW\R SW\WUS 9S\\b\WaaS RSa B1>7>>`]b]Y]ZZa S`T]`RS`ZWQV 2Oa >`]U`O[[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[T\T]cXTad]V O >VOaS RS` A]TbeO`SS\beWQYZc\U W\ RS` Oca RS` :SWabc\UaPSaQV`SWPc\U [Wb 3\b ec`TaVWZTa[WbbSZ\ eWS >`]U`O[[OcTZOcT^ZO\ ]RS` Ab`cYb]U`O[[S\ RS` ?cSZZQ]RS RS` >`]U`O[[S S`abSZZb eW`R aWSVS OcQV 1]RWS`c\U P 0SW dS`bSWZbS\ AgabS[S\ RWS >VOaS W\ RS` RWS TS`bWU OcaUSbSabSbS\ >`]U`O[[S OcT RS\ @c\BW[SAgabS[S\ W\abOZZWS`b eS`RS\ OcQV 2S^Z]gS\ US\O\\b 8]U^a\PcX^] 7XSX]V 5SVSW[\Wa^`W\hW^ 2WSaSa 9]\hS^b PSaQV`SWPb SW\S eWQVbWUS BSQV\WY c[ UcbS A]TbeO`S hc S`abSZZS\ 2S\\ RORc`QV eW`R Sa c\[rUZWQV US[OQVb ROaa =PXSYbS RS\ W\bS`\S\ HcabO\R O\ RS`S` =PXSYbS W\ c\S`eO`bSbS` ESWaS ZSaS\ ]RS` É\RS`\ aWSVS OcQV 9O^aSZc\U 4º` RS\ /\eS\RS` SW\Sa ;]RcZa W\ 8OdO( 9ZOaaS PSRScbSb W\T]`[ObW]\ VWRW\U ROaa \WQVb \c` RWS 2ObS\ab`cYbc`S\ a]\RS`\ OcQV RWS /ZU]`WbV[S\ dS`P]`US\ aW\R S` [caa aWQV [Wb RS\ W\bS`\S\ 2SbOWZa \WQVb PSaQVÉTbWUS\ "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
4
6[^bbPa
8]XcXP[XbXTaT] 3W\S\ AbO`beS`b /\TO\UaeS`b Tº` SW\S DO`WOPZS dS`USPS\ S\beSRS` Ocb][ObWaQV ] RS` Rc`QV /\eSWac\US\ RSa >`]U`O[[WS`S`a 8]ZaT\T]c 3`VrVc\U HceOQVa) USerV\ZWQV O\USUSPS\ OZa 2WTTS`S\h heWaQVS\ heSW /`PSWba aQV`WbbS\ 7\Y`S[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