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`S\ d]\ 1][ ^cbS`\ hc USPS\ /Za >`]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[ 0cQV aSZPab OcaTºV`S\ hc Yr\\S\ 6W\eSWaS hc[ 0ShcU c\R hc` 7\abOZZObW]\ RWSaS` >`]RcYbS USPS\ eW` W[ S`abS\ 9O^W bSZ RSa 0cQVSa /ZZS 2ObS\dS`O`PSWb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RO`abSZZS\ % ! HOVZS\agabS[S c\R RS` 0W\É`Q]RS % ! 7\T]`[ObW]\aT]`[S\ ' !! /A1771]RS ! !"
3`eSWbS`c\US\ RSa /A1771]RS!"
!# @SW\ PW\É`S 1]RWS`c\U d]\ HOVZS\ !# !$ C\WQ]RS !$
" 9ZOaaS\ c\R O\RS`S Bg^S\ PSaQV`SWPS\ RSQZO`ObW]\ "! "
2SYZO`ObW]\aO\eSWac\U""
" EOa Wab RS` 2ObS\bg^-"# "! @STS`S\hbg^S\ "& "" A^ShWOZTOZZ( >`W[WbWdS 2ObS\bg^S\ # D77
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# @/; dS`eOZbS\( DO`WOPZS c\R =PXSYbS S`hScUS\ $! # EOa aW\R DO`WOPZS\- $! # >`W[WbWdS DO`WOPZS\ $" #! @STS`S\hdO`WOPZS\ $& #" 9]\abO\bS\ %" ## :WbS`OZS %$ #$ HcaO[[S\TOaac\U
$ 3W\UOPS c\R /caUOPS Rc`QVTºV`S\ W]]^S`ObW]\ &% $
Ab`SO[9]\hS^b &%
$
AbO\RO`R3W\UOPS'"
$!
AbO\RO`R/caUOPS'&
$"
2ObSWdS`O`PSWbc\U
% /caR`ºQYS dS`abSVS\ Sf^`SaaW]\ ! % =^S`O\RS\ c\R =^S`Ob]`S\" % /`WbV[SbWaQVS =^S`Ob]`S\$ %! DS`UZSWQVa]^S`Ob]`S\ ! %"
:]UWaQVS =^S`Ob]`S\ !"
%# 0WbeSWaS =^S`Ob]`S\ " %$ /caeS`bc\Ua@SWVS\T]ZUS >`ÉhSRS\h`SUSZ\"#
& /\eSWac\US\ Y]RWS`S\ abObS[S\ba "% & 3W\TOQVS c\R hcaO[[S\USaSbhbS /\eSWac\US\ "& & ES`bShceSWac\U # &! AbScS`O\eSWac\US\#" &" DS`heSWUc\US\ ASZSYbW]\ /caeOVZ ## &# AQVZSWTS\ 7bS`ObW]\ EWSRS`V]Zc\U :]]^ $% &$ A^`c\U/\eSWac\US\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S`RS\ ZSaS\ c\R RO\OQV RWS 2]e\Z]ORAQVOZbTZÉQVS O\YZWQYS\
•
/cT RS` RO\\ T]ZUS\RS\ ASWbS eS`RS\ hc` /caeOVZ R`SW >`]RcYbS O\USP]bS\( • S\beSRS` ROa Y][^ZSbbS 829 W\QZcaWdS <Sb0SO\a 723 • ]RS` \c` ROa Y][^ZSbbS 829 • ]RS` \c` RWS 8@3 @c\BW[SC[USPc\U
•
AWS PS\rbWUS\ ROa Y][^ZSbbS 829 OZZS`RW\Ua ]V\S <SbPSO\a 723
•
8Sbhb Wab \c` \]QV hc S\baQVSWRS\ Tº` eSZQVS >ZObbT]`[ RWS 829 PS\rbWUb eW`R 4º` ;AEW\R]ea eW`R RO\\ h0 RS` 2]e\Z]OR RS` 2ObSW YSZ N$NN]] fX]S^fbX$'%_TgT QO # ;0 USabO`bSb
ESWbS`S RSbOWZZWS`bS 6W\eSWaS Tº` RWS 8]bcP[[PcX^] RS` A29 c\bS` ;AEW\R]ea aWSVS /\VO\U /
8O RS\\ OZZS 0SWa^WSZS W\ RWSaS[ 0cQV aW\R [Wb RS` DS`aW]\ # USbSabSb c\R ZOcTTÉ VWU 3W\WUS >`]U`O[[S S\bVOZbS\ <ScS`c\US\ RWS S`ab [Wb RS` DS`aW]\ # SW\USTºV`b e]`RS\ aW\R ÉZbS`S DS`aW]\S\ dS`c`aOQVS\ C[eO\RZc\Ua ]RS` OcQV :OcThSWbTSVZS` :»]]T] \TWaTaT 93:ETabX^]T] X]bcP[[XTac bTX].
8O OcT SW\S` ;OaQVW\S Yr\\S\ [SV`S`S c\bS`aQVWSRZWQVS DS`aW]\S\ RS` 829 W\abOZ ZWS`b c\R OcQV ^O`OZZSZ US\cbhb eS`RS\ A] Yr\\S\ c\bS` SW\S[ 0Sb`WSPaagabS[ h0 a]e]VZ RWS ÉZbS`S DS`aW]\ " OZa OcQV RWS DS`aW]\ # d]`VO\RS\ aSW\ ESZQVS RWSaS` DS`aW]\S\ XSeSWZa US\cb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` 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
•
4º` ROa /`PSW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\ 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`
ÎTT\S\ AWS SW\ 4S\abS` Tº` RWS 3W\UOPSOcTT]`RS`c\U :W\cfAVSZZ Phe c\bS` ;A EW\R]ea SW\S 2=A3W\UOPSP]f
•
7\ RWSaS[ 1]\a]ZS4S\abS` dS`heSWUS\ AWS W\ RS\ a]SPS\ \Sc O\USZSUbS\ =`R \S` h0 RS T)K\TaZTa
•
2]`b PWbbS SW\USPS\( YPeP eTabX^] 2ORc`QV eW`R RS` 7\bS`^`SbS` OcTUS`cTS\ c\R RWS 8OdODS`aW]\ O\UShSWUb ES\\ [Wb 8 A3 # USO`PSWbSb eW`R aWSVb RWS /caUOPS eWS T]ZUb Oca(
•
E:\merker>java -version java version "1.5.0_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08) Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing).
5SPS\ AWS PWbbS \c` YPeP SW\ 2ORc`QV `cTS\ AWS RS\ 7\bS`^`SbS` RWS 8D; OcT ESWZ eSWbS`S 7\T]`[ObW]\S\ Tº` RS\ 7\bS`^`SbS` TSVZS\ eS`RS\ 6WZTS 7\T]`[ObW]\S\ OcaUSUSPS\ 2WS Ag\bOf RSa 0STSVZa eW`R PSaQV`WSPS\ c\R OZZS [rUZWQVS\ =^bW]\S\ h0 dS`aW]\ OcTUSZWabSb
#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
4X][TXcd]V) 3XT 0aQTXc e^aQTaTXcT]
*GYKXYZK0G\G6XUMXGSSKXYZKRRKT[S]GTJKRT[TJG[YLNXKT
Hc` 3W\TºV`c\U eS`RS\ eW` ROa aW[^SZabS 8OdO>`]U`O[[ ROa Sa UWPb S`abSZZS\ c\R OcaTºV`S\ 2Oa >`]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][^WZS` 7\bS`^`SbS` cae RW`SYb Rc`QV BSfbY][[O\ R]a W\ SW\S[ 1][[O\R^`][^b 2WSa YO\\ RWS 2=A3W\UOPSOcTT]`RS`c\U W\ ;AEW\R]ea ]RS` SW\S C\WfAVSZZ aSW\ 2ORc`QV dS`hW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gbSQ]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]
3`abSZZS\ AWS RS\ ?cSZZbSfb( BW^^S\ AWS RWS Tº\T HSWZS\ RSa >`]U`O[[a [Wb SW\S[ PSZWSPWUS\ BSfbSRWb]` SW\ 2OPSW Wab c\PSRW\Ub OcQV OcT RWS 5`]z 9ZSW\aQV`SWPc\U hc OQVbS\
•
AWQVS`\ AWS RWS ?cSZZRObSW( 2S` ?cSZZbSfb [caa c\bS` RS[ TZWQVb RS\\ S` [caa [Wb RS[ W\bS`\S\ 9ZOaaS\
•
EO\RSZ\ AWS RWS ?cSZZRObSW c[( 2Ohc [caa W\ RS\ =`R\S` RS` RWS ?cSZZRObSW S\bVÉZb dS`heSWUb eS`RS\ 2]`b SdS\bcSZZ [Wb bTc _PcW ^`ºTS\ ]P ROa 1][^W ZS`^`]U`O[[ OcQV USTc\RS\ eW`R 2O\\ eW`R RWS C[eO\RZc\U USabO`bSb [Wb( YPePR CTbc YPeP
2S` 8OdO1][^WZS` eW`R OcTUS`cTS\ Rc`QV)
YPePR CTbc YPeP
FPb Xbc SPb 4aVTQ]Xb STa D\fP]S[d]V.
2WS TSVZS`T`SWS C[eO\RZc\U RSa >`]U`O[[a S`YS\\PO` RO`O\ ROaa YSW\S Sf^ZWhWbS 4SVZS`[SZRc\U OcaUSUSPS\ eW`R TºV`b ROhc ROaa SW\S \ScS 2ObSW S`abSZZb eW`R 2WS aS VOb RWS 2ObSWS\Rc\U R[Pbb c\R aWS S\bVÉZb RS\ OcaTºV`PO`S\ 1]RS PgbSQ]RS A]ZZbS SW\S 4SVZS`[SZRc\U Y][[S\ a] dS`acQVS\ AWS RWSaS hc W\bS`^`SbWS`S\ 6W\ eSWaS ROhc aWSVS /PaQV\Wbb "! Hc[W\RSab RWS HSWZS\\c[[S` RS` TSVZS`VOTbS\ HSWZS YO\\ SW\S 6WZTS aSW\ 9]``WUWS`S\ AWS SdS\bcSZZS BW^^TSVZS` c\R dS`USaaS\ AWS \WQVb RO\OQV RWS C[eO\R Zc\U S`\Scb hc abO`bS\ 3`ab eS\\ RWS 1][^WZWS`c\U TSVZS`T`SW [rUZWQV Wab eW`R SW\S \ScS 2ObSW [Wb RS` 3\Rc\U R[Pbb W[ /`PSWba]`R\S` S`hScUb 2Oa Wab RWS 2ObSW Tº` RWS /caTºV`c\U FXT fXaS SXT 0dbU¶Wad]V VTbcPacTc- 4º` RWS /caTºV`c\U PS\rbWUb [O\ RWS @c\BW[SC[USPc\U d]\ 8OdO :OcThSWbc[US Pc\U AWS S\bVÉZb RS\ 8OdO7\bS`^`SbS` ROa Wab SW\ >`]U`O[[ ROa RS\ 0gbSQ]RS W\ bS`^`SbWS`b RV HSWZS Tº` HSWZS W\ RS\ ;OaQVW\S\Q]RS c[eO\RSZb c\R OcaTºV`b 2S` 8OdO7\bS`^`SbS` eW`R OcTUS`cTS\ Rc`QV( YPeP CTbc
2c`QV RS\ /cT`cT RSa >`]U`O[[a YPeP eW`R RWS 8OdO DW`bcSZZS ;OaQVW\S [Wb RS[ 7\bS`^`SbS` USabO`bSb 2WSaS ZÉRb RWS 1ZOaa2ObSW [Wb RS[ `]U`O[[a eW`R eWS T]ZUb USabO`bSb( %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
4X][TXcd]V) 3XT 0aQTXc e^aQTaTXcT]
java Test01
/QVbc\U( 2WS 2ObSWS\Rc\U R[Pbb RO`T Tº` CTbc \WQVb O\USUSPS\ eS`RS\ 2WS 2ObSW YPePTgT abO`bSb SW\S dW`bcSZZS 8OdO;OaQVW\S 8D; c\R PSS\RSb RWSaS a]POZR ROa 8O dO>`]U`O[[ CTbc R[Pbb PSS\RSb Wab 6WS` Wab SW\ >`]b]Y]ZZ RS` Rc`QVUSTºV`bS\ /`PSWbS\ c\bS` ;AEW\R]ea(
/PP ( C[eO\RSZ\ c\R BSabS\ ^S` 1][[O\RZW\S W\ SW\S` 2=AAWbhc\U
/PP !( >`]U`O[[ CTbc!YPeP SRWbWS`S\ [Wb 8=3
&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# 3Pb TabcT 9PeP?a^VaP\\ TabcT[[T] d\fP]ST[] d]S PdbU¶WaT]
/\aQVZWSzS\R S`T]ZUb ºPS` ROa 2ObSW;S\º RWS AWQVS`c\U RSa ?cSZZbSfbSa /QVbc\U( RS` 2ObSW\O[S Wab XSbhb CTbc! RWS 2ObSWS\Rc\U YPeP eW`R Ocb][ObWaQV dS`USPS\ 2WS C[eO\RZc\U c\R /caTºV`c\U RSa >`]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[
•
ES\\ SW\S >`]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
2WSaSa 9O^WbSZ PSaQV`SWPb OZa] RWS D]`aQV`WTbS\ c\R 3[^TSVZc\US\ Tº` RS\ /cTPOc SW\Sa 8OdO^`]U`O[[a EWS PSW XSRS` >`]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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PS\ ?a^VaP\\ ) 3Pb TabcT PdbU¶WaQPaT 9PeP_a^VaP\\ \Xc TX]Ta
public class Einfuehrung01 { public static void main(String[] args) { // Datenbeschreibung = Womit? // Methoden = Was? // Steueranweisungen = In welcher Reihenfolge? } }
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!
FPb Xbc TX] 9PeP?a^VaP\\.
'TGZUSOKJKYKXYZKT0G\G6XUMXGSSY 7\ RS` S`abS\ HSWZS eW`R RWS 9ZOaaS RSTW\WS`b AWS PSY][[b RS\
public class Einfuehrung01 ... }
{
7\ RS` heSWbS\ HSWZS PSUW\\b RWS 0SaQV`SWPc\U RS` ;SbV]RS \PX] 8SRS 8OdO /^^ZWQObW]\ [caa US\Oc SW\S \PX];SbV]RS S\bVOZbS\ c\R RWSaS [caa [Wb SW\S` HSWZS RWS US\Oc RWSaS\ /cTPOc VOb PSUW\\S\(
public static void main(String[] args) { ... }
3W\S ;SbV]RS PSabSVb Oca RS[ `]hSaa]` 2WS ;SbV]RS S\RSb W\ RS` d]`ZSbhbS\ HSWZS RWSaSa >`] U`O[[a 7\\S`VOZP RS` ;SbV]RS \PX] abSVS\ R`SW :^\\T]cPaiTX[T] 9][[S\bO`S VOPS\ Tº` RWS /caTºV`c\U SW\Sa >`]U`O[[a YSW\S`ZSW 0SRScbc\U) aWS a]ZZbS\ d][ >`]U`O[ [WS`S` USaQV`WSPS\ eS`RS\ c[ Tº` aWQV aSZPab ]RS` Tº` 9]ZZSUS\ >`]U`O[[bSWZS \ÉVS` hc S`ZÉcbS`\ 9][[S\bO`S Yr\\S\ OcQV ºPS` [SV`S`S HSWZS\ USVS\ RO\\ PS UW\\S\ aWS [Wb c\R S\RS\ [Wb 2S` 1][^WZS` WU\]`WS`b RWSaS\ ?cSZZbSfb ÎQd]VT] id\ ?a^VaP\\ 4X]UdTWad]V ÎQd]V ) 3RWbWS`S\ AWS ROa ]O >`]U`O[[ A^SWQVS`\ AWS Sa c\bS` RS[ `]U`O[[ [OQVb UO` \WQVba /PS` Tº` RS\ /\TO\U Wab Sa SW\ aQVr\S` 3`T]ZU eS\\ Sa TSVZS`T`SW Q][^WZWS`b c\R USbSabSb eS`RS\ YO\\ 3W\S ?cSZZbSfbRObSW YO\\ SW\S ]RS` [SV`S`S 9ZOaaS\ S\bVOZbS\ ÎQd]V !) 4ºUS\ AWS RS` ?cSZZbSfbRObSW SW\S heSWbS 9ZOaaS VW\hc 2S`
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! 9PeP X\ ÎQTaQ[XRZ) 4abcT BRWaXccT \PRWT]
ÎQd]V "( Ò\RS`\ AWS RWS Ag\bOf RS` 9][[S\bO`hSWZS\ 0S\cbhS\ AWS \WQVb RWS ^`] HSWZS a]\RS`\ PSUW\\S\ AWS RS\ [SV`hSWZWUS\ 9][[S\bO` [Wb c\R PSS\RS\ AWS WV\ [Wb ;»bd]Vbe^abRW[PV)
public class Einfuehrung01 { public static void main(String[] args) { /* ... */ } } class Einfuehrung01a {} /QVbc\U( 2S` hcaÉbhZWQVS\ 9ZOaaS RO`T ]XRWc ROa E]`b _dQ[XR d]`O\USabSZZb aSW\ FPb Xbc TX]T D\fP]S[d]VbTX]WTXc R^\_X[PcX^] d]Xc- 3W\S ?cSZZbSfbRObSW \S\\b [O\ OcQV C[eO\RZc\UaSW\VSWb AWS YO\\ [SV`S`S 9ZOaaS\ S\bVOZbS\ /ca T]`[OZS\ 5`º\RS\ Wab ab`WYb hc c\bS`aQVSWRS\ ]P RWS ?cSZZbSfbRObSW OcQV SW\ aSZPababÉ\RWU OcaTºV`PO`Sa 8OdO>`]U`O[[ S\bVÉZb ]RS` ]P aWS ZSRWUZWQV Oca 9ZOaaS\PSaQV`SWPc\US\ PSabSVb RWS \WQVb aSZPababÉ\RWU ZOcTTÉVWU aW\R a]\RS`\ \c` d]\ O\RS`S\ >`]U`O[[S\ OcTUS`cTS\ eS`RS\ Yr\\S\ 4º` SW\S C[eO\RZc\UaSW\ VSWb USZbS\ T]ZUS\RS @SUSZ\( •
7\\S`VOZP SW\S` ?cSZZbSfbRObSW RO`T \c` TX]T 9ZOaaS RWS \PX];SbV]RS VOPS\ c\R RWSa Wab OcQV RWS SW\hWUS 9ZOaaS RWS RO\\ ROa E]`b _dQ[XR VOPS\ RO`T
•
2S`
•
2c`QV RWS C[eO\RZc\U eW`R Oca XSRS` 9ZOaaS W\ SW\S` C[eO\RZc\UaSW\VSWb SW \S SWUS\S R[Pbb2ObSW 2WSaS S\bVOZbS\ RS\ 0gbSQ]RS Tº` RWS /caTºV`c\U
`]U`O[[ 4X]UdTWad]V Wab SW\ OcaTºV`PO`Sa >`]U`O[[ RS\\ \c` RWSa S\bVÉZb RWS ;SbV]RS \PX] EWS AWS PS`SWba USaSVS\ VOPS\ eW`R SW\ aSZPababÉ\RWU ZOcTTÉVWUSa 8O dO^`]U`O[[ USabO`bSb W\RS[ RS` 7\bS`^`SbS` [Wb YPePTgT OcTUS`cTS\ eW`R c\R ROPSW RS` O`O[SbS` [WbUSUSPS\ eW`R ÎQd]V
id\ ?a^VaP\\ 4X]UdTWad]V P DS`acQVS\ AWS ROa >`]U`O[[ 4X]UdTWad]V P hc abO`bS\ 3a a]ZZbS T]ZUS\RS 4SVZS` [SZRc\U Y][[S\( NoSuchMethodError: main c\R ROa Wab RS` SW\RScbWUS 6W\eSWa RO`OcT ROaa SW\S 9ZOaaS ]V\S \PX];SbV]RS \WQVb aSZPababÉ\RWU OcaTºV`PO` Wab "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!
FPb Xbc TX] 9PeP?a^VaP\\.
=GYYOTJ0G\G'VVROIGZOUTKT% 2WS 0SWa^WSZS W\ RWSaS[ 0cQV aW\R ºPS`eWSUS\R OcaTºV`PO`S >`]U`O[[S RV aWS aW\R 9ZOaaS\ RWS SW\S \PX];SbV]RS S\bVOZbS\ 2WSaS eS`RS\ PShSWQV\Sb OZa 8OdO /^^ZWQObW]\ AWS aW\R W[ 5SUS\aObh hc O\RS`S\ 8OdO9ZOaaS\ 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 USa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bS\ >`]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 US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^`OQVS T]`[OZ PSaQV`WSPS\ A] UWPb Sa U`OTWaQVS 0SaQV`SWPc\Uaa^`OQVS ]RS` OcQV Ag\bOf2WOU`O[[S h0 1PRZdb=Pda5^a\ 1=5 aWSVS /\VO\U 0 EWQVbWUS Ag\bOf`SUSZ\ RS` 8OdOA^`OQVS aW\R( •
8OdO>`]U`O[[S PSabSVS\ 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
'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! 9PeP X\ ÎQTaQ[XRZ) 4abcT BRWaXccT \PRWT]
•
2WS AQV`SWPeSWaS W[ ?cSZZbSfb Wab T]`[ObT`SW 3W\S [OfW[OZS HSWZS\ZÉ\US Wab \WQVb TSabUSZSUb 2WS AbScS`hSWQVS\ eWS HSWZS\aQVOZbc\U ZW\STSSR ]RS` BOPcZOb]` bOP a^WSZS\ YSW\S @]ZZS Tº` RWS 7\bS`^`SbObW]\ RSa ?cSZZbSfba
•
8OdO c\bS`aQVSWRSb heWaQVS\ 5`]z c\R 9ZSW\aQV`SWPc\U [O\ aOUb 8OdO Wab QO aSaS\aWbWd
•
/[ 3\RS SW\Sa 0STSVZa abSVb SW\ AS[WY]Z]\
•
9][[S\bO`S Yr\\S\ PSZWSPWU SW\USTºUb eS`RS\( •
O[ HSWZS\S\RS RO\\ PSUW\\S\ aWS [Wb ]RS` OcQV
•
ºPS` [SV`S`S HSWZS\ RO\\ PSUW\\S\ aWS [Wb c\R S\RS\ [Wb
ÎQd]V id\ ?a^VaP\\ 4X]UdTWad]V! DS`acQVS\ AWS hc YZÉ`S\ eOa RWS AQVZºaaSZer`bS` c\R eOa RWS 7RS\bWTWS` W\ RWSaS[ >`]U`O[[ aW\R 6W\eSWa( AQVZºaaSZer`bS` eS`RS\ TO`PZWQV OPUSV]PS\ W[ 8=3 3RWbWS`TS\abS` Ò\RS`\ AWS RO\OQV ROa S`abS B]YS\ W\ RWSaS[ >`]U`O[[ d]\ R[Pbb OcT 2[Pbb BSabS\ AWS RWS @SOYbW]\ RSa 1][^WZS`a OcT RWSaS Ò\RS`c\U
(K`KOINTKXOJKTZOLOKX[TJ4GSKTYXKMKRT
=ULX]KXJKT4GSKT\KXMKHKT% 7RS\bWTWS` aW\R T`SW USeÉVZbS OYSbS 8SRSa E]`b S\RSb eS\\ d][ 1][^W ZS` SW\ B`S\\hSWQVS\ RSZW[WbS` S`YO\\b eW`R B`S\\hSWQVS\ aW\R OZa] HSWQVS\ RWS heSW 3ZS[S\bS b]YS\ d]\SW\O\RS` b`S\\S\ c\R OPU`S\hS\ 2WSa Yr\\S\ eVW bSa^OQSa eWS :SS`abSZZS\ PZO\Y aSW\ ]RS` BOPcZOb]` ]RS` HSWZS\d]`aQVcP HSWQVS\ ?a^VaP\\ 4X]UdTWad]V") BRW[¶bbT[f»acTa d]S 1TiTXRW]Ta public class Einfuehrung03 { public static void main (String[] args) int zahl; zahl = 5; System.out.println(zahl); } }
{
ÎQd]V id\ ?a^VaP\\ 4X]UdTWad]V" 3RWbWS`S\ AWS ROa >`]U`O[[ /QVbc\U( SW\ /PbW^^S\ Wab W[[S` aW\\d]ZZ 4SVZS` [O QVS\ c\R 4SVZS` PSaSWbWUS\ VSZTS\ PSW[ :S`\S\ SW\S` >`]U`O[[WS`a^`OQVS EO\RSZ\ AWS ROa >`]U`O[[ c[ c\R TºV`S\ AWS Sa Oca ES\\ Sa TSVZS`T`SW ZÉcTb( 6S`hZWQVS\ 5ZºQYec\aQV ES\\ Sa C[eO\RZc\UaTSVZS` ^`]RchWS`b Y]``WUWS`S\ AWS RWSaS aSZPab abÉ\RWU Sa Yr\\S\ \c` BW^^TSVZS` aSW\
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!#
1TiTXRW]Ta XST]cXUXTa d]S =P\T]baTVT[]
8KMKRTLX4GSKTY\KXMGHK 2WS @SUSZ\ Tº` ROa 0WZRS\ RWSaS` 0ShSWQV\S` aW\R SW\TOQV 2Oa S`abS HSWQVS\ [caa SW\ ZObSW\WaQVS` 0cQVabOPS aSW\ RO\OQV Wab TOab XSRS` 0cQVabOPS\ Oca XSRS[ /Z^VOPSb aWSVS 6W\eSWaS hc[ BVS[O C\WQ]RS c\R XSRS HWTTS` S`ZOcPb 7\ RS` :É\US UWPb Sa OcQV YSW\S 0SU`S\hc\US\ Hc PSOQVbS\ Wab ZSRWUZWQV( •
2WS C\bS`aQVSWRc\U RS` 5`]z9ZSW\aQV`SWPc\U Wab eWQVbWU
•
AQVZºaaSZer`bS` aW\R `SaS`dWS`b c\R Rº`TS\ \WQVb Tº` ROa 0WZRS\ d]\ 0ShSWQV\S`\ PS\cbhb eS`RS\
•
ESWZ 8OdO YOc[ SW\S\US\RS D]`aQV`WTbS\ S\bVÉZb Tº` ROa 0WZRS\ d]\ `]U`O[[WS`S`a UST]`RS`b 3W\WUS 9]\dS\bW]\S\ hc RWSaS[ BVS[O T]Z US\ OcT RS\ \ÉQVabS\ ASWbS\ 6¶[cXVT eS\\ OcQV \WQVb c\PSRW\Ub S[^T]VZS\S
kundennummer weiß123 bool grün a_bereich diesIstEinIdentifier a
D]V¶[cXVT
-gross 1kdnr boolean class
3`abS AbSZZS YSW\ 0cQVabOPS Rb] @SaS`dWS`bSa E]`b @SaS`dWS`bSa E]`b
2WS Ag\bOf`SUSZ\ RS` 8OdOA^`OQVS aW\R ab`WYb SW\hcVOZbS\ DS`abrzS eS`RS\ \]`[O ZS`eSWaS d][ 1][^WZS` S`YO\\b c\R TºV`S\ hc Q][^WZSbW[SS``]`a ?a^VaP\\ Bh]cPg ) FPb Xbc WXTa UP[bRW. public class Syntax01 { public static void main(String args[]) int summe; Summe = 2000; System.out.println(summe); } }
{
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! 9PeP X\ ÎQTaQ[XRZ) 4abcT BRWaXccT \PRWT]
ÎQd]V id\ ?a^VaP\\ Bh]cPg 3RWbWS`S\ c\R Q][^WZWS`S\ AWS RWSaSa >`]U`O[[ 2WS 4SVZS`[SZRc\U PSW[ C[eO\ RSZ\ ZOcbSb( Ag\bOfXOdO("( QO\\]b TW\R ag[P]Z AW\\US[Éz PSRScbSb RWSa( 7\ RS` ?cSZZRObSW Bh]cPg YPeP W\ HSWZS " PSTW\RSb aWQV SW\ Ag[P]Z ROa c\PSYO\\b Wab C[ eSZQVSa Ag[P]Z Sa aWQV VO\RSZb abSVb W\ RS` \ÉQVabS\ HSWZS RS` 4SVZS`[SZRc\US\ 9]``WUWS`S\ AWS RS\ 4SVZS` c\R TºV`S\ AWS ROa >`]U`O[[ Oca
+OTOMK.OT]KOYK`[SMROINKT,KNRKXT
0SW[ 3\beWQYSZ\ d]\ \ScS\ >`]U`O[[S\ Yr\\S\ 4SVZS` hc c\bS`aQVWSRZWQVS\ HSWb ^c\YbS\ OcTb`SbS\ Phe S\bRSQYb eS`RS\ ;O\ c\bS`aQVSWRSb( 1][^WZSBW[S4SVZS` @c\BW[S4SVZS` c\R Z]UWaQVS 4SVZS`
)USVORK:OSK,KNRKX 2WSaS S\babSVS\ Rc`QV DS`abrzS USUS\ RWS Ag\bOf`SUSZ\ RS` A^`OQVS AWS eS`RS\ W\ XSRS[ 4OZZ d][ 1][^WZS` S`YO\\b ?a^VaP\\ Bh]cPg!) 6TVT] fT[RWT Bh]cPgaTVT[ fXaS eTabc^vT].
public class Syntax02 { public static void main(String[] args) String str System.out.println(str); } }
{
ÎQd]V id\ ?a^VaP\\ Bh]cPg! 3RWbWS`S\ c\R Q][^WZWS`S\ AWS RWSaSa >`]U`O[[ 2WS 4SVZS`[SZRc\U PSW[ C[eO\ RSZ\ ZOcbSb( Syntax02.java:4: ';' expected AW\\US[Éz PSRScbSb RWSa( 7\ RS` ?cSZZRObSW Bh]cPg!YPeP W\ HSWZS " TSVZb ROa AS[WY]Z]\ 9]``WUWS`S\ AWS RS\ 4SVZS` c\R TºV`S\ AWS ROa >`]U`O[[ Oca 0SW RS` 4SVZS`O\OZgaS [caa PSROQVb eS`RS\ ROaa RWS 4SVZS`c`aOQVS \WQVb c\PSRW\Ub OcQV W\ RS` O\USUSPS\S\ HSWZS ZWSUb aWS eW`R SdbZ \c` R]`b S\bRSQYb 7\ RWSaS[ 4OZZ TSVZb ROa AS[WY]Z]\ \Obº`ZWQV W\ RS` HSWZS ! /czS`RS[ Yr\\S\ Ag\bOfTSVZS` hc 4]ZUSTSVZS`\ TºV`S\ 2ORc`QV YO\\ Sa hc SW\S` UO\hS\ 9SbbS d]\ ;SZRc\US\ Y][[S\ ]Pe]VZ Sa dWSZZSWQVb \c` SW\S C`aOQVS UWPb 2SaeSUS\ a]ZZbS RWS 4SVZS`Y]``SYbc` W[[S` [Wb RS` S`abS\ 4SVZS`[SZRc\U RSa 1][ ^WZS`a PSUW\\S\ 0Sa]\RS`a bºQYWaQVS 4SVZS`[SZRc\US\ eS`RS\ ^`]RchWS`b eS\\ RWS 9ZO[[S`c\US\ Rc`QV USaQVeSWTbS ]RS` `c\RS 9ZO[[S`\ \WQVb `WQVbWU ]RS` \WQVb ^OO`eSWaS S`T]ZUb 2Ohc SW\ 0SWa^WSZ ROa OZZS`RW\Ua W\ d]ZZS[ C[TO\U \]QV \WQVb dS`abO\RS\ eS`RS\ YO\\ Sa USVb VWS` ZSRWUZWQV c[ RWS Ag\bOf
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!$
4X]XVT 7X]fTXbT id \»V[XRWT] 5TW[Ta]
?a^VaP\\ Bh]cPg") 6TbRWfTXUcT :[P\\Ta] caTcT] X\\Ta _PPafTXbT PdU
public class Syntax03 { public static void main(String[] args) { A a = new A(); // Instanz der Klasse A erzeugen System.out.println("Hallo"); } } class A {} ÎQd]V id\ ?a^VaP\\ Bh]cPg" 2Oa >`]U`O[[ [ºaabS TSVZS`T`SW c[eO\RSZPO` c\R OcaTºV`PO` aSW\ 3a ZWSTS`b OZa /caUOPS SW\S\ 5`cz 6OZZ] 2Oa >`]U`O[[ Tc\YbW]\WS`b OZa] 8Sbhb ZraQVS\ AWS PWb bS RWS R`WbbZSbhbS HSWZS [Wb RS` USaQVZ]aaS\S\ USaQVeSWTbS\ 9ZO[[S` EO\RSZ\ AWS \Sc c[ c\R ^`ºTS\ AWS RWS ;SZRc\U RSa 1][^WZS`a EOa ^OaaWS`b eS\\ AWS RWS 9ZO[[S` eWS RWS ;SZRc\U acUUS`WS`b W\ HSWZS % SW\TºUS\- 2WS 3`YS\\b\Wa Oca RS` ]PWUS\ ÍPc\U Wab( 2WS 4SVZS`[SZRc\U [SZRSb heO` SW\S\ 4SVZS` W\ RS` HSWZS ! bObaÉQVZWQV XSR]QV ZWSUb RWS C`aOQVS SW\WUS HSWZS\ eSWbS` VW\bS\
8[T:OSKY,KNRKX 3a YO\\ OPS` OcQV aSW\ ROaa RS` 1][^WZS` SW\S\ 4SVZS` \WQVb S`YS\\S\ YO\\ eSWZ RWSaS` S`ab hc` :OcThSWb RSa >`]U`O[[a ]TTS\PO` eW`R 2O\\ VO\RSZb Sa aWQV c[ a] US\O\\bS ad]cX\TTaa^a AWS eS`RS\ W\ 8OdO 3fQS^bW]\a US\O\\b `]U`O[[OP P`cQV TºV`S\ YO\\ ?a^VaP\\ ;PdUiTXcUTW[Ta ) Ad]CX\T4aa^a _a^SdiXTaT]
public class Laufzeitfehler01 { static void main(String[] args) { String name = new String("Merker"); System.out.println(name); } } ÎQd]V id\ ?a^VaP\\ ;PdUiTXcUTW[Ta DS`acQVS\ AWS ROa >`]U`O[[ c[hceO\RSZ\ c\R OcahcTºV`S\ 3`USP\Wa( 3a UWPb YSW \S\ Q][^WZSbW[SS``]` OZZS`RW\Ua P`WQVb RWS /caTºV`c\U OP [Wb T]ZUS\RS[ `c\bW[S S``]`( ;OW\ [SbV]R \]b ^cPZWQ 9]``WUWS`S\ AWS RS\ 4SVZS` c\R TºV`S\ AWS ROa >`]U`O[[ Oca !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! 9PeP X\ ÎQTaQ[XRZ) 4abcT BRWaXccT \PRWT]
2UMOYINK,KNRKX C\R RO\\ UWPb Sa \Obº`ZWQV Z]UWaQVS ]RS` aS[O\bWaQVS 4SVZS` RWS d]\ RS[ 1][^cbS` UO` \WQVb S`YO\\b eS`RS\ Yr\\S\ RWS OPS` hc TOZaQVS\ 3`USP\WaaS\ TºV`S\ eSWZ RS` >`]U`O[[WS`S` /\eSWac\US\ heO` ag\bOYbWaQV Y]``SYb OPS` d]\ RS` 0SRScbc\U VS` TOZaQV SW\USaSbhb VOb 2Oa T]ZUS\RS >`]U`O[[ S\bVÉZb SW\S\ Z]UWaQVS\ 4SVZS` 3a VO\RSZb aWQV c[ ROa 0SW a^WSZ^`]U`O[[ 4X]UdTWad]V! ROa RS\ BSfb 6OZZ] ESZb OcaUSPS\ a]ZZ 2Oa >`] U`O[[ ec`RS OZZS`RW\Ua O\ SW\S` S\baQVSWRS\RS\ AbSZZS []RWTWhWS`b ?a^VaP\\ ;^VXbRWT ) ;^VXbRWTa 5TW[Ta X\ ?a^VaP\\
class Logische01 { public static void main(String[] args) { String text; text = new String("Hallo "); System.out.println(text); text = text.concat("Welt"); } } ÎQd]V id\ ?a^VaP\\ ;^VXbRWT ES\\ AWS ROa >`]U`O[[ OcaTºV`S\ a]ZZbS SWUS\bZWQV RS` BSfb 6OZZ] ESZb OcaUSUS PS\ eS`RS\ :SWRS` TSVZb RWS ESZb eSWZ RS` >`]U`O[[WS`S` dS`aSVS\bZWQV ]RS` c\eWaaS\R \WQVb PSROQVb VOb ROaa RWS 0STSVZS aS_cS\bWSZZ OcaUSTºV`b eS`RS\ eS\\ S` \WQVba O\RS`Sa d]`aWSVb 9]``WUWS`S\ AWS ROa >`]U`O[[ c\R TºV`S\ AWS Sa Oca :rac\UaVW\eSWa( 2WS @SWVS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S` Sad RZT]ATRW]d]VT]
•
9]\abO\bS\\O[S\ eS`RS\ Y][^ZSbb U`]z USaQV`WSPS\ h0 I4=C
•
/ca VWab]`WaQVS\ 5`º\RS\ aW\R heO` RS` C\bS`ab`WQV M c\R ROa 2]ZZO`hSWQVS\ OZa S`abSa HSWQVS\ Tº` 7RS\bWTWS` S`ZOcPb WV`S DS`eS\Rc\U eW`R OPS` \WQVb S[^ T]VZS\
-[ZKX9ZORLX,UXSGZOKX[TM\UT7[KRRKTVXUMXGSSKT ES\\ OcQV US\S`SZZ RS` ?cSZZQ]RS T]`[ObT`SW Wab VOPS\ RWSaS S`abS\ 0SWa^WSZS PS `SWba UShSWUb ROaa Sa c\PSRW\Ub VWZT`SWQV Wab eS\\ RS` ?cSZZbSfb a] T]`[ObWS`b eW`R ROaa S` Tº` RS\ ;S\aQVS\ ZSWQVb ZSaPO` Wab A] a]ZZbS\ RWS USaQVeSWTbS\ 9ZO[[S`\ RWS W[[S` ^OO`eSWaS Q]RWS`b eS`RS\ [ºaaS\ OcQV ]^bWaQV OZa >OO` S`YS\\PO` aSW\ C\R ROa eW`R RORc`QV S``SWQVb ROaa RWS aQVZWSzS\RS 9ZO[[S` OcT RS`aSZPS\ A^OZbS
#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! 9PeP X\ ÎQTaQ[XRZ) 4abcT BRWaXccT \PRWT]
\WQVb dS`eSQVaSZ\ [Wb HSWZS abSVb eWS RS` 0SUW\\ RSa 0Z]QYa Hc` /PaQV`SQYc\U VWS` SW\ 0SWa^WSZ eWS ]XRWc Q]RWS`b eS`RS\ a]ZZbS( ?a^VaP\\ CaPbW ) B^ ]XRWc public class Trash01 { public static void main (String[] args){int summe;summe= 2000;System.out.println(summe);}} EWS [O\ aQVeS` S`YS\\S\ YO\\ VO\RSZb Sa aWQV c[ ROa PS`SWba PSYO\\bS >`] U`O[[ Bh]cPg YPeP 3a S`TºZZb OcQV W[[S` \]QV RWSaSZPS /cTUOPS RS\\ RW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aS\bZWQVS\ TW\RSb [O\ WV\ OZa SW\ bVS]`SbWaQVSa BVS[O W\ 32D:SV`PºQVS`\ &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"!
8]U^a\PcX^]bU^a\T]
/TLUXSGZOUTYLUXSKT
0SW[ DS`O`PSWbS\ d]\ 2ObS\ Rc`QV RS\ 1][^cbS` [ºaaS\ c\bS`aQVWSRZWQVS /`bS\ d]\ 7\T]`[ObW]\S\ c\bS`aQVWSRS\ eS`RS\( CTgcR^SXTad]V X\ 2^\_dcTa •
1]RWS`bS 3W\hSZW\T]`[ObW]\S\ RWS Oca TSab dS`SW\PO`bS\ HSWQVS\ SW\Sa /Z^VOPSba Oca HWTTS`\ ]RS` Oca HSWQVS\ SW\Sa AOQVUSPWSba eWS >VgaWY ]RS` ;ObVS[ObWY PS abSVS\ 4º` RWSaS HSWQVS\ YO\\ RWS /`b RS` 0WbdS`aQVZºaaSZc\U c\R RWS W\VOZbZW QVS 0SRScbc\U RS` PWba SW\[OZWU c\R OZZUS[SW\UºZbWU TSabUSZSUb eS`RS\ 2WS Hc ]`R\c\U RS` 0SRScbc\U hc RS\ 0WbT]ZUS\ eW`R 1]RS US\O\\b A] UWPb Sa h0 RS\ /A177 c\R RS\ 3012711]RS
•
3W\S 1]RSbOPSZZS ZSUb \WQVb \c` RWS 0WbT]ZUS\ TSab a]\RS`\ OcQV RWS bSfbZWQVS 0S aQV`SWPc\U Tº` XSRSa dS`SW\PO`bS HSWQVS\ PS\O\\bS HSWQVS\ <WQVb TSabUSZSUb Wab W\ SW\S[ 1]RS RWS 2O`abSZZc\UaT]`[ OZa] ROa /caaSVS\ ]RS` RWS 5`rzS RSa HSWQVS\a 2WS S\UZWaQVS 0ShSWQV\c\U Tº` HSWQVS\ Wab QVO`OQbS`
IPW[T]R^SXTad]V X\ 2^\_dcTa •
HOVZS\ PSabSVS\ Oca SW\hSZ\S\ HWTTS`\ c\R RO[Wb Oca [SV`S`S\ 1VO`OQbS` AWS eS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cabWaQVS 7\T]`[O bW]\S\ ]RS` Tº` DWRS]a 0WbT]ZUS\ W\ Y][^ZSbbS\ 2ObSWS\ 6WS` UWPb Sa YSW\S\ HSW QVS\aObh c\R YSW\S PgbSeSWaS =`R\c\U a]\RS`\ \c` SW\S c\PSU`S\hbS /\ SW\O\RS``SWVc\U d]\ SW\hSZ\S\ 0Wba RWS d]\ a^ShWSZZ ROTº` USaQV`WSPS\S\ >`]
'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" 8]U^a\PcX^]T] \PbRWX]T[[ SPabcT[[T]
U`O[[S\ W\bS`^`SbWS`b eS`RS\ 2WSa USaQVWSVb VÉcTWU c\bS` /\UOPS RSa a] US \O\\bS\ ;W[SBg^a h0 W[OUSUWT 2Oa T]ZUS\RS 0SWa^WSZ hSWUb RWS DS`O`PSWbc\U SW\S` 2ObSW [Wb RS` 2ObSWS\Rc\U fPe /cRW]2ObSW 2WSa Wab ROa SW\hWUS 0SWa^WSZ W\ RWSaS[ 0cQV ROa [Wb ;cZbW[SRWO 2ObS\ A]c\R DWRS] 0WZRS` ]RS` 5`OTWYS\ O`PSWbSb 7[ @SUSZTOZZ eS`RS\ ROTº` A^S hWOZYS\\b\WaaS W\aPSa]\RS`S OcQV 9S\\b\WaaS W\ RS` >`]U`O[[WS`c\U d]\ U`OTWaQVS\ 0S\cbhS`]PS`TZÉQVS\ PS\rbWUb c\R ROa Wab \WQVb BVS[O RWSaSa 0cQVSa ?a^VaP\\ B^d]S ) 0dSX^3PcTX PQb_XT[T] _Ta 9PeP?a^VaP\\ import java.net.*; import java.applet.*; public class Sound01 { public static void main(String[] args) throws Exception { URL url = new URL("file://c:/windows/media/chord.wav"); AudioClip clip = Applet.newAudioClip(url); clip.play(); } } 6W\eSWaS hc RS\ 0SWa^WSZS\ W\ RWSaS[ 9O^WbSZ EW` S[^TSVZS\ RWS 0SWa^WSZS W\ RWSaS[ 9O^WbSZ OcT XSRS\ 4OZZ aSZPab hc SRWbWS`S\ c[hceO\RSZ\ c\R [Wb WV\S\ hc O`PSWbS\ 2ORc`QV PSY][[S\ AWS ÍPc\U W[ 1]RWS `S\ c\R d]` OZZS[ OcQV W\ RS` 4SVZS`PSO`PSWbc\U AWS eS`RS\ dS`b`Ocb [Wb RS` Ag\bOf d]\ 8OdO OcQV eS\\ RWS AS[O\bWY \]QV \WQVb W\ XSRS[ 2SbOWZ dS`abO\RS\ eS`RS\ YO\\ 2Oa DS`abÉ\R\Wa Tº` RWS W\bS`\S 2O`abSZZc\U c\R Tº` RWS c\bS`aQVWSRZWQVS\ 1]RSa eW`R a^ÉbS` W[[S` eWSRS` PS\rbWUb h0 PSW RS\ PWbeSWaS\ =^S`Ob]`S\ 9O^WbSZ % ]RS` PSW RS` 2WaYcaaW]\ c[ [cZbW\ObW]\OZS /\eS\Rc\US\ ÎQd]V id\ ?a^VaP\\ B^d]S 2S\YS\ AWS PSW[ BSabS\ RSa >`]U`O[[a RO`O\ RS\ :Ocba^`SQVS` hc OYbWdWS`S\ Ò\ RS`\ AWS RO\OQV ROa >`]U`O[[ a] ROaa SW\S PSZWSPWUS O\RS`S A]c\R2ObSW OPUS a^WSZb eW`R 2WS PSYO\\bSabS\ DS`aQVZºaaSZc\UadS`TOV`S\ U¶a ITXRWT] aW\R RS` /A1771]RS dS` P`SWbSb W[ >1 c\R C<7F0S`SWQV RS` 3012711]RS dS`P`SWbSb OcT RS\ 70; 5`]z`SQV\S`\ c\R RS` C\WQ]RS 2WS S`abS\ PSWRS\ U`c^^WS`S\ RWS SW\hSZ\S\ 0Wba hc 3W\VSWbS\ d]\ &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
""
0B2882^ST
'9)//)UJK
7[ /A1771]RS 0[S`WQO\ BbO\RO`R 2]RS T]` 8\T]`[ObW]\ 8\bS`QVO\US eW`R XSRSa HSWQVS\ [Wb % PWb Q]RWS`b 3a aW\R OZa] & c\bS`aQVWSRZWQVS /A177HSWQVS\ [rUZWQV c\R RWSa aW\R eWS RS` `ºTPWb a] ROaa OcQV RS` CA/A1771]RS [Wb 0gbSa + & PWba O`PSWbSb 2WS & HSWQVS\ RSa /A1771]RSa aW\R Rc`QV\c[[S`WS`b 7\ SW\S` 1]RSBOPSZZS eS`RS\ RS\ 0cQVabOPS\ RSa /Z^VOPSba RS\ HWTTS`\ c\R SW\WUS\ A]\RS`hSWQVS\ RWS >ZObh\c[[S`\ % hcUS]`R\Sb c\R Tº` RWS W\bS`\S 2O`abSZZc\U eS`RS\ RWSaS RS hW[OZS\ >ZObh\c[[S`\ c[USeO\RSZb W\ SW\S PW\É`S 2O`abSZZc\U A] VOb RS` 5`]z PcQVabOPS / RWS >ZObh\c[[S` $# OcQV 2ShW[OZeS`b $# US\O\\b 7\ RS` PW\É`S\ 2O`abSZZc\U PSY][[S\ RWS % PWba RSa /A1771]RSa SW\S AbSZZS\eS`bWUYSWb d]\ PS UW\\S\R c\R RO\\ d]\ `SQVba \OQV ZW\Ya XSeSWZa RS\ R]^^SZbS\ ES`b 4º` RS\ 0cQV abOPS\ / aWSVb RWS [OaQVW\SZZS 2O`abSZZc\U c\R WV`S 7\bS`^`SbObW]\ OZa] eWS T]ZUb Oca( 0Wb[cabS`
AbSZZS\eS`b
& $" ! $ & "
C[`SQV\c\U
$"
$" + $#
/PP!( 0W\É`S 2O`abSZZc\U RSa 0cQVabOPS\a / W[ /A1771]RS BXT UX]ST] X\ 0]WP]V 2 TX]T 2^STCPQT[[T 2WSaS S\bVÉZb heO` RWS S`abS\ #$ HSW QVS\Q]RWS`c\US\ RSa C\WQ]RS aWSVS /PaQV\Wbb !$ R]QV RWS S`abS\ & HSWQVS\ aW\R WRS\bWaQV [Wb RS[ /A1771]RS 2]`b aW\R h0 RWS >ZObh\c[[S`\ $# c\R $$ eWS T]ZUb PSaQV`WSPS\( >ZObh <`
VSfORShW[OZS` Ag[P]Z ES`b
$#
f"
/
:ObW\ 1O^WbOZ :SbbS` /
$$
f"
0
:ObW\ 1O^WbOZ :SbbS` 0
/PP ! ( /caaQV\Wbb Oca /A177BOPSZZS Tº` >ZObh $# c\R >ZObh $$ 2WS VSfORShW[OZS 2O`abSZZc\U RWS\b OcaaQVZWSzZWQV RS[ HeSQY RWS 0WbT]ZUS SW\Sa HSWQVS\a ^`ÉU\O\b eWSRS`hcUSPS\ 3a Wab SPS\ SW\TOQVS` hc aOUS\ ROa 0gbS S\bVÉZb VSf " OZa Hc` 9S\\hSWQV\c\U ROaa RWSa SW\ VSfORShW[OZS` ES`b Wab eS`RS\ RWS PSWRS\ HSWQVS\ g RS[ SWUS\bZWQVS\ VSfES`b d]`O\USabSZZb ESRS` [Wb !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" 8]U^a\PcX^]T] \PbRWX]T[[ SPabcT[[T]
RS[ PW\É`S\ 7\VOZb \]QV [Wb RS` VSfORShW[OZS\ 0ShSWQV\c\U RSa 7\VOZba eW`R RS` >`]U`O[[WS`S` W[ >`]U`O[[ \]`[OZS`eSWaS O`PSWbS\ ?a^VaP\\ 0bRXX ) 0aQTXcT] \Xc ST\ 1dRWbcPQT] 0 X\ 9PeP?a^VaP\\ public class Ascii01 { public static void main(String args[]) { char zeichen = 'A'; System.out.println(zeichen); } } 3a Wab OcQV [rUZWQV O\abSZZS RSa HSWQVS\a RSaaS\ >ZObh\c[[S` W\ RS` BOPSZZS RSa /A1771]RSa OcahcUSPS\ ?a^VaP\\ 0bRXX!) 0dbVTQT] STa ?[Pci]d\\Ta TX]Tb ITXRWT]b public class Ascii02 { public static void main(String args[]) { char zeichen = 'A'; System.out.println((byte)zeichen); } } AWS eS`RS\ OPS` W\ RS\ \OQVT]ZUS\RS\ 0SWa^WSZS\ aSVS\ ROaa Tº` W\bS`\ObW]\OZS >`]U`O[[S USYS\\hSWQV\Sb Rc`QV [SV`S`S A^`OQVS\ c\bS`aQVWSRZWQVS A]\RS`hSW QVS\ YcZbc`SZZS 0Sa]\RS`VSWbS\ PSW RS` 2O`abSZZc\U d]\ HOVZS\ ]RS` 2Obc[aO\UO PS\ cae Sa VÉcTWU \]beS\RWU Wab HSWQVS\ c[hcT]`[S\ ]RS` W\RWdWRcSZZ hc W\bS` ^`SbWS`S\ 2Ohc aW\R RSbOWZZWS`bS 9S\\b\WaaS RS` 1]RWS`c\UaT]`[S\ c\R RS` dS`eS\ RSbS\ HSWQVS\Q]RSa S`T]`RS`ZWQV 2SaeSUS\ a]ZZ ROa \ÉQVabS >`]U`O[[ RS[]\ab`WS`S\ eWS RS` >`]U`O[[WS`S` a] e]VZ RS\ PW\É`S\ 7\VOZb OZa OcQV RWS VSfORShW[OZS @S^`ÉaS\bObW]\ SW\Sa 0gbSa Oca USPS\ YO\\ ?a^VaP\\ 0bRXX") 1X]ÊaTa d]S WTgPSTiX\P[Ta FTac TX]Tb ITXRWT]b public class Ascii03 { public static void main(String args[]) { char zeichen = 'A'; System.out.println(Integer.toBinaryString(zeichen)); System.out.println(Integer.toHexString(zeichen)); } } 2WS S`abS\ ! HSWQVS\ RSa /A1771]RSa aW\R Tº` AbScS`hSWQVS\ Q]\b`]Z QVO`OQbS` `SaS`dWS`b SbeO Tº` RWS AbScS`c\U SW\Sa 2`cQYS`a 2WSaS c\R`cQYPO`S\ 9]\b`]ZZhSW
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
""
0B2882^ST
QVS\ aW\R VWab]`WaQV PSU`º\RSb c\R VOPS\ VScbS YSW\S U`]zS 0SRScbc\U [SV` /ca \OV[S\ aW\R( BOPcZOb]` :W\S 4SSR :4 HSWZS\d]`aQVcP 1O``WOUS @Sbc`\ 1@ EOUS\`ºQYZOcT
2ShW[OZeS`b ' 2ShW[OZeS`b 2ShW[OZeS`b !
;Wb RS[ 2ShW[OZeS`b ! eW`R ROa :SS`hSWQVS\ a^OQS PZO\Y RO`USabSZZb ;O\ PSOQV bS( /cQV ROa :SS`hSWQVS\ Wab Tº` RS\ 2WUWbOZ`SQV\S` SW\ AQV`WTbhSWQVS\ \c` ROaa Sa [SWabS\a OcaaQVZWSzZWQV Rc`QV RWS 6W\bS`U`c\RTO`PS O[ 0WZRaQVW`[ RO`USabSZZb eW`R /P 2ShW[OZeS`b !! eS`RS\ W\ RS` BOPSZZS RWS eWQVbWUabS\ R`cQYPO`S\ HSWQVS\ Oca RS` S\UZWaQVS\ A^`OQVS dS`aQVZºaaSZb( RWS ZObSW\WaQVS\ 5`]z c\R 9ZSW\PcQVabOPS\ / H RWS HWTTS`\ ' c\R SW\WUS A]\RS`hSWQVS\ ÎQd]V( 0WbbS S`[WbbSZ\ AWS O\VO\R RS` BOPSZZS W[ /\VO\U 1 eWS ROa HSWQVS\ , 5`rzS` OZa W[ /A1771]RS RO`USabSZZb eW`R 5SPS\ AWS Tº` RWSaSa HSWQVS\ RS\ VSfORShW[O ZS\ ES`b RS\ 2ShW[OZeS`b c\R RS\ PW\É`S\ ES`b O\ ÍPS`^`ºTS\ AWS 7V`S ÍPS`ZS Uc\US\ ^S` >`]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^]T]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Tb XSR]QV VOb RWSaS [Wb SW\S` 0SRScbc\U PSZSUb ?a^VaP\\ 0bRXX&) 0aQTXcT] \Xc ST\ 4da^ITXRWT] public class Ascii07 { public static void main(String args[]) { char zeichen = '€'; // Euro-Zeichen !"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"$
ATX] QX]ÊaT 2^SXTad]V e^] IPW[T]
System.out.println(zeichen); } } ÎQd]VT] id\ ?a^VaP\\ 0bRXX& ]da U¶a `]U`O[[ 2Oa 3c`]hSWQVS\ a]ZZbS OcT RS` BOabObc` PSW[ 0cQVabOPS\ 3- d]`VO\RS\ aSW\ :Ocb 1> # 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 PWbbS PSOQVbS\ AWS ROaa aWS RO[Wb US\Oc a] Q]RWS`b eW`R eWS RS` 5`]zPcQVabOPS / ÎQd]V
1]RWS`S\ AWS RWS HOVZ `SW\ PW\É` c\R dS`UZSWQVS\ AWS ROa 3`USP\Wa [Wb RS` d]`VS`W US\ ÍPc\U PSW RS` RWS SW\hSZ\S HWTTS` ROa HSWQVS\ dS`aQVZºaaSZb ec`RS 2WS 7\bS`^`SbObW]\ SW\S` 0WbY][PW\ObW]\ VÉ\Ub OZa] ROd]\ OP ]P SW\S HOVZ ]RS` SW\ HSWQVS\ RWPa O\ RWSaS` AbSZZS S`eO`bSb eW`R /\RS`a USaOUb( 3a UWPb \WQVb \c` dS` aQVWSRS\S 2O`abSZZc\US\ SW\Sa ES`bSa OPVÉ\UWU d][ dS`eS\RSbS\ 1]RS a]\RS`\ RWS 0WbT]ZUS\ Yr\\S\ OcQV RORc`QV SW\S c\bS`aQVWSRZWQVS 0SRScbc\U PSY][[S\ ROaa aWS c\OPVÉ\UWU d]\ SW\S[ 1]RS OZa `SW\ PW\É`S HOVZ W\bS`^`SbWS`b eS`RS\
;TOIUJK
'XHKOZKTSOZJKS;TOIUJK9ZGTJGXJ 2S` C\WQ]RSAbO\RO`R ec`RS c`a^`º\UZWQV S\be]`TS\ OZa SW\S TSabS $PWb DS`aQVZºaaSZc\U ^`] HSWQVS\ A^ÉbS` YO[S\ 3`UÉ\hc\US\ OcT [SV` OZa 0gbSa ^`] HSWQVS\ VW\hc RWS OYbcSZZS DS`aW]\ C\WQ]RS " S`eSWbS`b RS\ 0S`SWQV OcT PWb /c zS`RS[ UWPb Sa VWab]`WaQVS DO`WO\bS\ RWS heO` c\bS`SW\O\RS` Y][^ObWPSZ aW\R OPS` hB O\RS`S 0ShSWQV\c\US\ VOPS\( 2]cPZS0gbS1VO`OQbS`ASb C\WdS`aOZ 1VO`OQbS` ASb C1A AbO\RO`R 7A= $"$ /caTºV`ZWQVS 7\T]`[ObW]\S\ hc[ BVS[O C\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 !
!$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"%
D]XR^ST
bWaQVS\ c\R bSQV\WaQVS\ A]\RS`hSWQVS\ abO\RO`RWaWS`S\ 4º` 7\bS`\Sb/\eS\Rc\US\ Wab RS` C\WQ]RS c\dS`hWQVbPO` 2WS BOPSZZS W[ /\VO\U 1 hSWUb RWS C\WQ]RSHSWQVS\ d]\ f f44 RWS S`abS\ & HSWQVS\ d]\ %4 aW\R WRS\bWaQV [Wb RS[ /A1771]RS /cTUSTºV`b eS` RS\ RWS TSabUSZSUbS\ HSWQVS\ c\R WV`S RShW[OZS c\R VSfORShW[OZS @S^`ÉaS\bObW]\ VWS` Q]RS^]W\b US\O\\b a]eWS RWS ]TTWhWSZZS\
BVS]`SbWaQV Wab Rc`QV RWS 3W\TºV`c\U RSa eSZbeSWb UºZbWUS\ C\WQ]RSa XSRSa 9][^ObW PWZWbÉba^`]PZS[ PSW[ 2ObS\OcabOcaQV USZrab >`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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ST] 2WS S`abS\ #$ HSWQVS\ RSa C\WQ]RSa aW\R W\ RS` @SUSZ OcT RS` 3W\UOPSbOabObc` dS` TºUPO` 4º` eSWbS`S A]\RS`hSWQVS\ TSVZb VÉcTWU SW\S PS_cS[S 3W\UOPS[rUZWQVYSWb 3W\S ;rUZWQVYSWb b`]bhRS[ C\WQ]RShSWQVS\ hc dS`eS\RS\ PSabSVb RO`W\ RWSaS RW `SYb W[ >`]U`O[[ hc S`hScUS\ 2Ohc acQVb [O\ hc\ÉQVab W\ RS` C\WQ]RSBOPSZZS ROa S\ba^`SQVS\RS Ag[P]Z c\R RS\ ROhcUSVr`WUS\ VSfORShW[OZS\ ES`b 2WS 3W\UO PS S`T]ZUb RO\\ W\ 4]`[ d]\ a] US\O\\bS\ C\WQ]RS 3aQO^Sa 2WSaS VOPS\ RWS
!%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" 8]U^a\PcX^]T] \PbRWX]T[[ SPabcT[[T]
4]`[ Kdffff e]PSW ffff RS` VSfORShW[OZS ES`b Wab RS\ ROa HSWQVS\ W[ C\WQ]RS VOb RS` 1]RS^]W\b 2S` >`ÉTWf Jc abSVb Tº` C\WQ]RS 7[ \OQVT]ZUS\RS\ >`]U`O[[ a]ZZ SW\ C\WQ]RSHSWQVS\ PSO`PSWbSb eS`RS\ ROa OcQV [Wb SW\S[ \]`[OZS\ 4]\b O\UShSWUb eS`RS\ YO\\( ROa >`]hS\bhSWQVS\ /\US \][[S\ c\aS`S BOabObc` S\bVÉZb RWSaSa HSWQVS\ \WQVb RO\\ Yr\\bS Sa W[ >`]U`O[[ S`hScUb eS`RS\ 2Oa HSWQVS\ VOb W[ C\WQ]RS RS\ 1]RS^]W\b # ?a^VaP\\ D]XR^ST ) D]XR^STITXRWT] X\ ?a^VaP\\ TaiTdVT] public class Unicode01 { public static void main(String args[]) char c = '\u0025'; System.out.println(c); } }
{
2Oa HSWQVS\ Wab SW\ /A177HSWQVS\ Sa ZWSUb W[ 0S`SW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S ROUSUS\ RS\ 1]RS^]W\b /1 EW` eS`RS\ \c\ YZÉ`S\ eOa ^OaaWS`b eS\\ [Wb RWSaS[ HSWQVS\ USO`PSWbSb eW`R ?a^VaP\\ D]XR^ST!) ITXRWT] PdvTaWP[Q STb 0B2882^ST
public class Unicode02 { public static void main(String args[]) char c = '\u20AC'; System.out.println(c); } }
{
0SW RS` /caTºV`c\U RWSaSa >`]U`O[[a h0 W\ SW\S` 2=A0]f c\bS` ;AEW\R]ea eW`R ROa 3c`]hSWQVS\ \WQVb O\UShSWUb 2Oa ZWSUb RO`O\ ROaa ;WQ`]a]Tb R]`b [Wb SW\S[ O\RS`S\ 1VO`OQbS`aSb O`PSWbSb [Wb 1> /PS` eS\\ AWS RWS /caUOPS RSa >`] U`O[[a D]XR^ST! c[ZSWbS\ W\ SW\S 2ObSW [Wb RS[ 1][[O\R) YPeP D]XR^ST! - !'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" 8]U^a\PcX^]T] \PbRWX]T[[ SPabcT[[T]
Pcgc c\R RWSaS 2ObSW RO\\ [Wb SW\S[ VSfORShW[OZS\ 3RWb]` O\hSWUS\ PSY][[S\ AWS T]ZUS\RS\ 2ObSWW\VOZb O\UShSWUb(
/PP !"( 7\VOZb RS` /caUOPSRObS\ c[USZSWbSb W\ SW\S 2ObSW 2WS 2ObSW S\bVÉZb OZa] ' 2 / 2Oa aW\R RWS R`SW VSfORShW[OZS\ >ZObh\c[[S`\ Tº` ROa 3c`]hSWQVS\ Tº` 1@ c\R Tº` :4 W[ S`eSWbS`bS\ /A1771]RS 2O[Wb Wab PSeWSaS\ ROaa SW\S Ocb][ObWaQVS C[aSbhc\U S\Q]RW\U abObbUSTc\RS\ VOb( W\\S`VOZP RS` 8D; UWZb RWS C\WQ]RSDS`aQVZºaaSZc\U CB4$ PSW[ AQV`SWPS\ ec`RS ROa HSWQVS\ Jc /1 c[USaSbhb W\ RS\ /A177ES`b & S\ba^`SQVS\R RS\ 7A=&' 1]RWS``SUSZ\ ÎQd]VT] ?a^VaP\\ D]XR^ST! ÎQd]V ( AbO`bS\ AWS ROa >`]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 /`][WZZSHSWQVS\ RO`USabSZZb BSabS\ AWS eWS RWSaSa HSWQVS\ d]\ RS\ c\bS` aQVWSRZWQVS\ >`]U`O[[S\ RO`USabSZZb eW`R O^WS` RO`USabSZZb eS`RS\ 2Ohc eS`RS\ RWS 4]\ba [Wb WV`S\ c\bS`aQVWSRZWQVS\ AQV`WTbO`bS\ SW\USaSbhb C\R hc[ `]U`O[[ D]XR^ST" eS`RS\ 7\T]`[ObW]\S\ RSa 2ObS\bg^a QhcT OZa CB4&1]RS7\T]`[ObW]\S\ W\bS`^`SbWS`b c\R W\ SW\S\ Ab`W\U c[USeO\RSZb c\R RO\OQV eWSRS` hc`ºQY 2OPSW eSQVaSZb ROa 3\Q]RW\U d]\ CB4& \OQV CB4$ `]U`O[[ \]QV \WQVb Y][^ZSbb dS`abO\RS\ eS`RS\ Sa RWS\b OcaaQVZWSzZWQV RS` 2]Yc[S\bObW]\ c\R YO\\ a^ÉbS` O[ 3\RS RSa 0cQVSa PSW 0SRO`T OZa ;cabS` dS`eS\RSb eS`RS\ "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"%
D]XR^ST
?a^VaP\\ D]XR^ST")
public class Unicode03 { public static void main (String args[]) throws Exception { // ASCII als nach Unicode konvertieren byte[] ascii = {'a', 'b', 'c'}; String str = new String(ascii, "ISO-8859-1"); System.out.println(str); // Unicode (UTF-16) nach UTF-8 konvertieren byte[] utf8 = str.getBytes("UTF8"); for (int i=0; i
9OTJGRRK1USVGZOHOROZoZYVXUHRKSKJ[XIN;TOIUJKMKRYZ% ES\\ OZZS 1][^cbS`agabS[S c\R >`]U`O[[S [Wb RS[ C\WQ]RS O`PSWbS\ eº`RS\ c\R OcQV OZZS d]`VO\RS\S\ 2ObS\PSabÉ\RS W[ C\WQ]RS USa^SWQVS`b eÉ`S\( XO A]ZO\US Sa XSR]QV \]QV /A1777\T]`[ObW]\S\ UWPb( \SW\ 4º` RWS 7\bS`^`SbObW]\ d]\ /A177 7\T]`[ObW]\S\ Wab Sa S`T]`RS`ZWQV RS\ PSW RS` 9]RWS`c\U PS\cbhbS\ AbO\RO`R hc YS\ \S\ h0 7A= &' 2SaeSUS\ S`ZOcPS\ BSQV\]Z]UWS\ RWS RS\ C\WQ]RS PS\cbhS\ eWS F;: ]RS` 8OdO RWS /\UOPS SW\S` 1]RS^OUS 2WSaSa 3\Q]RW\U a^WSZb SW\S S\b aQVSWRS\RS @]ZZS PSW W\bS`\ObW]\OZS\ /\eS\Rc\US\ c\R PSW[ 2ObS\OcabOcaQV 7\ 8OdO UWPb Sa SW\S UO\hS @SWVS d]\ 9ZOaaS\ RWS aWQV [Wb RS` :]YOZWaWS`c\U OZa] OcQV [Wb RS` /caeOVZ RS` 3\Q]RW\UBOPSZZS PSTOaaS\ /PS` RWS /`b RS` 1]RWS`c\U /A177 301271 C\WQ]RS c\R RWS 2O`abSZZc\U RS` HSW QVS\aÉbhS Rc`QV dS`aQVWSRS\S 4]\ba aW\R \WQVb RWS SW\hWUS\ 6W\RS`\WaaS PSW[ 2O bS\OcabOcaQV heWaQVS\ RS\ 1][^cbS`\ 5^[VT]ST 5aPVT] bX]S idbÊci[XRW id Z[ÊaT] SP\Xc TX]T UTW[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YSWbS\ 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\ 2ObS\bg^ 7[ \OQVT]ZUS\RS\ >`]U`O[[ eW`R SW\S Ab`W\UdO`W OPZS SW\ =PXSYb O\USZSUb c\R dS`O`PSWbSb 2Ohc [caa W\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QVS\ =^S`ObW]\S\ Tº` SW\S DO`WOPZS TSabUSZSUb 2Oa ;W\cahSWQVS\ Wab Tº` BcaX]VDO`WOPZS \WQVb S`ZOcPb Q 3Ta 3PcT]ch_ [TVc SXT 1TSTdcd]V e^] >_TaPcX^]T] UTbc
ÎQd]V ! id\ ?a^VaP\\ 3TZ[PaPcX^] 0WbbS ºPS`^`ºTS\ AWS eWS RS` 1][^WZS` `SOUWS`b eS\\ AWS dS`acQVS\ RS\ T]ZUS\RS\ 0STSVZ SW\hcTºUS\( text = text + 5; "#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# :[PbbT] d]S P]STaT Ch_T] QTbRWaTXQT] STR[PaPcX^]
2WS C[eO\RZc\U eW`R TSVZS`T`SW Rc`QVUSTºV`b ES\\ AWS ROa >`]U`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 D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cT ]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[
char buchstabe;
2ORc`QV eW`R RS` 0ShSWQV\S` QdRWbcPQT dS`SW\PO`b d]S SW\ ^OaaS\RS` A^SWQVS`PS `SWQV W\ RWSaS[ 4OZZ 0gbSa PS`SWbUSabSZZb 3W\S @STS`S\hdO`WOPZS YO\\ eWS T]ZUb RSTW\WS`b eS`RS\(
String text;
2ORc`QV eW`R RS` 0ShSWQV\S` cTgc RS[ 1][^WZS` PSYO\\b US[OQVb c\R SW\ ^OaaS\ RS` A^SWQVS`PS`SWQV hc` DS`TºUc\U USabSZZb /PS` Sa UWPb SW\S\ U`OdWS`S\RS\ C\bS` aQVWSR hc ^`W[WbWdS\ =PXSYbS\( RS` ^OaaS\RS A^SWQVS`^ZObh Wab \WQVb RS` 0S`SWQV Tº` ROa SWUS\bZWQVS =PXSYb a]\RS`\ ZSRWUZWQV RS` A^SWQVS`^ZObh Tº` RWS @STS`S\h OcT ROa =PXSYb 2Oa SWUS\bZWQVS =PXSYb eW`R Rc`QV RWSaS 2STW\WbW]\ \]QV \WQVb O\USZSUb 2O hc Wab SW\ PSa]\RS`Sa AQVZºaaSZe]`b S`T]`RS`ZWQV( ]Tf
String text = new String("ABC");
;Wb ]Tf eW`R •
A^SWQVS`^ZObh Tº` SW\ \ScSa =PXSYb W[ /`PSWbaa^SWQVS` O\USZSUb
•
RWS /\TO\UaOR`SaaS RWSaSa >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 RWS @STS`S\hdO`WOPZS cTgc OPS` ]^RW ZTX]T] 8]WP[c ES`b 7[ heSWbS\ AQV`Wbb eW`R [Wb RS[ AQVZºaaSZe]`b ]Tf ROa Ab`W\U]PXSYb aSZPab S`hScUb /czS`RS[ PSY][[b ROa =PXSYb SW\S\ /\TO\UaeS`b \É[ZWQV 6OZZ] hcUSeWSaS\ C\R UO\h eWQVbWU RWS A^SWQVS`OR`SaaS RSa =PXSYba eW`R W\ RWS @STS`S\hdO`WOPZS cTgc ºPS`b`OUS\ 2WS T]ZUS\RS U`OTWaQVS 2O`abSZZc\U a]ZZ RWSa dS`RScbZWQVS\(
6OZZ]
bSfb @STS`S\hdO`WOPZS
=PXSYb
/PP "( =PXSYb W[ /`PSWbaa^SWQVS` >QYTZcT fTaST] SdaRW ATUTaT]iePaXPQ[T \P]X_d[XTac 7[ R`WbbS\ AQV`Wbb eW`R [Wb RS[ =PXSYb USO`PSWbSb 2S` ES`b eW`R O[ 0WZRaQVW`[ Oca USUSPS\ 2OPSW eW`R RS` `]U`O[[ a] ROaa SW\S eSWbS`S @STS`S\hdO`WOPZS [Wb RS[ 7RS\ bWTWS` ]P\T O\USZSUb eW`R 2Oa =PXSYb a]ZZ d][ Bg^ BcaX]V aSW\ 2S` /\TO\UaeS`b a]ZZ Oca 7V`S[
7\ RS` ]PXSYb]`WS\bWS`bS\ >`]U`O[[WS`c\U eS`RS\ hc\ÉQVab =PXSYbS W[ /`PSWbaa^SW QVS` S`hScUb PSd]` aWS Rc`QV ;SbV]RS\OcT`cTS
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# :[PbbT] d]S P]STaT Ch_T] QTbRWaTXQT] STR[PaPcX^]
0OaWa Tº` RWS =PXSYbS`hScUc\U Wab SW\S 9ZOaaS 3W\S 9ZOaaS YO\\ eWS SW\ \ScS` aSZPab RSTW\WS`bS` 2ObS\bg^ USaSVS\ eS`RS\ 2]`b Wab Tº` SW\S 5`c^^S d]\ =PXSYbS\ PS aQV`WSPS\ Oca eSZQVS\ 2ObS\ aWQV RWS =PXSYbS hcaO[[S\aSbhS\ c\R eSZQVS =^S`O bW]\S\ ;SbV]RS\ RO[Wb OcaUSTºV`b eS`RS\ Yr\\S\ 2WS =PXSYbS`hScUc\U S`T]ZUb hc` :OcThSWb RSa >`]U`O[[a ROhc aW\R heSW AQV`WbbS S`T]`RS`ZWQV( •
3TZ[PaPcX^] STa ATUTaT]iePaXPQ[T] 6WS`hc USVr`b ROaa RS` >`]U`O[[WS`S` TSabZSUb eSZQVS\ 2ObS\bg^ ROa =PXSYb VOPS\ a]ZZ c\R c\bS` eSZQVS[
•
0][TVT] STb B_TXRWTa_[PciTb W[ /`PS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S\bZWQVS\ =PXSYbTSZRS` BSQV\WaQV OcaUSR`ºQYb( 7\ SW \S[ ;OaQVW\S\PSTSVZ UWPb Sa YSW\S ag[P]ZWaQVS\ `]U`O[[ hSWUb eWS SW\S DO`WOP ZS d][ SW\TOQVS\ Bg^ RSYZO`WS`b c\R RO\OQV ^S` ES`bShceSWac\U [Wb SW\S[ ES`b USTºZZb eW`R ?a^VaP\\ 3TZ[PaPcX^]") 4X]UPRWT 3PcT]ch_T] STZ[PaXTaT] d]S eTaPaQTXcT] public class Deklaration03 { public static void main(String[] args) { int zahl1; zahl1 = 100; System.out.println(zahl1); } } ;Wb RS` /\eSWac\U int zahl1; eW`R RWS DO`WOPZS iPW[ RSYZO`WS`b 2S` 1][^WZS` `SaS`dWS`b RS\ PS\rbWUbS\ A^SWQVS`^ZObh OPVÉ\UWU d][ 2ObS\bg^ 7\ RWSaS[ 0SWa^WSZ Wab OZa Bg^ X]c O\USUSPS\ RWS /PYº`hc\U Tº` 7\bSUS` S\UZ 5O\hhOVZ 2WS A^`OQV a^ShWTWYObW]\ d]\ 8OdO ZSUb TSab ROaa Tº` RS\ 2ObS\bg^ X]c W[[S` " 0gbSa W[ A^SWQVS` O\USZSUb eS`RS\ C\R RWS W\bS`\S @S^`ÉaS\bObW]\ RS` ES`bS RWSaSa =PXSYba Wab RO[Wb OcQV TSabUSZSUb \É[ZWQV `SW\ PW\É` A][Wb eW`R RWS 2ShW[OZhOVZ W[ /`PSWbaa^SW QVS` eWS T]ZUb RO`USabSZZb ]V\S 0S`ºQYaWQVbWUc\U RSa D]`hSWQVS\a(
2WS ]PWUS 0WbY][PW\ObW]\ Yr\\bS d][ AgabS[ OcQV OZa RS` YZSW\S 0cQVabOPS R W\ bS`^`SbWS`b eS`RS\ 2S\\ RWSaS` 0cQVabOPS VOb RWS >ZObh\c[[S` W[ C\WQ]RS 2O[Wb RS` A^SWQVS`W\VOZb OZa HSWQVS\ c\R \WQVb OZa HOVZ W\bS`^`SbWS`b eW`R [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\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 bc\U /caUOPS Hc\ÉQVab eS`RS\ RWS PS\rbWUbS\ @Saa]c`QS\ PSYO\\b US[OQVb RS YZO`WS`b RO\\ eS`RS\ 2ObS\ TX]VT[TbT] W[ /`PSWbaa^SWQVS` eTaPaQTXcTc c\R RWS 3`USP\WaaS PdbVTVTQT] 2O[Wb ROa 0SWa^WSZ^`]U`O[[ \WQVb hc c[TO\U`SWQV eW`R S\bVÉZb Sa YSW\S`ZSW >`ºTc\US\ OcQV YSW\S 4]`[OZ^`ºTc\US\ RWS aWQVS`abSZZS\ ROaa RS` 0SRWS\S` OcQV eW`YZWQV \c` 2ObS\ RSa UST]`RS`bS\ Bg^a SW\USPS\ Y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\T /\eSWac\US\(
2STW\WbW]\ RSa 3W\UOPSUS`Éba( Scanner eingabe = new Scanner(System.in);
2STW\WbW]\ RSa A^SWQVS`^ZObhSa Tº` SW\S DO`WOPZS( int zahl;
3W\ZSaS\ SW\Sa ES`bSa d][ RSTW\WS`bS\ 3W\UOPSUS`Éb( zahl = eingabe.nextInt();
DS`É\RS`c\U RSa DO`WOPZS\W\VOZba Rc`QV /RRWbW]\( zahl = zahl + 50;
/caUOPS RSa 3`USP\WaeS`bSa( System.out.println("Ergebnis ist: " + zahl);
ÎQd]VT] id\ ?a^VaP\\ Ch_T] ÎQd]V ( AbO`bS\ AWS ROa >`]U`O[[ 2WS /caTº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] T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bWUabS 5O\hhOVZS\bg^ Wab X]c ROa Wab RWS /PYº`hc\U Tº` 7\bSUS` S\UZ UO\hS HOVZ 2O[Wb eW`R TSabUSZSUb ROaa RWSaS` A^SWQVS`^ZObh ]da Tº` RWS A^SWQVS`c\U d]\ UO\hS\ HOVZS\ US\cbhb eS`RS\ YO\\ ROaa ROTº` W[[S` " 0gbSa W[ /`PSWbaa^SWQVS` hc` DS`TºUc\U abSVS\ c\OPVÉ\UWU d]\ RS` >ZObbT]`[ c\R d]\ RS` ;OaQVW\S\O`QVW bSYbc` c\R ROaa RWS ! PWba `SW\ PW\É` [Wb RS` AbSZZS\eS`bWUYSWb d]\ S` >]bS\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
W\ SW\S 4SabY][[OhOVZ ;O\bWaaS RWSaS YO\\ aWQV Oca SW\S` D]` c\R
•
W\ RWS /\UOPS SW\S` HSV\S`^]bS\h [Wb RS` RWSaS HOVZ [cZbW^ZWhWS`b eW`R 2WSaS` 3f^]\S\b hc` 0OaWa PShSWQV\Sb RWS /\hOVZ AbSZZS\ c[ RWS ROa 9][[O \OQV `SQVba ]RS` ZW\Ya dS`aQV]PS\ eW`R OZa] UZSWbSb
/ZZUS[SW\S 4]`[SZ(
g
hOVZ + f f + ;O\bWaaS g + 3f^]\S\b hc` 0OaWa
+ RWS HOVZ aSZPab + /\hOVZ 5ZSWbabSZZS\
0SWa^WSZS(
! #
+ ;O\bWaaS # 3f^]\S\b + ! # ;O\bWaaS ! 3f^]\S\b + ;O\bWaaS " 3f^]\S\b
2S` 3f^]\S\b UWPb OZa] O\ c[ eWSdWSZ AbSZZS\ ROa 9][[O dS`aQV]PS\ eS`RS\ a]ZZ 7ab S` ^]aWbWd UZSWbSb ROa 9][[O \OQV `SQVba) Wab S` \SUObWd UZSWbSb ROa 9][[O \OQV ZW\Ya 7\ 1][^cbS`^`]U`O[[S\ c\R OcQV W\ 8OdO PS\cbhb [O\ VÉcTWU RWS a] US\O\\bS \]`[OZWaWS`bS ]RS` eWaaS\aQVOTbZWQVS AQV`SWPeSWaS PSW RS` d]` RS\ 3f^]\S\b RS` 0cQVabOPS 3 ]RS` S USaQV`WSPS\ eW`R(
S% + 3% +
2WSaS PSWRS\ 0SWa^WSZS hSWUS\ SW\S\ RS` D]`bSWZS RS` 5ZSWbY][[O2O`abSZZc\U( RWS AQV`SWPeSWaS YO\\ PSW U`]zS\ ]RS` aSV` YZSW\S\ HOVZS\ aSV` Y][^OYb aSW\ 2S` ES`bSPS`SWQV Wab S\ba^`SQVS\R V]QV( Tº` S^dQ[TBg^S\ Wab RWS U`rzbS HOVZ &3!& 2WS /cTbSWZc\U W\ ;O\bWaaS c\R 3f^]\S\b Wab eOVZT`SW c\R YO\\ c\bS`aQVWSRZWQV US eÉVZb eS`RS\ A] YO\\ RWS 2ShW[OZhOVZ !%#' h0 eWS T]ZUb RO`USabSZZb eS`RS\( !%#' OZa ;O\bWaaS c\R OZa 3f^]\S\b OZa]( !%#' OZa ;O\bWaaS c\R ! OZa 3f^]\S\b OZa]( !%#' OZa ;O\bWaaS c\R OZa 3f^]\S\b OZa](
!%#'3 !%#'3! !%#'S
]RS` ]RS`
#$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
##
B_TiXP[UP[[) ?aX\XcXeT 3PcT]ch_T]
8OdO YS\\b heSW c\bS`aQVWSRZWQVS 5ZSWbY][[OBg^S\ U[^Pc c\R S^dQ[T AWS c\bS` aQVSWRS\ aWQV W\ RS` /\hOVZ A^SWQVS`abSZZS\ RWS hc` DS`TºUc\U abSVS\( •
U[^Pc abSZZb ! PWba hc` DS`TºUc\U ROd]\ %& aWU\WTWYO\bS 2ShW[OZabSZZS\ c\R
•
S^dQ[T VOb R]^^SZb a] dWSZS \É[ZWQV $" PWba ROd]\ " aWU\WTWYO\bS 2ShW[OZabSZ ZS\
2Oa T]ZUS\RS >`]U`O[[ a^SWQVS`b RS\ 3W\UOPSeS`b W\ SW\S` DO`WOPZS\ d][ 2ObS\bg^ S^dQ[T 2O[Wb Wab Sa Tº` RWSaS DO`WOPZS W\ RS` :OUS USP`]QVS\S HOVZS\ [Wb 9][[O abSZZS\ hc ZSaS\ c\R hc dS`O`PSWbS\ ?a^VaP\\ 3^dQ[T ) 0aQTXcT] \Xc ST\ 3PcT]ch_ S^dQ[T import java.util.Scanner; public class Double01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); double zahl; // Deklaration zahl = eingabe.nextDouble(); // Einlesen System.out.println("Eingegeben wurde: " + zahl); } } ÎQd]VT] id\ ?a^VaP\\ 3^dQ[T
ÎQd]V ) 4º` RWS 3W\UOPS d]\ 5ZSWbY][[OhOVZS\ UWPb Sa [SV`S`S ;rUZWQVYSWbS\( S\beSRS` eW`R RWS AbO\RO`RRO`abSZZc\U USeÉVZb h0 #!" ]RS` Sa eW`R RWS eWaaS\ aQVOTbZWQVS <]bObW]\ dS`eS\RSb h0 %3# 0WbbS bSabS\ AWS PSWRS DO`WO\bS\ /QVbc\U( 2Oa >`]U`O[[ Wab O\US^Oaab O\ RWS RScbaQVS AQV`SWPeSWaS RV Sa eW`R SW\ 9][[O S`eO`bSb c\R YSW\ 2ShW[OZ^c\Yb ÎQd]V !) Ò\RS`\ AWS W[ ?cSZZbSfb RS\ 2ObS\bg^ RS` DO`WOPZS\ iPW[ W\ U[^Pc :r ac\UaVW\eSWa( 2S\YS\ AWS RO`O\ ROaa aWQV OcQV RS` ;SbV]RS\\O[S É\RS`b d]\ ]Tgc3^dQ[T OcT ]Tgc5[^Pc BSabS\ AWS ROa >`]U`O[[ [Wb RS\ T]ZUS\RS\ dWS` 5ZSWb Y][[OhOVZS\( #3 ! S !3& 2WS 5ZSWbY][[O2O`abSZZc\U VOb \SPS\ RS[ D]`bSWZ RS` Y][^OYbS\ 2O`abSZZc\U Rc`QV 0SaSWbWUc\U d]\ ºPS`TZºaaWUS\ `]hSaa]`S\ aQV\SZZS` RO[Wb O`PSWbS\ Yr\\S\ OZa [Wb PW\É`S\ 5O\hhOVZS\ ]RS` [Wb PW\É` Q]RWS`bS\ 2ShW[OZhOVZS\ RWSaS a] US\O\\bS\ 012HOVZS\ eS`RS\ eW` a^ÉbS` US\OcS` PSVO\RSZ\ /PS` /QVbc\U( 2c`QV RS\ ESQVaSZ RSa AbSZZS\eS`bagabS[a d][ HSV\S``SQV\S\ hc` HeSWS`RO`abSZZc\U Yr\\S\ aWQV C\US\OcWUYSWbS\ S`USPS\ 2S` 5`c\R Wab RWS PS U`S\hbS AbSZZS\O\hOVZ RWS Tº` 0`cQVhOVZS\ hc` DS`TºUc\U abSVb HeO` Wab ROa 0W\É` agabS[ \WQVb [SV` ]RS` eS\WUS` US\Oc OZa ROa 2ShW[OZagabS[ OPS` Sa S\ba^`WQVb SPS\ \WQVb c\aS`S` 2S\YeSWaS 7[ 9O^WbSZ % UWPb Sa ROhc eSWbS`S 6W\eSWaS #%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# :[PbbT] d]S P]STaT Ch_T] QTbRWaTXQT] STR[PaPcX^]
*KX*GZKTZ_VHUURKGT 3W\S /caaOUS YO\\ eOV` ]RS` TOZaQV aSW\ C[ SW\S\ RWSaS` PSWRS\ EOV`VSWbaeS`bS a^SWQVS`\ hc Yr\\S\ Wab W\ 8OdO RS` 2ObS\bg^ Q^^[TP] SW\USPOcb 2WSaS` Bg^ YS\\b OZa] \c` RWSaS PSWRS\ ES`bS RWSa Wab aSW\ ES`bSPS`SWQV 2WS PSWRS\ [rUZWQVS\ EOV`VSWbaeS`bS eS`RS\ UP[bT c\R cadT US\O\\b ?a^VaP\\ 1^^[TP] ) 0aQTXcT] \Xc ST\ 3PcT]ch_ Q^^[TP] public class Boolean01 { public static void main (String args[]) { boolean aussage = false; System.out.println("Aussage ist: " + aussage); System.out.println("d.h. sie ist nicht: " + !aussage); } } 2Oa >`]U`O[[ 1^^[TP] YPeP S`hScUb SW\S 0]]ZSaQVS DO`WOPZS c\R W\WbWOZWaWS`b aWS [Wb RS[ /\TO\UaeS`b UP[bT 2WSaS` eW`R W[ S`abS\ /caUOPSPSTSVZ c\dS`É\RS`b OcaUS USPS\ W[ heSWbS\ _aX]c[]/cT`cT XSR]QV eW`R RS` EOV`VSWbaeS`b Rc`QV DS`eS\Rc\U RSa /ca`cTShSWQVS\ c[USYSV`b Oca UP[bT eW`R cadT ?a^VaP\\ 1^^[TP]!) 4X][TbT] TX]Tb FPWaWTXcbfTacTb
import java.io.*; import java.util.Scanner; public class Boolean02 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); boolean wahr; wahr = eingabe.nextBoolean(); // Eingabe System.out.println("Ergebnis ist: " + wahr); // Ausgabe } } ÎQd]V id\ ?a^VaP\\ 1^^[TP]! BSabS\ RWS ROa >`]U`O[[ W\RS[ AWS XSeSWZa SW\[OZ T]ZUS\RS ES`bS SW\USPS\( b`cS TOZaS c\R B@C3 c\R 4O:aS ;O\ aOUb cadT c\R UP[bT aW\R SW\USPOcbS :WbS`OZS c\R aWS [ºaaS\ SfOYb a] USaQV`WS PS\ eS`RS\ /PS`( RWS 5`]z ]RS` 9ZSW\aQV`SWPc\U a^WSZb Pdb]PW\bfTXbT YSW\S @]ZZS RS\\ RWS ;SbV]RS ]Tgc1^^[TP] Wab a] USaQV`WSPS\ ROaa aWS RS\ SW\USUSPS \S\ Ab`W\U Ocb][ObWaQV W\ 9ZSW\PcQVabOPS\ c[eO\RSZb 3W\USaSbhb eW`R RS` Q^^[TP]2ObS\bg^ Tº` RWS A^SWQVS`c\U d]\ HcabÉ\RS\ h0 \OQV DS`UZSWQVS\ 0]]ZSaQVS DO`WOPZS\ Yr\\S\ a] OZa AQVOZbS` RWS\S\ Tº` ROa 4SabVOZbS\ d]\ DS`UZSWQVaS`USP\WaaS\ d]\ RS\S\ RO\\ eSWbS`S /PZÉcTS OPVÉ\UWU US[OQVb eS` RS\ 2WS AbScS`PSTSVZS aWSVS 9O^WbSZ & O`PSWbS\ OZZS [Wb P]]ZSaQVS\ ES`bS\ #&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
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\ RWS 8OdO3\beWQYZS` S\baQVWSRS\ ROaa SW\S[ >`]U`O[[ hc \ÉQVab \c` RS` \c[S`WaQVS ES`b RSa HSWQVS\a ºPS`USPS\ eW`R eS\\ Sa d]\ RS` BOabObc` ZWSab 9]\Y`Sb eW`R RS[ >`]U`O[[ RS` 1]RS^]W\b Oca RS` C\WQ]RSBOPSZZS USZWSTS`b 2WSaS` ES`b [caa hc\ÉQVab W\ SW\S` X]cDO`WOPZS\ S[^TO\US\ eS`RS\ c\R YO\\ RO\\ XS \OQV 0SRO`T W\bS`^`SbWS`b eS`RS\ 2WSaS D]`USVS\aeSWaS UWZb OcQV Tº` VS`Yr[[ZWQVS /A177HSWQVS\ RWS W[ C\WQ]RS OZa C\bS`[S\US S\bVOZbS\ aW\R ?a^VaP\\ 2WPaPRcTa ) 0aQTXcT] \Xc ST\ 3PcT]ch_ RWPa public class Character01 { public static void main(String[] args) throws Exception { int z; z = System.in.read(); // Liefert den Codepoint char c = (char)z; // Interpretation als (Unicode-)Zeichen System.out.println("Ergebnis ist: " + c); } }
ÎQd]V id\ ?a^VaP\\ 2WPaPRcTa BSabS\ AWS ROa >`]U`O[[ W\RS[ AWS SW\ PSZWSPWUSa HSWQVS\ RSa /A1771]RSa h0 RS\ 0cQVabOPS\ / ]RS` O ^S` BOabObc` SW\USPS\ ÍPS`^`ºTS\ AWS eWS ROa >`]U`O[[ `SOUWS`b eS\\ AWS SW\ HSWQVS\ RSa S`eSWbS`bS\ /A1771]RS h0 SW\S\ RScbaQVS\ C[ZOcb SW\USPS\ =TTS\aWQVbZWQV Wab RWSa \WQVb a] ]V\S eSWbS`Sa [rUZWQV AWS eS`RS\ W[ 9O^WbSZ $ :rac\US\ Tº` RWSaSa >`]PZS[ YS\\S\ ZS`\S\ 2S` 9]^T RS` ;SbV]RS S\bVÉZb RWS 9ZOcaSZ cWa^fb 4gRT_cX^] 2O[Wb eW`R R]Yc [S\bWS`b ROaa W\\S`VOZP RS` ;SbV]RS SW\ :OcThSWbTSVZS` 3fQS^bW]\ OcTb`SbS\ YO\\ RS` \WQVb OPUSTO\US\ c\R a^ShWSZZ PSVO\RSZb eW`R a]\RS`\ c\PSVO\RSZb Rc`QVUS #'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# :[PbbT] d]S P]STaT Ch_T] QTbRWaTXQT] STR[PaPcX^]
`SWQVb eW`R O\ RS\ /cT`cTS` RWSaS` ;SbV]RS 2O Sa aWQV W\ RWSaS[ 4OZZ c[ RWS \PX] ;SbV]RS VO\RSZb eW`R SW\ SdS\bcSZZ OcTb`SbS\RS` :OcThSWbTSVZS` d]\ RS` 8D; PSO` PSWbSb \]`[OZS`eSWaS PSRScbSb RWSa >`]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\ <]beS\RWU YO\\ RS` 3W\aObh d]\ E`O^^S`9ZOaaS\ aSW\ eS\\ =PXSYbdO`WOPZS PS\r bWUb eS`RS\ OZa] SW\TOQVS 2ObS\bg^S\ \WQVb S`ZOcPb aW\R h0 PSW ;SbV]RS\OcT`cTS\ ]RS` eS\\ hcaÉbhZWQVS DS`O`PSWbc\Ua[rUZWQVYSWbS\ US\cbhb eS`RS\ a]ZZS\ ?a^VaP\\ FaP__Ta ) 4X]T] 8]cTVTafTac P[b >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!)
public class Wrapper02 { public static void main(String[] args) { char zeichen1 = 65; if (Character.isUpperCase(zeichen1)) System.out.println("Es ist ein Großbuchstabe"); } }
$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#$
IdbP\\T]UPbbd]V
@[YGSSKTLGYY[TM
3TZ[PaPcX^]bP]fTXbd]VT] QT]»cXVT] X\\Ta SXT 0]VPQT STb 3PcT]ch_b 2WS 2SYZO`ObW]\ d]\ SW\TOQVS\ DO`WOPZS\ aWSVb US\Oc a] Oca eWS RWS 2SYZO`ObW]\ d]\ 9ZOaaS\bg^S\(
.
0SWa^WSZS(
int zahl; String text;
// primitiver Datentyp // Referenz-Datentyp
E^acTX[T STb Ch_Z^]iT_cb •
2WS >`]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 RSa Bg^a S`[WbbSZb eS`RS\
•
DS`abÉ\RZWQVYSWb eSWZ /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T] STR[PaPcX^]
•
7V`S `]U`O[[WS`S` SW\TOQVS` c\R Tº` RWS 8D; STTWhWS\bS` OZa ROa /`PSWbS\ [Wb @STS`S\hDO`WOPZS\ eSWZ h0 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 \ W\ RWSaS[ A^SWQVS`^ZObh TSabUSZSUb 2S` ES`bSPS`SWQV S`UWPb aWQV Rc`QV e] PSW \ RWS /\hOVZ RS` PWba Wab RWS hc` DS`TºUc\U abSVS\
•
/ZZS`RW\Ua eW`R SdbZ PWb PS\rbWUb Tº` RWS D]`hSWQVS\RO`abSZZc\U /ZZS \c[S`W aQVS\ Bg^S\ eS`RS\ [Wb D]`hSWQVS\ USa^SWQVS`b OczS` RWPa c\R Q^^[TP] aW\R OZZS Bg^S\ \c[S`WaQV
@STS`S\hbg^S\ eWS /``Oga c\R Ab`W\Ua ]RS` PSZWSPWUS O\RS`S PS\cbhS`RSTW\WS`bS 2O bS\bg^S\ 9ZOaaS\ eS`RS\ Oca RWSaS\ Ob][O`S\ 0OcabSW\S\ hcaO[[S\USaSbhb
$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$
FPb bX]S EPaXPQ[T].
8'3\KX]GRZKT
ES\\ 2ObS\ d]\ SW\S[ >`]U`O[[ O\USa^`]QVS\ c\R dS`O`PSWbSb eS`RS\ a]ZZS\ RO\\ [ºaaS\ aWQV RWSaS 2ObS\ heW\US\R W[ @/; @O\R][ /QQSaa ;S[]`g RV W[ W\bS`\S\ /`PSWbaa^SWQVS` 6Oc^ba^SWQVS` PSTW\RS\ 2ObS\ OcT SW\S[ O\RS`S\ ;SRW c[ aW\R \WQVb RW`SYb [O\W^cZWS`PO` /Za] Wab Sa \]beS\RWU RWS 2ObS\ S\beSRS` SW\ hcZSaS\ ]RS` RWS 2ObS\ OZa BSWZ RSa ?cSZZQ]RSa RW`SYb W[ >`]U`O[[ hc Y]RWS`S\ OZa :WbS`OZS 4º` RWS /cT\OV[S RS` SW\USZSaS\S\ 2ObS\ c\R Tº` RWS DS`eOZbc\U RSa /`PSWbaa^SWQVS`a abSVb SW\ 9]\hS^b hc` DS`TºUc\U ROa OZa EPaXPQ[T]Z^]iT_c PS hSWQV\Sb eW`R ;Wb RWSaS[ BVS[O PSTOaaS\ eW` c\a W\ RWSaS[ 9O^WbSZ 7[ 9O^WbSZ " VOPS\ eW` S`ZÉcbS`b eSZQVS ;rUZWQVYSWbS\ RS` Bg^WaWS`c\U RS` A^SW QVS`^ZÉbhS Sa UWPb eWS RORc`QV SW\S c\bS`aQVWSRZWQVS @S^`ÉaS\bObW]\ c\R SW\S ]^bW [WS`bS 0SVO\RZc\U [rUZWQV eW`R c\R d]` OZZS[ eWS RORc`QV RWS AWQVS`VSWb RS` DS` O`PSWbc\U S`VrVb eW`R 7\ RWSaS[ 9O^WbSZ ZS`\S\ AWS •
eOa DO`WOPZS\ c\R 9]\abO\bS\ aW\R
•
eWS aWS W[ /`PSWbaa^SWQVS` S`hScUb c\R dS`O`PSWbSb eS`RS\
•
eO`c[ Sa eWQVbWU Wab ROPSW heWaQVS\ =PXSYbS\ c\R SW\TOQVS\ DO`WOPZS\ hc c\ bS`aQVSWRS\
•
eWS :WbS`OZS W[ >`]U`O[[ PS\cbhb eS`RS\ c\R eSZQVS OZbS`\ObWdS\ 2O`abSZZc\ US\ [rUZWQV aW\R
•
eOa 3aQO^SAS_cS\hS\ aW\R c\R eSZQVS /`bS\ Sa UWPb
=GYYOTJ
DO`WOPZS\ aW\R /`PSWbaa^SWQVS`^ZÉbhS RWS bg^WaWS`b aW\R c\R SW\S\ `]U`O[[ RSTW\WS`b RORc`QV PSY][[b XSRS DO`WOPZS SW\S\ 2ObS\bg^ c\R SW\S\ 7RS\bWTWS`(
int zahl; String text;
]RS`
8OdO c\bS`aQVSWRSb ab`S\U heWaQVS\ DO`WOPZS\ RWS •
SW\S\ ^`W[WbWdS\ 2ObS\bg^ VOPS\ _aX\XcXeT EPaXPQ[T] c\R DO`WOPZS\ RS`S\
•
2ObS\bg^ SW\S 9ZOaaS Wab ATUTaT]i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VS DO`WOPZS\ Oca( •
SW\S[ =P\T] 0ShSWQV\S` 7RS\bWTWS` h0 iPW[
•
SW\S[ RS` SW\USPOcbS\ OQVb SW\TOQVS\ 3PcT]ch_T] h0 X]c
•
SW\S[ 8]WP[c ES`b h0 & ]RS` /
2S` =P\T c\R RS` 3PcT]ch_ eW`R Rc`QV SW\S DS`SW\PO`c\UaO\eSWac\U 2SYZO`ObW ]\ d][ >`]U`O[[WS`S` TSabUSZSUb ;Wb RS[
double gehalt;
3W\ FTac [caa d]` RS[ S`abS\ /\a^`SQVS\ RWSaS` DO`WOPZS\ d]`VO\RS\ aSW\ 3` YO\\ OZa a] US\O\\bS` 7\WbWOZeS`b S\beSRS` Ocb][ObWaQV Rc`QV 8OdO ]RS` PSW RS` 2S YZO`ObW]\ Phe Rc`QV ES`bShceSWac\U d][ >`]U`O[[WS`S` TSabUSZSUb e]`RS\ aSW\ 2O\OQV YO\\ RS` ES`b RS` DO`WOPZS\ PSZWSPWU ]Tb USÉ\RS`b eS`RS\ ;O\ aOUb Sa eW`R SW\ \ScS` ES`b idVTfXTbT] c\R ROa PSRScbSb ROaa RS` PWaVS`WUS 7\VOZb Y][ ^ZSbb ºPS`aQV`WSPS\ eW`R 2WSaS ES`bShceSWac\U dS`É\RS`b OZa] RS\ 7\VOZb SW\S` DO`WOPZS\ 0SW[ :SaS\ RS` DO`WOPZS\ PZSWPb RS` 7\VOZb c\dS`É\RS`b PSabSVS\ Sa eW`R ZSRWUZWQV SW\S 9]^WS hc[ 3[^TÉ\US` RSa :SaSPSTSVZa b`O\a^]`bWS`b $"
(( 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[
{
ÎQd]VT] id\ ?a^VaP\\ EPaXPQ[T] ÎQd]V ( EO\RSZ\ AWS ROa >`]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`
Aystem.out.println(vorhanden);
2c`QV RWSaS /\eSWac\U eW`R RS` OYbcSZZS 7\VOZb RSa A^SWQVS`PS`SWQVa [Wb RS[ 7RS\ bWTWS` e^aWP]ST] S`[WbbSZb c\R OcT RS` AbO\RO`ROcaUOPSSW\VSWb OcaUSUSPS\ ;O\ aOUb RS` /caR`cQY e^aWP]ST] eW`R OcaUSeS`bSb SdOZcWS`b c\R [Wb RS[ 3`USP\Wa eW`R RO\\ RWS USeº\aQVbS =^S`ObW]\ VWS`( _aX]c[] OcaUSTºV`b 2Oa T]ZUS\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`O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YObS\WS`S\ 2OTº` UWPb Sa RWS ;SbV]RS R^] RPc 2Oa 3`USP\Wa a]ZZ O[ 9]\a]ZPWZRaQVW`[ OcaUSUSPS\ eS`RS\ ?a^VaP\\ BcaX]V!) 8]bcP]iT] Pdb \XcVT[XTUTacT] :[PbbT] 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 <]bWS`S\ AWS RWS A^SWQVS`0SZSUc\U ROTº` OcT SW\S[ 0ZObb >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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) 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[
•
SW\S[ 2ObS\bg^ h0 X]c
•
SW\S[ c\dS`É\RS`ZWQVS\ 7\VOZb h0 &
3W\S 9]\abO\bS eW`R Rc`QV ROa AQVZºaaSZe]`b UX]P[ RSYZO`WS`b h0
final double MWST;
2S` ES`b RS` 9]\abO\bS\ YO\\ S\beSRS` PS`SWba PSW RS` 2SYZO`ObW]\ TSabUSZSUb eS` RS\(
final double MWST = 19.0;
]RS` a^ÉbS` Rc`QV SW\S ES`bShceSWac\U eWS ROa T]ZUS\RS >`]U`O[[ RS[]\ab`WS`b ?a^VaP\\ :^]bcP]cT] ) :^]bcP]cT] STUX]XTaT] d]S \Xc XW]T] PaQTXcT]
public class Konstanten01 { public static void main(String[] args) { final double MWST; MWST = 19.5; System.out.println(MWST); } } ES\\ RS` ES`b RS` 9]\abO\bS\ SW\[OZ TSababSVb YO\\ S` RO\OQV \WQVb [SV` []RWTW hWS`b eS`RS\ \c` Rc`QV Ò\RS`c\U RSa ?cSZZbSfbSa [Wb O\aQVZWSzS\RS` C[eO\R Zc\U E] ZWSUb RS` AW\\- Hc\ÉQVab SW\[OZ eW`R Rc`QV ROa AQVZºaaSZe]`b UX]P[ dS` VW\RS`b ROaa SW\S dS`aSVS\bZWQVS ;]RWTWYObW]\ RSa A^SWQVS`W\VOZba S`T]ZUb /czS`RS[ eW`R RWS :SaPO`YSWb S`VrVb RS\\ RS` 0SU`WTT ;EAB Wab OcaaOUSTÉVWUS` OZa RWS HOVZ & C\R hcaÉbhZWQV eW`R W[[S` RO\\ RWS EO`bc\UaT`Sc\RZWQVYSWb dS`PSaaS`b eS\\ RS` ES`b O\ [SV`S`S\ AbSZZS\ W[ >`]U`O[[ PS\cbhb eW`R RS\\ PSW SdS\bcSZZS\ Ò\ RS`c\US\ [caa \c` O\ SW\S` AbSZZS []RWTWhWS`b eS`RS\ ?a^VaP\\ :^]bcP]cT]!) :»]]T] :^]bcP]cT]fTacT VTÊ]STac fTaST].
public class Konstanten02 { public static void main(String[] args)
{
%"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$#
:^]bcP]cT]
final double PI = 3.14159; System.out.println("PI betraegt = " + PI); } } ÎQd]VT] id\ ?a^VaP\\ :^]bcP]cT]! ÎQd]V ) 9O\\ RS` 7\WbWOZeS`b OcQV eSUUSZOaaS\ eS`RS\- ESZQVS ;SZRc\U Y][[b PSW RS` C[eO\RZc\U RSa >`]U`O[[a- ÎQd]V !) 4ºUS\ AWS RWS 7\WbWOZWaWS`c\U eWSRS` SW\ 0WbbS dS`acQVS\ AWS RO\\ RS\ ES`b d]\ ?8 c[ ! hc S`VrVS\ Rc`QV 3W\TºUS\ d]\ T]ZUS\RS` /\eSWac\U( ?8 , ?8 ") EWS ZOcbSb RWS 4SVZS`[SZRc\U RWS PSW RS` C[eO\RZc\U S`hScUb eW`R- 9ZÉ`S\ AWS RO \OQV RWS 4`OUS ]P SdbZ SW\S \ScS ES`bShceSWac\U [rUZWQV Wab h0 W\ RS` 4]`[( PI = 3.14- 4X]VTQPdcT :^]bcP]cT] 7\ RS\ [WbUSZWSTS`bS\ 9ZOaaS\ RSa 8OdO/>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[[ eWS SW\S \]`[OZS DO`WOPZS PS\cbhb eS`RS\ 3W\hWUS /ca\OV[S( SW\S ES`bShceSWac\U Wab \c` TX]\P[ [rUZWQV ºPZW QVS`eSWaS PSW RS` 2SYZO`ObW]\ OZa 7\WbWOZeS`b 2WS Ag\bOf Tº` SW\S 9]\abO\bS S`T]` RS`b ROaa ROa AQVZºaaSZe]`b UX]P[ PS\cbhb eW`R /czS`RS[ eW`R S[^T]VZS\ ROaa RS` 7RS\bWTWS` Y][^ZSbb Oca 5`]zPcQVabOPS\ PSabSVb
2OZKXGRK
=GYYOTJ2OZKXGRK% :WbS`OZS aW\R ES`bS RWS W[ >`]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
•
%$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$$
;XcTa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RWS /A177HSWQVS\ 4 RO`USabSZZb eS`RS\ 0SWa^WSZ( f/#44 ]RS` f/
?a^VaP\\ ;XcTaP[ ) 6P]iiPW[ & X] eTabRWXTST]T] =^cPcX^]T]
public class Literal01 { public static void main(String[] args) { int zahl1 = 17; // Dezimal 17 int zahl2 = 021; // Oktal 17 int zahl3 = 0x0011; // Hexadezimal 17 System.out.printf("%d %d %d", zahl1, zahl2, zahl3); } } 2Oa ZSbhbS AbObS[S\b S\bVÉZb SW\S 4]`[ObWS`c\U RS` 5O\hhOVZS\ RO[Wb RWS /caUOPS SW\VSWbZWQV OZa 2ShW[OZhOVZ S`T]ZUb 2WS ;SbV]RS _aX]cU aWSVS 9O^WbSZ $ S`ZOcPb RWS /\UOPS d]\ =^bW]\S\ Tº` RWS 4]`[ObWS`c\U RWSaS abSVS\ W\ /\TºV`c\Uaab`WQVS\ d]` RS\
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
ÎQd]VT] id\ ?a^VaP\\ ;XcTaP[
ÎQd]V ( AQV`SWPS\ AWS OcT SW\ 0ZObb >O^WS` eWS RWS PW\É`S\ 7\VOZbS RWSaS` R`SW DO `WOPZS\ aW\R 4`OUS( 0S\rbWUb [O\ ROhc RWS /A177 ]RS` C\WQ]RSBOPSZZS W[ /\VO\U- /\be]`b( <SW\ 6WZT`SWQV Yr\\bS Sa XSR]QV aSW\ eS\\ ROa T]ZUS\RS AbObS[S\b W\ ROa >`]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\ ]P RWS HOVZS\ OcQV Tº` RWSaS Bg^S\ S`ZOcPb aW\R ÎQd]V "( EOa ^OaaWS`b eS\\ RWS HOVZ \WQVb W\ RS\ ES`bSPS`SWQV RSa O\USUSPS\S\ 2ObS\bg^a ^Oaab- 0SWa^WSZ( QhcT iPW[ , !') EOa Wab RWS VrQVabS HOVZ RWS W\ RS` DO `WOPZS\ iPW[ USa^SWQVS`b eS`RS\ YO\\- 2Oa T]ZUS\RS >`]U`O[[ a]ZZ RWS 2ShW[OZhOVZ ' OcaUSPS\ 6W\eSWa( =YbOZhOVZS\ eS`RS\ [Wb SW\S` TºV`S\RS\
{
ÎQd]V id\ ?a^VaP\\ ;XcTaP[! ÎQd]V ( 2Oa >`]U`O[[ ZWSTS`b T]ZUS\RS\ C[eO\RZc\UaTSVZS`( W\bSUS` \c[PS` b]] ZO`US( ' 2Oa S`aQVSW\b hc\ÉQVab aSZbaO[ /PS` UWPb Sa SW\S =YbOZhWTTS` & ]RS` '- 9]``WUWS`S\ AWS RS\ 4SVZS` ÎQd]V !) Ò\RS`\ AWS RS\ 7\WbWOZeS`b RS` DO`WOPZS\ iPW[ OcT SW\S\ \SUObWdS\ ES`b 6W\eSWa( 2Oa D]`hSWQVS\ abSVb d]` RS` HOVZ EOa VOPS\ AWS Rc`QV RWS ]PWUS ÍPc\U USZS`\b- 3W\S TºV`S\RS
%&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$$
;XcTaP[T
?a^VaP\\ ;XcTaP[") 6P]iiPW[XVTb ;XcTaP[ P[b [^]V3PcT]ch_ X]cTa_aTcXTaT]
public class Literal03 { public static void main(String[] args) long zahl1 = 12345678901L; System.out.println(zahl1); } }
{
ÎQd]VT] id\ ?a^VaP\\ ;XcTaP[" ÎQd]V ( 2S[ :WbS`OZ Wab RS` 0cQVabOPS : O\USVÉ\Ub 3\bTS`\S\ AWS RS\ 0cQVabOPS\ : ESZQVS 4SVZS`[SZRc\U UWPb Sa PSW RS` C[eO\RZc\U- ÎQd]V !( 9O\\ OcQV SW\ 9ZSW\PcQVabOPS Z PS\cbhb eS`RS\- >`ºTS\ AWS ]P RWS :Sa PO`YSWb ZSWRSb PSabSVb SbeO DS`eSQVaSZc\UaU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 3 SW\ 3f^]\S\b O\USUSPS\ ?a^VaP\\ ;XcTaP[%) 6[TXcZ^\\P;XcTaP[ X] BcP]SPaSbRWaTXQfTXbT
public class Literal06 { public static void main(String[] args) double d1 = 123.0; System.out.println(d1); } }
{
?a^VaP\\ ;XcTaP[&) 6[TXcZ^\\P;XcTaP[ X] fXbbT]bRWPUc[XRWTa BRWaTXQfTXbT public class Literal07 { public static void main(String[] args) double d1 = 12345E-2; System.out.println(d1); } }
{
ÎQd]VT] id\ ?a^VaP\\ ;XcTaP[& ÎQd]V ) 2STW\WS`S\ AWS SW\S eSWbS`S DO`WOPZS S! c\R W\WbWOZWaWS`S\ AWS RWSaS [Wb RS[ /\TO\UaeS`b !%# 0S\cbhS\ AWS ROPSW RWS eWaaS\aQVOTbZWQVS AQV`SWPeSWaS 0SWa^WSZ Tº` SW\S [rUZWQVS :rac\U( !%#S A^WSZb RWS 5`]z9ZSW\aQV`SWPc\U RSa 0cQVabOPS\ S SW\S @]ZZS- ÎQd]V !( Ò\RS`\ AWS RS\ 2ObS\bg^ d]\ S^dQ[T OcT U[^Pc- 7ab SW\S TSVZS`T`SWS C[ eO\RZc\U [rUZWQV- FXT fTaST] U[^Pc;XcTaP[T QT]dcic.
ESWZ RWS ÍPc\U hc SW\S[ C[eO\RZc\UaTSVZS` USTºV`b VOb PZSWPb hc YZÉ`S\ eWS SW\ U[^PcBg^ [Wb SW\S[ :WbS`OZ USTºZZb eS`RS\ YO\\ RS\\ ]TTS\aWQVbZWQV eW`R XSRSa 5ZSWbY][[O:WbS`OZ abO\RO`R[ÉzWU OZa S^dQ[TBg^ W\bS`^`SbWS`b
&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$$
;XcTaP[T
A]ZZ SW\ :WbS`OZ [Wb SW\S[ 2ShW[OZ^c\Yb OZa U[^PcES`b c\R \WQVb OZa S^dQ[TES`b W\ bS`^`SbWS`b eS`RS\ a] [caa RWSa OcaR`ºQYZWQV [WbUSbSWZb eS`RS\ c\R heO` Rc`QV /\UOPS RSa 0cQVabOPS\a T Phe 4 VW\bS` RS[ :WbS`OZ ?a^VaP\\ ;XcTaP[')
Arbeiten mit Float-Literalen public class Literal08 { public static void main(String[] args) float d1 = 5e-3f; System.out.println(d1); } }
{
5ZSWY][[O:WbS`OZS ]V\S Sf^ZWhWbS /\UOPS d]\ T ]RS` 4 eS`RS\ OZa R]cPZSBg^ W\ bS`^`SbWS`b 2WS <]bObW]\ W\ VSfORShW[OZ ]RS` ]YbOZ Wab Tº` 5ZSWbY][[OES`bS \WQVb S`ZOcPb
INGX2OZKXGRK HSWQVS\ZWbS`OZS VOPS\ RS\ 2ObS\bg^ RWPa AWS eS`RS\ W[ ?cSZZbSfb W\ SW\TOQVS /\ TºV`c\Uaab`WQVS SW\USTOaab c\R Yr\\S\ RO`USabSZZb eS`RS\ Rc`QV •
ROa HSWQVS\ aSZPab h0 / ]RS` Rc`QV
•
RS\ 1]RS^]W\b W[ C\WQ]RS h0 Jc' O\USUSPS\ OZa VSfORShW[OZS 2O`abSZ Zc\U RS` PSWRS\ 0gbSa W[ /`PSWbaa^SWQVS` ]RS` Rc`QV
•
a] US\O\\bS d]`RSTW\WS`bS 3aQO^SaS_cS\hS\ h0 J\
4º` ROa /`PSWbS\ [Wb RS[ 1]RS^]W\b c\R RS\ d]`RSTW\WS`bS\ 3aQO^SaS_cS\hS\ Wab ROa 1]RWS`S\ RSa @ºQYeÉ`baab`WQVa POQYaZOaV J \]beS\RWU 2S` 1]RS^]W\b eW`R OZa VSfORShW[OZS` dWS`abSZZWUS` ES`b SW\USUSPS\ O\USTºV`b d]\ RS[ J c\R SW\S[ YZSW \S\ c Tº` C\WQ]RS 3W\S SbeOa dS`eW``S\RS 3WUS\O`b Wab RWS [rUZWQVS /\UOPS OZa =YbOZhOVZ h0 J!% ?a^VaP\\ ;XcTaP[() 0aQTXcT] \Xc RWPa;XcTaP[T] public class Literal09 { public static void main(String[] args) { char zeichen = 'A'; System.out.println("Das Zeichen ist: " + zeichen); } } ÎQd]V id\ ?a^VaP\\ ;XcTaP[( Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa OZa HSWQVS\ZWbS`OZ \WQVb RS` 0cQVabOPS aSZPab a]\ RS`\ aSW\ 1]RS^]W\b OZa 7\WbWOZeS`b O\USUSPS\ eW`R :rac\UaVW\eSWa( X]cBg^ &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
`]U`O[[ RW`SYb PS\cbhS\ hc Yr\\S\ EOa Wab OPS` eS\\ RWSaS` ES`b \WQVb ^S` BOabObc` W\ RS\ A]c` QSQ]RS SW\USUSPS\ eS`RS\ YO\\ 0SWa^WSZaeSWaS YO\\ ROa HSWZS\d]`aQVcPhSWQVS\ \WQVb a] ]V\S eSWbS`Sa BSWZ RSa ?cSZZbSfba aSW\ RS\\ Sa eº`RS RW`SYb PSW[ 3RWbWS`S\ SW\S\ HSWZS\d]`aQVcP OcaZraS\ 7ab OZa] hc` >`]U`O[[ZOcThSWb SW\ D]`aQVcP OcT SW\S \ScS HSWZS S`T]`RS`ZWQV a] [caa SW\ a^ShWSZZSa 3aQO^ShSWQVS\ PS\cbhS\ eS`RS\ 2WS 3aQO^SaS_cS\hS\ Tº` HSWZS\d]` aQVcP Wab J\ ROa S\ba^`WQVb RS[ 1]RS^]W\b JcO ?a^VaP\\ ;XcTaP[ ) 0aQTXcT] \Xc e^aSTUX]XTacT] 4bRP_TBT`dT]iT] public class Literal10 { public static void main(String[] args) { char lf = '\n'; System.out.println("Zeile1" + lf + "Zeile2"); } } 0Sa]\RS`a Wab RS\ 4ÉZZS\ e] Sa aWQV PSW RS[ 1VO`OQbS`:WbS`OZ c[ \WQVbRO`abSZZPO`S HSWQVS\ W[ /A1771]RS RWS HSWQVS\ ! VO\RSZb Wab Sa aW\\d]ZZ OcT d]`RSTW\WS`bS 2O`abSZZc\US\ hc`ºQYhcU`SWTS\ AWS PSUW\\S\ OZZS [Wb J POQYaZOaV 3a UWPb SW\S UO\hS @SWVS d]\ d]`RSTW\WS`bS\ 3aQO^SaS_cS\hS\ /ZZS\ US[SW\aO[ Wab ROaa aWS SW\S PSa]\RS`S 0SRScbc\U Tº` RS\ 1][^WZS` VOPS\ [O\ TZºQVbSb OZa] Oca RS` \]`[OZS\ 1]RWS`c\U c\R dS`ZO\Ub SW\S PSa]\RS`S :SWabc\U d][ 1][^WZS` ESW bS`S 3aQO^SaS_cS\hS\ aW\R h0 Jb JT J J JJ
+ BOPcZOb]` RShW[OZ ' VSf f' + 4]`[TSSR RShW[OZ VSf f1 + 2O`abSZZc\U RSa R]^^SZbS\ 6]QVY][[O + 2O`abSZZc\U RSa SW\TOQVS\ 6]QVY][[O + 2O`abSZZc\U RSa 0OQYaZOaV
0Sa]\RS`a RWS R`SW ZSbhbS\ HSWQVS\ aW\R W\bS`SaaO\b AWS eS`RS\ PS\rbWUb eS\\ W\ \S`VOZP SW\Sa >`]U`O[[a RWS HSWQVS\ ]RS` ]RS` J OZa RSa BSWZ SW\Sa BSfbSa RO` USabSZZb eS`RS\ [ºaaS\ ÎQd]V id\ ?a^VaP\\ ;XcTaP[ ÎQd]V ( Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa heWaQVS\ RS\ PSWRS\ BSWZab`W\Ua HTX [T c\R HTX[T! O\abSZZS RSa :W\STSSR O SW\ /\TºV`c\UahSWQVS\ c\R P SW\ J 0OQYaZOaV S`aQVSW\b ÎQd]V !) Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa heWaQVS\ RS\ PSWRS\ BSWZab`W\Ua SW\ /ZO`[ S`br\b 2Oa C\WQ]RShSWQVS\ ROTº` Wab Jc% &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$$
;XcTaP[T
9ZXOTM2OZKXGRK
Ab`W\U:WbS`OZS PSabSVS\ Oca SW\S[ ]RS` [SV`S`S\ HSWQVS\ RWS W\ R]^^SZbS\ 6]QV Y][[Oa SW\USaQVZ]aaS\ aW\R Hc` 3`W\\S`c\U( SW\ RWPa:WbS`OZ eW`R W\ SW\TOQVS 6]QVY][[Oa SW\USaQVZ]aaS\ EWS OZZS O\RS`S\ :WbS`OZS OcQV a] Yr\\S\ Ab`W\UZWbS `OZS SW\USaSbhb eS`RS\ •
Tº` RWS 7\WbWOZWaWS`c\U
•
PSW ES`bShceSWac\US\
•
OZa >O`O[SbS` PSW SW\S[ ;SbV]RS\OcT`cT aWSVS 9O^WbSZ
BcaX]V;XcTaP[T QTX STa >QYTZc8]XcXP[XbXTad]V
2WS [WbUSZWSTS`bS 9ZOaaS BcaX]V PWSbSb SW\S dS`SW\TOQVbS ;rUZWQVYSWb RS` 7\abO\h 3`hScUc\U <]`[OZS`eSWaS eW`R SW\S 7\abO\h [Wb RS[ AQVZºaaSZe]`b ]Tf S`hScUb 3W\S Ab`W\U7\abO\h YO\\ OPS` Rc`QV SW\TOQVS 7\WbWOZWaWS`c\U ]RS` OcQV Rc`QV SW\S PZ]zS ES`bShceSWac\U S`hScUb eS`RS\ C\R ROPSW Yr\\S\ OcQV Ab`W\UZWbS`OZS SW\US aSbhb eS`RS\ /ZZS T]ZUS\RS\ R`SW 0SWa^WSZS VOPS\ SfOYb RWS UZSWQVS EW`Yc\U( /caTºV`ZWQVS AQV`SWPeSWaS [Wb RS[ AQVZºaaSZe]`b ]Tf( String str = new String("abc"); 9c`haQV`SWPeSWaS Rc`QV 7\WbWOZWaWS`c\U( String str = "abc"; =PXSYbS`hScUc\U Rc`QV ES`bhceSWac\U( String str; str = "abc"; 7\ OZZS\ 4ÉZZS\ eW`R SW\ Ab`W\U:WbS`OZ PS\cbhb [Wb RS\ ! HSWQVS\ OPQ 8OdO YS\\b Tº` @STS`S\hdO`WOPZS\ \]QV SW\ PSa]\RS`Sa :WbS`OZ( ]d[[ 3a eW`R PS\cbhb c[ O\hchSWUS\ ROaa RWS @STS`S\hdO`WOPZS ZSS` Wab ROaa OZa] \]QV YSW\ =PXSYb SfWa bWS`b 2S` ES`b ]d[[ eW`R S\beSRS` Sf^ZWhWb d][ >`]U`O[[WS`S` hcUSeWSaS\ ]RS` eS\\ Sa aWQV \WQVb c[ Z]YOZS DO`WOPZS a]\RS`\ c[ SW\ 9ZOaaS\[S[PS` aWSVS 9O^W bSZ VO\RSZb OZa 7\WbWOZeS`b Ocb][ObWaQV SW\USaSbhb ?a^VaP\\ ;XcTaP[
) BRW[¶bbT[f^ac ]d[[ U¶a ATUTaT]iePaXPQ[T]
public class Literal11 { public static void main(String[] args) String s1 = null; System.out.println(s1); } }
{
&!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
B^]STaiTXRWT] X\ BcaX]V;XcTaP[ A] eWS Sa PSW RWPa:WbS`OZS\ RWS ;rUZWQVYSWb UWPb [Wb a] US\O\\bS\ 3aQO^SaS_cS\ hS\ ^`]PZS[ObWaQVS HSWQVS\ RSa C\WQ]RSa RO`hcabSZZS\ a] UWPb Sa OcQV PSW BcaX]V :WbS`OZS\ RWS ;rUZWQVYSWb 3aQO^SAS_cS\hS\ ]RS` 1]RS^]W\ba W\\S`VOZP SW\Sa a]Z QVS\ BcaX]V:WbS`OZa hc dS`eS\RS\ ?a^VaP\\ ;XcTaP[ !) 0aQTXcT] \Xc BcaX]V;XcTaP[T] d]S 4bRP_TBT`dT]iT] public class Literal12 { public static void main(String[] args) { String str = "a\u0062c"; System.out.println("Der String enthaelt: " + str); } } ES\\ SW\ ASWbS\d]`aQVcP W\\S`VOZP RSa Ab`W\Ua OcaUSZrab eS`RS\ a]ZZ a] [caa ROa 3aQO^SHSWQVS\ J\ ROTº` SW\USb`OUS\ eS`RS\ ÎQd]VT] id\ ?a^VaP\\ ;XcTaP[ ! 3`aSbhS\ AWS RS\ 1]RS^]W\b RSa 0cQVabOPS\a P Rc`QV RWS S\ba^`SQVS\RS 3aQO^S AS_cS\h Tº` RS\ BOPcZOb]` 0SabW[[bS HSWQVS\ aW\R W\ SW\S[ Ab`W\U OZa] ]XRWc SXaTZc dS`eS\RPO` h0 HSWZS\ d]`aQVcP 2O[Wb RO`T SW\ Ab`W\UZWbS`OZ \WQVb ºPS` heSW ]RS` [SV` HSWZS\ USVS\ A]ZZbS ROa :WbS`OZ hc ZO\U aSW\ Tº` SW\S HSWZS a] [caa Sa OcT [SV`S`S HSWZS\ OcTUSbSWZb c\R [Wb RS[ =^S`Ob]` Y]\YObS\WS`b eS`RS\ ?a^VaP\\ ;XcTaP[ ") 4X] [P]VTb BcaX]V;XcTaP[ ¶QTa \TWaTaT ITX[T] public class Literal13 { public static void main(String[] args) String str = "Dies ist ein " + "langer Text"; System.out.println(str); } }
{
ÎQd]V id\ ?a^VaP\\ ;XcTaP[ " 0SO\be]`bS\ AWS T]ZUS\RS 4`OUS( EWS YO\\ [O\ aSV` ZSWQVb S`YS\\S\ ]P RS` 2ObS\ bg^ SW\S` DO`WOPZS\ SW\ ^`W[WbWdS` 2ObS\bg^ Wab ]RS` ]P Sa aWQV c[ SW\S 9ZOaaS\PS aQV`SWPc\U VO\RSZb- :rac\UaVW\eSWa( 9ZOaaS\\O[S\ a]ZZbS\ [Wb SW\S[ 5`]zPcQVabOPS\ PSUW\\S\ A][Wb c\bS`aQVSWRS\ aWQV RWSaS 7RS\bWTWS` d]\ RS\ SW\USPOcbS\ Bg^S\ RWS eWS OZZS AQVZºaaSZer`bS` YZSW\ USaQV`WSPS\ eS`RS\
&"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$%
IdbP\\T]UPbbd]V
@[YGSSKTLGYY[TM
7\ RWSaS[ 9O^WbSZ VOPS\ eW` RWS ;rUZWQVYSWbS\ PSa^`]QVS\ eWS DO`WOPZS W[ /`PSWba a^SWQVS` S`hScUb c\R dS`eOZbSb eS`RS\ Yr\\S\ ÍPZWQVS`eSWaS Yr\\S\ RWS /`PSWba a^SWQVS`^ZÉbhS SW\S\ dO`WOPZS\ 7\VOZb VOPS\ 2Oa USaQVW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W\Sa BcaTP\b USaSVS\ 2Oa >`]U`O[[ BcaTP\ YPeP S\bVÉZb SW\ 0SWa^WSZ Tº` ROa :SaS\ SW\S` 0SRWS\S`SW\ UOPS O[ 9]\a]ZPWZRaQVW`[ 2WSaSa >`]U`O[[ a]ZZ VSZTS\ RWS 4`OUS hc YZÉ`S\ eOa ZWSTS`b RWS ;SbV]RS aTPS \c\ eW`YZWQV O\ ROa >`]U`O[[- ?a^VaP\\ BcaTP\ ) 2^]b^[T P[b 4X]VPQTbcaTP\
import java.io.*; public class Stream01 { public static void main(String[] args) throws Exception { InputStreamReader eingabe = new InputStreamReader(System.in); int zeichen = eingabe.read(); System.out.println(zeichen); } }
Hc\ÉQVab eW`R SW\S 7\abO\h RS` 9ZOaaS 8]_dcBcaTP\ATPSTa S`hScUb 2ORc`QV Wab Sa [rUZWQV RWS ;SbV]RS aTPS hc \cbhS\ EW` e]ZZS\ RWS 4`OUS YZÉ`S\( EOa ZWSTS`b aTPS. 2WS /\be]`b S`UWPb aWQV Oca RS\ \OQVT]ZUS\RS\ ÍPc\US\ &'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
ÎQd]VT] \Xc ST\ ?a^VaP\\ BcaTP\ ÎQd]V ( 0WbbS eO\RSZ\ AWS ROa >`]U`O[[ c[ c\R bSabS\ AWS Sa 5SPS\ AWS RS\ 0cQVabOPS\ / SW\ ]RS` SW\ HSWQVS\ Oca RS[ /A1771]RS d]\ % c\R ºPS` ^`ºTS\ AWS ]P RWS /caUOPS RS[ 1]RS^]W\b W\ RS` C\WQ]RSBOPSZZS S\ba^`WQVb 6O\ RSZb Sa aWQV c[ RS\ VSfORShW[OZS\ ES`b ]RS` c[ RWS /\UOPS OZa 2ShW[OZhOVZ- ÎQd]V !( EOa UWPb ROa >`]U`O[[ Oca eS\\ AWS c\bS` ;AEW\R]ea \OQV RS[ >`]U`O[[abO`b ZSRWUZWQV R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SZ^`]U`O[[[ RS[]\ab`WS`b eWS TZSfWPSZ RWS 8OdOA^`OQVS Wab eS\\ aWQV ROa 3W\UOPS[SRWc[ É\RS`b EW` e]ZZS\ RWS UZSWQVS /cTUOPS eWS W[ >`] U`O[[ BcaTP\ ZraS\ \É[ZWQV ROa :SaS\ SW\Sa SW\hSZ\S\ HSWQVS\a d]\ SW\S[ 3W\ UOPSab`][ 7\ RWSaS[ 0SWa^WSZ a]ZZ RS` 3W\UOPSab`][ OZZS`RW\Ua SW\S 2ObSW aSW\ ?a^VaP\\ BcaTP\!) 3PcTX P[b 4X]VPQTbca^\ QhcT^aXT]cXTac
// Kommentarzeile (das erste Zeichen wird gelesen) import java.io.*; public class Stream02 { public static void main(String[] args) throws Exception { InputStream eingabe = new FileInputStream("Stream02.java"); int zeichen = eingabe.read(); System.out.println(zeichen); } }
2Oa >`]U`O[[ BcaTP\! ZWSab [Wb RS` ;SbV]RS aTPS Oca RS` 9ZOaaS 5X[T8] _dcBcaTP\ SW\ SW\hSZ\Sa HSWQVS\ Oca RS` 2ObSW BcaTP\!YPeP 2Oa 3`USP\Wa RWSaSa :SaSd]`UO\USa abSVb RO\\ W\ RS` X]cDO`WOPZS\ iTXRWT] 0WbbS PSOQVbS\ AWS( RWSaS DO `WOPZS VOb RS\ 2ObS\bg^ X]c /\aQVZWSzS\R eW`R ROa USZSaS\S HSWQVS\ OcaUSUSPS\ 2Oa 3`USP\Wa Wab "% :Ocb C\WQ]RSBOPSZZS Wab RWSa RS` 1]RS^]W\b ]RS` RWS >ZObh<` Tº` RS\ AQV`ÉUab`WQV RS\\ ROa Wab ROa S`abS HSWQVS\ W\ RS` 3W\UOPSRObSW ÍP`WUS\a YO\\ [O\ W\ RWSaS[ 4OZZ OcQV W\ RS` /A177BOPSZZS \OQVaSVS\ RS\\ RWS S`abS\ & HSWQVS\ RSa /A1771]RSa aW\R WRS\bWaQV [Wb RS\ S`abS\ & HSWQVS\ RSa C\WQ]RSa ÎQd]V id\ ?a^VaP\\ BcaTP\! 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa ROa dWS`bS HSWQVS\ RS` 2ObSW SW\USZSaS\ c\R RSaaS\ 1]RS^]W\b OcaUSUSPS\ eW`R :rac\UaVW\eSWa( 3a aW\R dWS` :SaSPSTSVZS S`T]` RS`ZWQV '
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
;TZKXYINOKJROINK/TZKXVXKZGZOUTJKX+OTMGHK 2Oa >`]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); } }
<]beS\RWU Wab ZSRWUZWQV RWS /\UOPS RWPa W[ /caUOPSPSTSVZ 2ORc`QV eW`R RS` 7\VOZb RS` 7\bSUS`dO`WOPZS\ OZa HSWQVS\ W\bS`^`SbWS`b c\R Sa eW`R O\abSZZS RSa HOV ZS\eS`ba RS` AQV`ÉUab`WQV OcaUSUSPS\ ÎQd]VT] id\ ?a^VaP\\ BcaTP\ ÎQd]V ) EW` Y][[S\ hc`ºQY OcT ROa >`]U`O[[ BcaTP\ 0WbbS bSabS\ AWS RWSaSa >`]U`O[[ , :SaS\ d]\ BhbcT\X] W\RS[ AWS SW\S HOVZ PSabSVS\R Oca SW\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^VaP\\ 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(zeichen1); } } 2Oa >`]U`O[[ 2^]b^[T S`eO`bSb d][ 0SRWS\S` RWS 3W\UOPS SW\Sa HSWQVS\a ;Wb RS` ;SbV]RS aTPS eW`R dS`acQVb Oca RS[ 3W\UOPSab`][ SW\ HSWQVS\ hc ZSaS\ ES\\ RS` Ab`SO[ ZSS` aSW\ a]ZZbS ab]^^b ROa >`]U`O[[ c\R Sa PSUW\\b RWS /`PSWb S`ab RO\\ eWSRS` eS\\ SW\ HSWQVS\ ºPS` BhbcT\X] SW\USUSPS\ ec`RS c\R RS` 0S RWS\S` RWS 3\bS`bOabS USR`ºQYb VOb ÎQd]V id\ ?a^VaP\\ 2^]b^[T 5SPS\ AWS ROa HSWQVS\ SW\ ROa OZa /\be]`b # OcaUWPb :rac\UaVW\eSWa( 0WbbS W\ RS` C\WQ]RSBOPSZZS \OQVaQVOcS\ c[ hc S`[WbbSZ\ eSZQVSa HSWQVS\ RS\ \c[S`W aQVS\ ES`b # VOb 2Oa \ÉQVabS 0SWa^WSZ RS[]\ab`WS`b ROa 3W\ZSaS\ d]\ [SV`S`S\ HSWQVS\ /\ RWSaS` AbSZZS TSVZS\ \]QV 9S\\b\WaaS hc` AQVZSWTS\PWZRc\U W\ 8OdO
'"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%!
BcP]SPaS4X]VPQT
ÎQd]V id\ ?a^VaP\\ 2^]b^[T! 0WbbS abO`bS\ AWS ROa >`]U`O[[ c\R bW^^S\ AWS ZSRWUZWQV TX] HSWQVS\ SW\ ES\\ AWS RO\OQV RWS 3\bS`BOabS R`ºQYS\ eS`RS\ b`]bhRS[ R`SW HSWQVS\ SW\USZSaS\ c\R O[ 0WZRaQVW`[ OcaUSUSPS\ >`ºTS\ AWS O\VO\R RS` C\WQ]RSBOPSZZS W[ /\VO\U 1 c[ eSZQVS HSWQVS\ Sa aWQV VO\RSZb
'XHKOZKTSOZJKX1RGYYK9IGTTKX 3a UWPb \Obº`ZWQV OcQV AWbcObW]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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\ `]PZS[ hc ZraS\( ROa HSWZS\S\ RS eW`R OcT c\bS`aQVWSRZWQVS\ >ZObbT]`[S\ c\bS`aQVWSRZWQV RO`USabSZZb W\ ;A EW\R]ea Rc`QV 1@:4 W\ C\Wf Rc`QV 1@ c\R W\ ;/1=A Rc`QV :4 /cQV ROTº` PWS bSb 8OdO SW\S :rac\U 7\ a] US\O\\bS\ AgabS[^`]^S`bWSa aW\R RWSaS 3WUS\aQVOTbS\ Tº` RWS XSeSWZWUS >ZObbT]`[ USa^SWQVS`b c\R Sa UWPb ;SbV]RS\ RWSaS OPhcT`OUS\ 2Oa T]ZUS\RS 0SWa^WSZ hSWUb SW\S /\eS\Rc\U ?a^VaP\\ BRP]]Ta$) ?[PccU^a\d]PQWÊ]VXVTb 4X][TbT] e^] ITX[T]
import java.util.Scanner; public class Scanner05 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); String zeilenende = System.getProperty("line.separator"); eingabe.useDelimiter(zeilenende); // Delimiter aendern String zeile1 = eingabe.next(); // Komplettes Zeile lesen String zeile2 = eingabe.next(); // nächste Zeile lesen System.out.printf("%s %s", zeile1, zeile2); } }
9ZGTJGXJ'[YMGHK
EW`R RS` 0WZRaQVW`[ OZa AbO\RO`R/caUOPSSW\VSWb d][ >`]U`O[[ O\USa^`]QVS\ a] Wab RO[Wb SW\ SWUS\Sa 4S\abS` US[SW\b 2WSaSa O`PSWbSb hSWZS\]`WS\bWS`b c\R ROa PS RScbSb ROaa \WQVb SW\ SW\hSZ\Sa U`OTWaQVSa >WfSZ OR`SaaWS`b eS`RS\ YO\\ a]\RS`\ ROaa [Wb HSWZS\ c\R A^OZbS\ Tº` RWS HSWQVS\RO`abSZZc\U USO`PSWbSb eW`R 7\ SW\S` ;A EW\R]eac[USPc\U Wab RWSa RWS 3W\UOPSOcTT]`RS`c\U 2=A0]f 2WS /caUOPS ºPS` RWS AbO\RO`R/caUOPSSW\VSWb Wab aSV` Y][T]`bOPSZ A] abSVS\ T]Z US\RS ;SbV]RS\ hc` DS`TºUc\U( •
BhbcT\^dc_aX]c[] + Tº` RWS /caUOPS d]\ 8OdO2ObS\bg^S\ W\ SW\S HSWZS 2O \OQV eW`R OcT SW\S \ScS HSWZS d]`USaQV]PS\
'&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%"
BcP]SPaS0dbVPQT
•
BhbcT\^dc_aX]c + Tº` RWS /caUOPS d]\ 8OdO2ObS\bg^S\ W\ SW\S HSWZS ]V \S ROaa RO\OQV OcT SW\S \ScS HSWZS d]`USaQV]PS\ eW`R
•
BhbcT\^dcU^a\Pc + Tº` RWS T]`[ObWS`bS /caUOPS d]\ 8OdO2ObS\bg^S\ eWS _aX]cU
•
BhbcT\^dc_aX]cU + Tº` RWS T]`[ObWS`bS /caUOPS d]\ 8OdO2ObS\bg^S\ eWS U^a \Pc
3W\ AbObS[S\b [Wb RS\ 0ShSWQV\S`\ BhbcT\^dc PSeW`Yb ROaa RWS 9ZOaaS BhbcT\ USZO RS\ eW`R 7\ RS[ bcPcXR4SZR ^dc abSVb SW\S @STS`S\h OcT RWS OYbcSZZS AbO\RO`R /caUOPSSW\VSWb 3W\ C[ZSWbS\ Wab XSRS`hSWb [rUZWQV eWS ROa T]ZUS\RS >`]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 / %`]U`O[[ a] ROaa OZa B`S\\hSWQVS\ \WQVb SW\ AQV`ÉUab`WQV a]\RS`\ SW\ 9][[O OcaUSUSPS\ eW`R Hc[ /PaQVZcaa a]ZZ SW\ 0SWa^WSZ RWS /caUOPS d]\ :WbS`OZS\ c\R bg^WaWS`bS\ DO`WOPZS\ RS[]\ab`WS`S\ ?a^VaP\\ 5^a\Pc") 5^a\PcXTad]V \Xc ;XcTaP[T] d]S ch_XbXTacT] EPaXPQ[T] import java.io.*; public class Format03 { public static void main(String args[]) { int monat1 = 5; float gehalt1 = 2123.45f; String s1 = "Im Monat "; String s2 = "haben Sie "; String s3 = "%s %02d %s %4.2f verdient\n"; System.out.format(s3, s1, monat1, s2, gehalt1); System.out.format(s3, s1, 11, s2, 983f); } }
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
*GZKO\KXGXHKOZ[TM
2Oa Ab`SO[Y]\hS^b eW`R OcQV PSW[ :SaS\ ]RS` AQV`SWPS\ d]\ SfbS`\S\ 2ObS\b`É US`\ >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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RS\ YO\\( W[ S`abS\ >`]U`O[[ eW`R SW\S 2ObSW S` hScUb RWS SW\S\ 7\bSUS`eS`b S\bVÉZb 7\ RS\ T]ZUS\RS\ >`]U`O[[S\ eS`RS\ RWS dWS` X]c0gbSa OPS` OZa SW\hSZ\S 0gbSa W\bS`^`SbWS`b c\R S\Q]RWS`b W\ C\WQ]RS c\R hc[ AQVZcaa eWSRS` Y]\dS`bWS`b W\ /A1771]RS 2Ohc Wab Sa \]beS\RWU a] US\O\\bS 0`ºQYS\YZOaaS\ SW\hcaSbhS\ RWS OZa B`O\aT]`[ObW]\aVWZTS heWaQVS\ RS` /A177 c\R RS` C\WQ]RSeSZb Tc\UWS`S\
•
7\ RS\ PSWRS\ ZSbhbS\ >`]U`O[[ 4]R^ST ! dS`bWSTS\ eW` RWS USe]\\S\S\ 3W\aWQVbS\ hc[ BVS[O EWS eS`RS\ Oca /A177HSWQVS\ C\WQ]RSHSWQVS\- 2WS >`]U`O[[S eS`RS\ hSWUS\ ROaa RWSa ºPS` RS\ 3W\aObh RS` `WQVbWUS\ 3\Q]RW\U BOPSZZS USabScS`b eW`R
2KYKT[TJ9INXKOHKTOT*GZKO `]U`O[[ a]ZZ a]e]VZ ^`W[WbWdS DO`WOPZS\ X]cES`bS OZa OcQV 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\ 8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:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
ÎQd]VT] id\ ?a^VaP\\ 3PcTX ÎQd]V ( 9ZÉ`S\ AWS T]ZUS\RS 4`OUS\ Rc`QV /ca^`]PWS`S\( O EOa ^OaaWS`b eS\\ AWS RWSaSa >`]U`O[[ S`\Scb OcT`cTS\- AW\R RWS 2ObS\ W\ RS` 2ObSW heSW[OZ d]`VO\RS\ ]RS` eW`R RWS 2ObSW ºPS`aQV`WSPS\- P E] abSVb RWS 2ObSW eS\\ AWS W\ RS` dWS`bS\ HSWZS W\\S`VOZP RS` /\TºV`c\Uaab`WQVS T]ZUS\RSa O\USPS\( c:\test1.dat - ÎQd]V !( Ò\RS`\ AWS RWS /caUOPS[SbV]RS W\ faXcT1hcTb EWS É\RS`b aWQV RS` 7\ VOZb RS` /caUOPSRObSW- /\aQVZWSzS\R e]ZZS\ eW` SW\ >`]U`O[[ Q]RWS`S\ ROa RWS 2ObS\ Oca RS` 2ObSW cTbc SPc eWSRS` W\ RS\ /`PSWbaa^SWQVS` SW\ZWSab c\R d]\ R]`b W\ SW\S[ 9]\a]ZTS\abS` OcaUWPb ?a^VaP\\ 3PcTX!) 4X][TbT] e^] ch_XbXTacT] EPaXPQ[T] Pdb TX]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\ RO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
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\UShSWUb eW`R
:XGTYLUXSOKXKTSOZ(XIQKTQRGYYKT[TJ+TIUJOTM:GHKRRKT 2Oa \ÉQVabS >`]U`O[[ a]ZZ RS\ 7\VOZb RS` 2ObSW OZa dWS` SW\hSZ\S 0gbSa W\bS`^`SbWS`S\ c\R RWSaS OZa C\WQ]RSHSWQVS\ [Wb 6WZTS SW\S` 3\Q]RW\UBOPSZZS OcaUSPS\ 2WS eWQVbWUabS\ 6WZTaYZOaaS\ PSW RWSaS` B`O\aT]`[ObW]\ aW\R RWS 0`ºQYS\YZOaaS\ heWaQVS\ RS` &PWb/A177ESZb c\R RS` $PWbC\WQ]RSeSZb 8]_dcBcaTP\ATPSTa c\R >dc _dcBcaTP\FaXcTa C\R RWS eWQVbWUabS /cTUOPS Tº` RS\ >`]U`O[[WS`S` Wab RWS /ca eOVZ RS` `WQVbWUS\ 3\Q]RW\UBOPSZZS HSWQVS\aObh 1VO`OQbS`aSb 2WS PSYO\\bSabS\ HSWQVS\aÉbhS aW\R( 7A= $"$ 7A= &'f 1> # 1> CB4& CB4$ CB4!
AbO\RO`RCA/A177 %PWb + & HSWQVS\ d]\ VSf PWa %4 &PWb/A177 #$ HSWQVS\ d]\ VSf &44 :ObW\f [SV`S`S DS`aW]\S\ ;AEW\R]eaDS`aW]\ Tº` 7A= &' 1> Tº` 1]RS^OUS ;A2=A HSWQVS\aObh Tº` 1]\a]ZSTS\abS` W\ EW\R]ea &PWbC\WQ]RS RWS S`abS\ ## HSWQVS\ aW\R WRS\bWaQV [Wb 7A= &' $PWbC\WQ]RS OcQV C1A eW`R W\ 8OdO dS`eS\RSb ! PWbC\WQ]RS OcQV C1A"
7[ CB4$1]RS Wab ROa C\WQ]RSHSWQVS\ $# %' VSfORShW[OZ TSTT ROa 0gbS =`RS` ;O`Y 0=; 2O[Wb YO\\ TSabUSZSUb eS`RS\ ]P RWS 0gbS=`R\c\U RS` 0WU3\RWO\ $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%#
3PcTXeTaPaQTXcd]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 ]PWUS >`]U`O[[ PS\cbhb RWS PS`SWba [SV`TOQV S`eÉV\bS 9ZOaaS >dc_dcBcaTP\ FaXcTa Tº` RWS /caUOPS 2WSaS 9ZOaaS PWZRSb SW\S 0`ºQYS heWaQVS\ RS` C\WQ]RSESZb c\R /A177ESZb 0SW RS` /caUOPS d]\ 1VO`OQbS` ]RS` Ab`W\UeS`bS\ eS`RS\ RWS HSW QVS\ O\VO\R SW\S` C[eO\RZc\UabOPSZZS \Sc dS`aQVZºaaSZb 4º` RWS /caUOPS eS`RS\ RWS W\bS`\ PS\cbhbS\ C\WQ]RSHSWQVS\ W\ ROa 4]`[Ob Y]\dS`bWS`b ROa Rc`QV RWS 3\ Q]RW\U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E]`R O\hSWUS\ 2Oa 3`USP\Wa [caa a] OcaaSVS\( Java‰
ÎQd]V !) Ò\RS`\ AWS RS\ `]U`O[[ S`\Scb >`ºTS\ AWS RO\OQV eWS ZO\U RWS /caUOPSRObSW \c\ Wab c\R ZOaaS\ AWS aWQV RS\ 7\VOZb ºPS` ;AE]`R O\hSWUS\ ÎQd]V "( Ò\RS`\ AWS ROa >`]U`O[[ a] OP ROaa SW\ C\WQ]RShSWQVS\ Oca RS[ 0S `SWQV %4 OcaUSUSPS\ eW`R h0( [Wb T]ZUS\RS` HSWZS(
writer.write(0x0078);
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%#
3PcTXeTaPaQTXcd]V
>`ºTS\ AWS RWS /caUOPSRObSW c\R Y]\b`]ZZWS`S\ AWS ]P ROa HSWQVS\ RS` C\WQ]RS BOPSZZS S\ba^`WQVb ÎQd]V #) Ò\RS`\ AWS ROa >`]U`O[[ a] OP ROaa SW\S X]cDO`WOPZS RSTW\WS`b c\R WV` RS` 2ShW[OZeS`b &" hcUSeWSaS\ eW`R 5SPS\ AWS RO\\ RWSaS DO`WOPZS W\ RWS 2ObSW Oca c\R Y]\b`]ZZWS`S\ AWS ROa 3`USP\Wa eWSRS`c[ [Wb SW\S[ C\WQ]RSTÉVWUS\ BSfb ^`]U`O[[
.OT]KOYK`[S;:, 2S` AbO\RO`R CB4& C\WQ]RS B`O\aT]`[ObW]\ 4]`[Ob PSaQV`SWPb eWS C\WQ]RS HSWQVS\ a] b`O\aT]`[WS`b eS`RS\ ROaa /A177HSWQVS\ W\ TX]T\ 0gbS c\R OZZS O\RS `S\ W\ PWa " 0gbS dS`aQVZºaaSZb eS`RS\ 2WSaSa 4]`[Ob Wab ROa AbO\RO`R4]`[Ob Tº` RS\ /cabOcaQV d]\ C\WQ]RS2ObS\ 3a YO\\ US\cbhb eS`RS\ c[ C\WQ]RS2ObS\ W\ 2ObSWS\ hc aQV`SWPS\ c\R OcQV Tº` RS\ B`O\a^]`b RS` 2ObS\ h0 W[ 7\bS`\Sb 2S` D]`bSWZ ZWSUb W[ US`W\US`S\ >ZObhPSRO`T USUS\ºPS` RS[ \]`[OZS\ C\WQ]RS a]eSWb Sa aWQV c[ O[S`WYO\WaQVS BSfbS VO\RSZb RS\\ RWSaS eS`RS\ OcT SW\ 0gbS hc`ºQYUS TºV`b 2WS B`O\aT]`[ObW]\ d]\ C\WQ]RS RS` W\\S`VOZP RS` 8D; hc[ 3W\aObh Y][[b W\ CB4& Tº` RWS SfbS`\S 2O`abSZZc\U S`T]ZUb \OQV SW\S[ OcaUSYZºUSZbS\ /ZU]`WbV[ca A] USZbS\ PSWa^WSZaeSWaS T]ZUS\RS @SUSZ\( •
ZWSUb RS` ES`bSPS`SWQV RSa CB4$HSWQVS\a heWaQVS\ c\R %T eW`R Sa b`O\a T]`[WS`b W\ 0gbS [Wb T]ZUS\RS[ 0Wb[cabS`( fffffff
•
ZWSUb RS` ES`bSPS`SWQV RSa CB4$HSWQVS\a heWaQVS\ & c\R %TT eW`R Sa b`O\a T]`[WS`b W\ 0gbSa [Wb T]ZUS\RS\ 0Wb[cabS`\( fffff ffffff
2WS eWQVbWUabS 7\T]`[ObW]\ abSVb W\ RS\ S`abS\ 0Wba SW\Sa 0gbSa AbSVb R]`b SW\S a] VO\RSZb Sa aWQV c[ SW\S %0Wb/A1771]RWS`c\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 Sda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\ 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`WOPZS\ 3W\ /caR`cQY YO\\ OcQV Oca SW\S[ ;SbV]RS\OcT`cT PSabSVS\ 2WS =^S`O\RS\ PSW[ ;SbV]RS\OcT`cT aW\R \]`[OZS`eSWaS =PXSYbS 3W\S 0Sa]\RS`VSWb Wab ROaa Sa ;SbV] RS\OcT`cTS UWPb RWS ZTX] 3`USP\Wa ZWSTS`\ EW` eS`RS\ ROa /`PSWbS\ [Wb ;SbV]RS\ W[ 9O^WbSZ OcaTºV`ZWQV PSa^`SQVS\ 7\ RWSaS[ 9O^WbSZ USVb Sa OcaaQVZWSzZWQV c[ =^S`O\RS\ Oca SW\TOQVS\ 2ObS\bg^S\ c\R c[ RWS dS`aQVWSRS\S\ =^S`Ob]`S\ RWS ROhc RWS\S\ RWSaS =^S`O\RS\ hc dS`O` PSWbS\ AWS eS`RS\ RWS eWQVbWUabS\ /`bS\ d]\ /caR`ºQYS\ YS\\S\ ZS`\S\ c\R W\ dWS ZS\ ^`OYbWaQVS\ 0SWa^WSZS\ O\eS\RS\ 2WS PSWRS\ fXRWcXVbcT] 4X]bPciVTQXTcT Tº` /caR`ºQYS aW\R RWS AbScS`c\U RSa >`]U`O[[OPZOcTa h0 W\ SW\S` 7T/\eSWac\U( XU P ,, Q RWS ES`bShceSWac\U h0 P , $ h 2WSa aW\R RO\\ RWS BVS[S\ Tº` ROa 9O^WbSZ & !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
5VKXGTJKT[TJ5VKXGZUXKT
3W\ /caR`cQY a]ZZ SW\S\ ES`b OcaR`ºQYS\ 2WS /caeS`bc\U SW\Sa /caR`cQYa ZWSTS`b OZa] SW\ c\R \c` TX] 3`USP\Wa 2WSaSa 3`USP\Wa [caa d][ >`]U`O[[ W\ W`US\RSW\S` 4]`[ eSWbS`dS`O`PSWbSb eS`RS\ O\RS`\TOZZa Wab RWS /\eSWac\U c\d]ZZabÉ\RWU c\R TºV`b hc SW\S[ C[eO\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 ROa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Zc 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[ 4OZZ RS` HcaObhSTTSYb S`eº\aQVb ATXWT]U^[VT STa 0dbfTacd]V
2WS /caeS`bc\U d]\ hcaO[[S\USaSbhbS\ /caR`ºQYS\ USaQVWSVb W\ T]ZUS\RS` @SWVS\ T]ZUS( Hc\ÉQVab eW`R RS` ES`b RS` SW\hSZ\S\ =^S`O\RS\ S`[WbbSZb PSW DO`WOPZS\ Wab RWSa RS` OcUS\PZWQYZWQVS 7\VOZb RSa A^SWQVS`^ZObhSa RWSaS` DO`WOPZS\ 2O\OQV eS` RS\ \]`[OZS`eSWaS d]\ ZW\Ya \OQV `SQVba O\VO\R RS` =^S`Ob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d]` 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 <^Sd[^>_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 _TaPcX^]T] \Xc 6[TXcZ^\\PIPW[T] public class Gleitkomma01 { public static void main(String[] args) { double zahl1 = 15.21; double zahl2 = 0.0; double erg = zahl1 / zahl2; System.out.println("Ergebnis ist: " + erg); } } DO`WOPZS d][ Bg^ 5ZSWbY][[O YS\\S\ \SPS\ X]UX]Xch \]QV SW\S\ O\RS`S\ a^ShWSZ ZS\ ES`b( \WQVb RSTW\WS`b Phe YSW\S HOVZ <]bO
&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&!
0aXcW\TcXbRWT >_TaPc^aT]
7\bS`\ eS`RS\ RWS @SQVS\d]`UÉ\US\ \c` [Wb RS[ 2ObS\bg^ X]c ]RS` U`rzS` OcaUS TºV`b 2Oa VSWzb YZSW\S` OZa " 0gbS USVb \WQVb ES\\ RWS =^S`O\RS\ d][ c\bS` aQVWSRZWQVS\ Bg^ aW\R eW`R [W\RSabS\a W\ RS\ X]cBg^ Y]\dS`bWS`b 2WSaS` D]`UO\U eW`R OcQV OZa ]d\TaXR _a^\^cX^] PShSWQV\Sb ?a^VaP\\ 1hcT!) =d\TaXR ?a^\^cX^] QTX d]cTabRWXTS[XRWT] 3PcT]ch_T] public class Byte02 { public static void main(String args[]) byte z1 = 10; z1 = z1 + 5; System.out.println(z1); } }
{
ÎQd]V id\ ?a^VaP\\ 1hcT! 2WS C[eO\RZc\U RWSaSa >`]U`O[[a S\RSb [Wb SW\S` 4SVZS`[SZRc\U 0WbbS W\bS`^`S bWS`S\ AWS RWS 4SVZS`[SZRc\U c\R É\RS`\ AWS ROa >`]U`O[[ S\ba^`SQVS\R
;ToXKGXOZNSKZOYINK5VKXGZUXKT 8OdO=^S`Ob]`S\ dS`ZO\US\ S\beSRS` SW\ heSW ]RS` R`SW =^S`O\RS\ 2WS PWaVS` PS a^`]QVS\S\ O`WbV[SbWaQVS\ =^S`Ob]`S\ aW\R a] US\O\\bS QX]ÊaT RgORWaQVS =^S`O b]`S\ aWS abSVS\ heWaQVS\ heSW =^S`O\RS\ 2O`ºPS` VW\Oca UWPb Sa d]ÊaT []\ORW aQVS =^S`Ob]`S\ RWS \c` SW\S\ =^S`O\RS\ S`T]`RS`\ C\R Sa UWPb a]UO` SW\S\ =^S `Ob]` RS` R`SW =^S`O\RS\ S`T]`RS`b RS\ 0SRW\Uc\Ua]^S`Ob]` aWSVS c\bS` 7T0STSVZ 2WSaS` eW`R cT]Êa b`WORWaQV US\O\\b C\É`S =^S`Ob]`S\ dS`ZO\US\ OZa] \c` SW\S\ =^S`O\RS\ 0SW RS\ O`WbV[SbWaQVS\ 0STSVZS\ UWPb Sa heSW c\bS`aQVWSRZWQVS /ca^`É Uc\US\ RS` c\É`S\ =^S`Ob]`S\( Tº` RWS D]`hSWQVS\RO`abSZZc\U c\R Tº` RWS 7\Y`S [S\bPWZRc\U E^aiTXRWT] ;Wb RS[ ;W\cahSWQVS\ YO\\ OZa] \WQVb \c` RWS 2WTTS`S\h heWaQVS\ heSW =^S`O\RS\ S`[WbbSZb eS`RS\ Sa YO\\ OcQV OZa c\É`S` =^S`Ob]` c\[WbbSZPO` d]` SW\S[ =^S`O\ RS\ abSVS\ 2O\\ VOb Sa RWS 0SRScbc\U SW\Sa D]`hSWQVS\a ?a^VaP\\ 0aXcW\TcXZ$) 0aQTXcT] \Xc E^aiTXRWT] public class Arithmetik05 { public static void main(String args[]) byte z1 = -10; long z2 = -11; long erg = z1 + -z2; System.out.println(erg); } }
{
'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
8]ZaT\T]c3TZaT\T]c 4º` RWS /RRWbW]\ c\R AcPb`OYbW]\ UWPb Sa OPUSYº`hbS AQV`SWPeSWaS\ /cQV RWSaS S` T]`RS`\ \c` SW\S\ =^S`O\RS\ c\R eS`RS\ RSaVOZP SPS\TOZZa OZa c\É`S =^S`Ob]`S\ PShSWQV\Sb 3a VO\RSZb aWQV c[ ROa 7\Y`S[S\b W\Q`S[S\b S\UZ HceOQVa c\R ROa 2SY`S[S\b 2c`QV RS\ =^S`Ob]` eW`R RS` 7\VOZb SW\S` DO`WOPZS\ c[ S`VrVb 3W\ bg^WaQVSa 3W\aObhUSPWSb Wab RWS AQVZSWTS\PWZRc\U PSW RS` :OcTdO`WOPZS\ `OcT ]RS` `c\bS`UShÉVZb eS`RS\ aWSVS 9O^WbSZ &#! ?a^VaP\\ 8]ZaT\T]c ) 0aQTXcT] \Xc 8]ZaT\T]c class Inkrement01 { public static void main(String[] args) { int zahl = 0; zahl++; // Kurzschreibweise für: zahl = zahl + 1; System.out.println(zahl); } } 2S` /caR`cQY iPW[* Wab SW\S Y][^ZSbbS /\eSWac\U RS\\ S` eW`R OPUSaQVZ]aaS\ [Wb SW\S[ AS[WY]Z]\ 3` VOb RWSaSZPS EW`Yc\U eWS RWS SbeOa OcaTºV`ZWQVS`S /\eSW ac\U iPW[ , iPW[ * 2c`QV RS\ =^S`Ob]` eW`R RS` 7\VOZb SW\S` DO`WOPZS\ c[ `SRchWS`b ?a^VaP\\ 3TZaT\T]c ) 0aQTXcT] \Xc 3TZaT\T]c class Dekrement01 { public static void main(String[] args) { int zahl = 0; zahl--; // Kurzschreibweise für: zahl = zahl - 1; System.out.println(zahl); } } ?aT ^STa ?^bcUXg 0SW[ /`PSWbS\ [Wb 7\Y`S[S\b Phe 2SY`S[S\b=^S`Ob]`S\ Wab \]QV SW\S eWQVbWUS 0Sa]\RS`VSWb hc PSOQVbS\ 0SWRS =^S`Ob]`S\ Yr\\S\ a]e]VZ W\ >`ÉTWf OZa OcQV W\ RS` >]abTWf<]bObW]\ dS`eS\RSb eS`RS\( >`ÉTWf hOVZ hOVZ
>]abTWf hOVZ hOVZ
;O\ YO\\ OZa] RS\ =^S`Ob]` d]` ]RS` VW\bS` RS\ =^S`O\RS\ aQV`SWPS\ C\R RWS EW`Yc\U RWSaS` c\bS`aQVWSRZWQVS\ AQV`SWPeSWaS Wab OcQV c\bS`aQVWSRZWQV( 7\ RS` >`É
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&!
0aXcW\TcXbRWT >_TaPc^aT]
TWfDS`aW]\ eW`R RWS DO`WOPZS hcS`ab dS`É\RS`b c\R RO\\ PS\cbhb W\ RS` >]abTWf DS`aW]\ eW`R aWS S`ab PS\cbhb c\R RO\\ c[ []RWTWhWS`b >`OYbWaQVS /caeW`Yc\U VOb RWSaS C\bS`aQVSWRc\U \c` RO\\ eS\\ ROa 6]QVhÉVZS\ ]RS` @c\bS`hÉVZS\ W\ SW\S[ hcaO[[S\USaSbhbS\ /caR`cQY S`T]ZUb ?a^VaP\\ 3TZaT\T]c!) ?aÊUXg=^cPcX^] class Dekrement02 { public static void main(String[] args) { int a = 1; System.out.println(--a); } } ÎQd]VT] id\ ?a^VaP\\ 3TZaT\T]c! ÎQd]V ( Ò\RS`\ AWS ROa >`]U`O[[ 3TZaT\T]c!YPeP a] ROaa S`ab RS` OYbcSZZS DO `WOPZS\eS`b OcaUSUSPS\ c\R RO\OQV RWS @SQVS\]^S`ObW]\ OcaUSTºV`b eW`R ÎQd]V !( /\US\][[S\ AWS VOPS\ RS\ hcaO[[S\USaSbhbS\ /caR`cQY ( P RO\\ eW`R hcS`ab SW\S OcT RS\ ES`b RS` DO`WOPZS\ P ORRWS`b c\R S`ab RO\OQV RWS 2WdWaW]\ Rc`QVUSTºV`b 0WbbS bSabS\ AWS RWSaS /\eSWac\U [Wb RS[ >`]U`O[[ 3TZaT \T]c! ÎQd]V "( 2OUSUS\ eW`R W\ RS[ hcaO[[S\USaSbhbS\ /caR`cQY ' O hcS`ab RWS 2WdWaW]\ Rc`QVUSTºV`b c\R O\aQVZWSzS\R P c[ S`VrVb 0WbbS bSabS\ AWS RWSaS /\ eSWac\U [Wb RS[ >`]U`O[[ 3TZaT\T]c! c\R dS`UZSWQVS\ AWS RWS 3`USP\WaaS 2Oa T]ZUS\RS >`]U`O[[ RS[]\ab`WS`b SW\S ÉV\ZWQVS /cTUOPS\abSZZc\U 3a hSWUb \]QV SW\[OZ RWS /caeW`Yc\US\ RS` c\bS`aQVWSRZWQVS\ AQV`SWPeSWaS\ PSW[ 7\Y`S[S\bWS`S\ C\R d]` OZZS[ [OQVb Sa RScbZWQV ROaa RWSaS /caR`ºQYS aQVeS` dS`abÉ\RZWQV aW\R c\R RSaeSUS\ PSaaS` dS`[WSRS\ eS`RS\ a]ZZbS\ ?a^VaP\\ 8]ZaT\T]c!) 0dbSa¶RZT bRWfTa eTabcÊ]S[XRW ]XRWc T\_U^W[T] public class Inkrement02 { public static void main(String args[]) { int x = 1; int y = 7 * ++x; // Präfix, Erst erhöhen, dann rechnen System.out.println(y); int z = 7 * x++; // Postfix Erst rechnen, dann erhöhen. System.out.println(z); } }
0SWRS ;cZbW^ZWYObW]\S\ ZOcbS\ % RV W\ PSWRS\ 4ÉZZS\ Wab ROa 3`USP\Wa " B`]bh RS[ Wab RWS EW`Yc\U c\bS`aQVWSRZWQV
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
ÎQd]V id\ ?a^VaP\\ 8]ZaT\T]c! ÍPS`ZSUS\ AWS eSZQVS\ 7\VOZb RWS DO`WOPZS\ f O[ >`]U`O[[S\RS VOb ÍPS`^`ºTS\ AWS 7V`S ÍPS`ZSUc\U RORc`QV W\RS[ AWS ROa >`]U`O[[ c[ S\ba^`SQVS\RS /caUOPS O\eSWac\US\ S`UÉ\hS\ 1TXb_XT[ id\ =TQT]TUUTZc
2WS 7\Y`S[S\b Phe 2SY`S[S\b=^S`Ob]`S\ VOPS\ \]QV SW\S eSWbS`S 0Sa]\RS`VSWb( aWS PSeW`YS\ SW\S\ <SPS\STTSYb EÉV`S\R SW\ /caR`cQY \]`[OZS`eSWaS ZSRWUZWQV SW\S\ ES`b S`[WbbSZb OPS` YSW\S\ DO`WOPZS\eS`b dS`É\RS`b Sa aSW RS\\ [O\ PS\cbhb OcaR`ºQYZWQV RS\ =^S`Ob]` + Tº` SW\S ES`bShceSWac\U VOPS\ RWS PSa^`]QVS\S\ =^S`Ob]`S\ c\R SW\S heSWTOQVS /caeW`Yc\U( hc[ SW\S\ eW`R RORc`QV SW\ \ScS` ES`b S``SQV\Sb c\R OczS`RS[ a] UO\h \SPS\PSW OZa HcaObhSTTSYb RWSaS` ES`b OcQV RS` PSbSWZWUbS\ DO`WOPZS\ hcUSeWSaS\ ?a^VaP\\ 3TZaT\T]c") FXT fXaZc STa =TQT]TUUTZc- public class Dekrement03 { public static void main(String args[]) int a = 0; System.out.println(a + 1); System.out.println(a++); } }
{
ÎQd]V id\ ?a^VaP\\ 3TZaT\T]c" ÍPS`ZSUS\ AWS ]P c\R eWS RS` 7\VOZb RS` DO`WOPZS\ O aWQV hc` >`]U`O[[ZOcThSWb dS` É\RS`b DS`WTWhWS`S\ AWS RWSa Rc`QV SW\S\ hcaÉbhZWQVS\ /caUOPSPSTSVZ
6XUHRKSKHKOS8KINTKTSOZVXOSOZO\KT*GZKTZ_VKT 2S` 0SU`WTT ^`W[WbWdS 2ObS\bg^S\ PSRScbSb SWUS\bZWQV \WQVb ROaa RWSaS Bg^S\ eS\WU Y][T]`bOPSZ aW\R a]\RS`\ S` a]ZZ OcaR`ºQYS\ ROaa Sa aWQV c[ RWS 0OaWabg^S\ SW\S` >`]U`O[[WS`a^`OQVS VO\RSZb c\R ROaa aWS SZS[S\bO`S Bg^S\ aW\R RWS \WQVb eSWbS` c\bS`bSWZb eS`RS\ Yr\\S\ /PS` PSW[ @SQV\S\ [Wb RS\ SW\USPOcbS\ Bg^S\ aW\R SW\WUS @Sab`WYbW]\S\ hc PSOQV bS\ RWS ROhc TºV`S\ Yr\\S\ ROaa RWSaS ^`W[WbWdS\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OZaQVS 0SWa^WSZS UShSWUb OPS` AWS eS`RS\ d]` OZZS[ OcQV RWS Y]``SYbS\ :rac\US\ YS\\S\ ZS`\S\ 3W\S eWQVbWUS @SUSZ UO\h hc /\TO\U( 2S` >`]U`O[[WS`S` a]ZZbS Tº` [ObVS[ObWaQVS 0S`SQV\c\US\ [Wb ES`bO\UOPS\ W\ EÉV`c\US\ h0 3c`]0Sb`ÉUS\ W[ HeSWTSZ RWS [WbUSZWSTS`bS 9ZOaaS 1XV3TRX\P[ PS \cbhS\ c\R \WQVb [Wb ^`W[WbWdS\ 2ObS\bg^S\ O`PSWbS\ `]U`O[[ a]ZZ ROa 3`USP\Wa Oca ! [cZbW^ZWhWS`b [Wb ! S``SQV\S\ c\R OcaUSPS\ ?a^VaP\\ 0aXcW\TcXZ%) ETabdRW [TXSTa Xbc SPb 4aVTQ]Xb UP[bRW public class Arithmetik06 { public static void main(String args[]) double d2 = 1/3 * 3; System.out.println(d2); } }
{
/Za 3`USP\Wa eW`R OcaUSUSPS\ EO`c[- 2WS 5`c\R Wab( 2S` /caR`cQY eW`R d]\ ZW\Ya \OQV `SQVba SdOZcWS`b 2S` BSWZOcaR`cQY ! PSabSVb Oca 7\bSUS`eS`bS\ RSa eSUS\ Wab ROa 3`USP\Wa RWS 5O\hhOVZ C\R [cZbW^ZWhWS`b [Wb ! S`UWPb 2Oa \ÉQVabS >`]U`O[[ hSWUb SW\S [rUZWQVS :rac\U RWSaSa >`]PZS[a 8Sbhb aW\R OcQV RWS HeWaQVS\S`USP\WaaS Y]``SYb eSWZ RWS =^S`O\RS\ RSa /caR`cQYa RS\ Y]``SYbS\ 2ObS\bg^ VOPS\ ?a^VaP\\ 0aXcW\TcXZ&) ! ETabdRW YTcic Xbc P[[Tb aXRWcXV public class Arithmetik07 { public static void main(String args[])
{ !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
double d3 = 1d / 3d * 3; System.out.println(d3); } } ÎQd]V id\ ?a^VaP\\ 0aXcW\TcXZ& ÍPS`^`ºTS\ AWS ]P ROa `WQVbWUS 3`USP\Wa OcQV hc S`hWSZS\ Wab Rc`QV T]ZUS\RS /\eSW ac\U( S^dQ[T S" , " "* - &!"! ÎQTa[PdU?a^Q[T\T 3W\ eSWbS`Sa >`]PZS[ YO\\ S\babSVS\ eS\\ ROa 3`USP\Wa SW\S` O`WbV[SbWaQVS\ =^S `ObW]\ [Wb 7\bSUS`eS`bS\ hc U`]z Wab Tº` RS\ USeÉVZbS\ 2ObS\bg^ 2O\\ Y][[b Sa hc[ ÍPS`ZOcT d]\ 7\bSUS`ES`bS\ ?a^VaP\\ 0aXcW\TcXZ')
{
2Oaa W\ RWSaS[ 4OZZ RS` 1][^WZS` YSW\S EO`\c\U UWPb ]RS` a^ÉbSabS\a hc` @c\BW[S SW\ ÍPS`ZOcT4SVZS` US[SZRSb eW`R Wab SW\S ^`]PZS[ObWaQVS AQVeÉQVS W\ 8OdO 3a ZWSUb OZa] W\ RS` DS`O\be]`bc\U RSa >`]U`O[[WS`S`a ROTº` hc a]`US\ ROaa Oca`SW QVS\R A^SWQVS`^ZObh Tº` HeWaQVS\S`USP\WaaS c\R Tº` 3`USP\WadO`WOPZS\ hc` DS`Tº Uc\U abSVb ÎQd]V id\ ?a^VaP\\ 0aXcW\TcXZ' EWS [caa ROa >`]U`O[[ USÉ\RS`b eS`RS\ RO[Wb ROa 3`USP\Wa Y]``SYb Wab- 5WPb Sa SW\S\ ^`W[WbWdS\ 2ObS\bg^ RSaaS\ ES`bSPS`SWQV U`]z US\cU Wab- :rac\UaVW\eSWa( DS`acQVS\ AWS Sa [Wb [^]V `]U`O[[ RS[]\ab`WS`b eS`RS\ ?a^VaP\\ 0aXcW\TcXZ() ÎQTa[PdU QTX 8]cTVTach_T] public class Arithmetik09 { public static void main(String args[]) long z1 = Long.MAX_VALUE; long z2 = Long.MAX_VALUE; System.out.println(z1);
{
"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&!
0aXcW\TcXbRWT >_TaPc^aT]
System.out.println(z2); System.out.println(z1 * z2); } } 2WS SW\USPOcbS 9]\abO\bS ;^]V<0GNE0;D4 S\bVÉZb RS\ VrQVabS\ ES`b RS\ SW\S DO`WOPZS d][ Bg^ [^]V OcT\SV[S\ YO\\ ES\\ PSWRS 6rQVabeS`bS [cZbW^ZWhWS`b eS` RS\ `SWQVb \Obº`ZWQV RS` >ZObh Tº` ROa HeWaQVS\S`USP\Wa d][ Bg^ [^]V \WQVb Oca ;»bd]V) 0aQTXcT] \Xc :[PbbT] P]bcT[[T e^] _aX\XcXeT] 3PcT]ch_T] ES\\ [Wb HOVZS\ RWSaS` 5`rzS\]`R\c\U USO`PSWbSb eS`RS\ [caa PZSWPb \c` RWS SW\S ;rUZWQVYSWb( [O\ [caa RS\ 9ZOaaS\bg^ 1XV8]cTVTa dS`eS\RS\ 7\abO\hS\ S`hScUS\ c\R ;SbV]RS\ OcT`cTS\ ?a^VaP\\ 0aXcW\TcXZ ) 2[Pbb 1XV8]cTVTa P]bcT[[T e^] [^]VCh_T] import java.math.*; public class Arithmetik10 { public static void main(String args[]) { BigInteger z1 = new BigInteger("1234567890123456"); BigInteger z2 = new BigInteger("9876543210987654"); System.out.println(z1.multiply(z2)); } } &!"" FPad\ VXQc Tb d]eTabcÊ]S[XRWT 4aVTQ]XbbT QTX\ ÎQTa[PdU. 2Oa T]ZUS\RS >`]U`O[[ Wab Tº` RS\ <ScSW\abSWUS` \WQVb c\PSRW\Ub eWQVbWU /PS` Sa RS[]\ab`WS`b eWS RWS W\bS`\S\ /PZÉcTS PSW RS` /`WbV[SbWY aW\R c\R ZWSTS`b 3`YS\\b \WaaS Tº` RWS 7\bS`^`SbObW]\ d]\ Y`g^bWaQVS\ 3`USP\WaaS\ 2WSaS 7\T]`[ObW]\S\ Yr\\S\ OcQV hc[ `]U`O[[ DTQTa[PdU ZWSTS`b OZa 3`USP\Wa RS` /RRWbW]\ RS` PSWRS\ HOVZS\ ;WZZW]\S\ c\R & ;WZZW]\S\ "'"'$% '$ 2WS C`aOQVS ROTº` Wab ROaa ROa 3`USP\Wa hc U`]aa Wab Tº` RWS ! PWb SW\S` 7\bSUS`dO`WOPZS\ /PS` e]VS` Y][[b RWSaS aSZbaO[S HOVZ RWS hcaÉbhZWQV OcQV \]QV \SUObWd Wab- ?a^VaP\\ DTQTa[PdU ) 4aVTQ]Xb _Pbbc ]XRWc X] " QXcb 8]cTVTach_
public class Ueberlauf01 { public static void main(String args[]) int z1 = 2000000000; int z2 = 1800000000; System.out.println(z1 + z2); } }
{
#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
2O[Wb RWS W\bS`\S\ /`PSWbad]`UÉ\US dS`abO\RS\ eS`RS\ Yr\\S\ [caa [O\ hc\ÉQVab eWaaS\ eWS \SUObWdS 5O\hhOVZS\ d]\ 8OdO RO`USabSZZb eS`RS\ 2Oa VrQVabeS`bWUS 0Wb `S^`ÉaS\bWS`b ROa D]`hSWQVS\ + ^]aWbWd + \SUObWd HcaÉbhZWQV eW`R SW\ DS`TOV`S\ SW\USaSbhb ROa aWQV IfTXTaZ^\_[T\T]c \S\\b 2OPSW eS`RS\ \SUObWdS HOVZS\ a] USa^SWQVS`b ROaa Oca bSQV\WaQVS\ 5`º\RS\ hc\ÉQVab RWS 0Wba W\dS`bWS`b eS`RS\ RV Oca eW`R c\R Oca eW`R c\R RO\\ eW`R \]QV SW\S ORRWS`b 0SWa^WSZ ( 2WS _^bXcXeT 2ShW[OZhOVZ eW`R PW\É` W\ SW\S` X]cDO`WOPZS\ eWS T]ZUb RO`USabSZZb(
0SWa^WSZ ( C[ SW\S ]TVPcXeT [rUZWQVab STTWhWS\b hc a^SWQVS`\ c\R dS`O`PSWbS\ hc Yr\\S\ ^OaaWS`b T]ZUS\RSa( W\dS`a( 3`USP\Wa(
/Za]( HeSWS`Y][^ZS[S\b + 3W\S`Y][^ZS[S\b ÍPS`b`OUS\ OcT ROa 0SWa^WSZ^`]U`O[[ DTQTa[PdU PSRScbSb ROa(
2ShW[OZ(
VSfORShW[OZ
%% !# '" & $P "' R + !& S %T $$
`SW\ PW\É`
2Oa VrQVabeS`bWUS 0Wb Wab RO[Wb eW`R ROa 3`USP\Wa OZa \SUObWdS` ES`b W\bS`^`SbWS`b 4º` RWS /caUOPS eW`R XSbhb RWS 1]RWS`c\U `ºQYUÉ\UWU US[OQVb Sa eW`R SW\S acP b`OVWS`b c\R RO\\ RWS 7\dS`aW]\ hc`ºQYUS\][[S\( 3`USP\Wa Wab( + C[YSV`c\U RS` PWba(
C\R RWSaS 0WbY][PW\ObW]\ `S^`ÉaS\bWS`b RWS 2ShW[OZhOVZ "'"'$% '$ &!"# D]VT]PdXVZTXcT] QTX 6[TXcZ^\\PIPW[T] 3W\ PSa]\RS`a VSWYZSa BVS[O YO\\ S\babSVS\ PSW[ @SQV\S\ [Wb 5ZSWbY][[OhOVZS\ 2S\\ c\bS` PSabW[[bS\ C[abÉ\RS\ Y][[b Sa hc C\US\OcWUYSWbS\ 2S` 5`c\R ROTº` Wab RS` ESQVaSZ RSa AbSZZS\eS`bagabS[a FXRWcXVT ATVT[] U¶a SPb 0aQTXcT] \Xc 6[TXcZ^\\PIPW[T] <WQVb OZZS 2ShW[OZhOVZS\ Yr\\S\ W[ A^SWQVS` SfOYb `S^`ÉaS\bWS`b eS`RS\ ESWZ R]`b \c` SW\S PSU`S\hbS AbSZZS\O\hOVZ hc` DS`TºUc\U abSVb Yr\\S\ \c` <ÉVS`c\UaeS`bS USa^SWQVS`b eS`RS\ W\aPSa]\RS`S PSW ^S`W]RWaQVS\ HOVZS\ $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&!
0aXcW\TcXbRWT >_TaPc^aT]
EO`c[ Wab ROa a]- C\aS` HOVZS\agabS[ POaWS`b OcT RS[ AbSZZS\eS`b 2ShW[OZaga bS[ 5ZSWbY][[OeS`bS W[ @SQV\S` eS`RS\ OZa `SW\ PW\É`S HOVZS\ Q]RWS`b [Wb RS[ AbSZZS\eS`b 2Oa ROPSW S\babSVS\RS >`]PZS[( \WQVb XSRS` HSV\S`P`cQV Wab SfOYb W[ 2cOZagabS[ RO`abSZZPO` Hc[ 0SWa^WSZ VOb RWS 2ShW[OZhOVZ W\ RS` HeSWS`RO`abSZ Zc\U SW\ c\S\RZWQVSa 3`USP\Wa \É[ZWQV DS`abÉ\RZWQV eW`R RWSa eS\\ [O\ PS`ºQYaWQVbWUb ROaa RWS AbSZZS\eS`bWUYSWb \Obº`ZWQV \WQVb \c` e^a RS[ 9][[O UWZb a]\RS`\ aWQV `SQVba d][ 9][[O T]`baSbhb 8S eSWbS` `SQVba SW\S HWTTS` abSVb c[a] YZSW\S` eW`R WV` AbSZZS\eS`b W[ 2ShW[OZagabS[ RO\\ cae W[ 2cOZagabS[ RO\\ " & cae 6WS` SW\S 5SUS\ºPS`abSZZc\U Tº` RWS AbSZZS\eS` bWUYSWb RS` >]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` YOcT[É\\WaQV `c\RS\ ROa VSWzb eS\\ RS`
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&!
0aXcW\TcXbRWT >_TaPc^aT]
?a^VaP\\
1XV3TRX\P[!) IfTX STa \»V[XRWT] Ad]ST]bPacT]
import java.math.BigDecimal; class BigDecimal02 { static public void main(String[] args) { BigDecimal d1 = new BigDecimal(0.17); BigDecimal d2 = new BigDecimal(0.000001); BigDecimal d3 = new BigDecimal(0.0); d3 = d1.divide(d2, 2, BigDecimal.ROUND_HALF_UP); System.out.printf("%s\n", d3); System.out.println(d3); // Alternative Ausgabe // Multiplizieren d3 = d1.multiply(d2); // Anschließend runden BigDecimal d4 = d3.setScale(2, BigDecimal.ROUND_UP); // Ergebnis ausgeben System.out.printf("%s", d4); } } 2Oa T]ZUS\RS >`]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\
;Wb SW\S[ DS`UZSWQVa]^S`Ob]` `SZObW]\OZS[ =^S`Ob]` Yr\\S\ DS`UZSWQVS heWaQVS\ heSW ES`bS\ Rc`QVUSTºV`b eS`RS\ 2Oa 3`USP\Wa Wab SW\ P]]ZSaQVS` ES`b cadT ]RS` UP[bT ?a^VaP\\ ETaV[TXRW ) IfTX IPW[T]fTacT eTaV[TXRWT] public class Vergleich01 { public static void main(String[] args) { int z1 = 10; int z2 = 15; System.out.println(z1 < z2); } } 2Oa 3`USP\Wa RWSaSa DS`UZSWQVa Wab \Obº`ZWQV cadT /\RS`S DS`UZSWQVa]^S`Ob]`S\ aW\R( * U`rzS` * YZSW\S` ++ UZSWQV + c\UZSWQV \WQVb UZSWQV ÎQd]V id\ ?a^VaP\\ ETaV[TXRW ÎQd]V ( ;OQVS\ AWS SW\S RS` PSWRS\ HOVZS\ \SUObWd EWS ZOcbSb RO\\ ROa 3`USP\Wa- ÎQd]V !( DO`WWS`S\ AWS RWS BSaba c\R O`PSWbS\ AWS [Wb PSZWSPWUS\ O\RS`S\ DS` UZSWQVa]^S`Ob]`S\ !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
2Oa \ÉQVabS 0SWa^WSZ dS`UZSWQVb RWS ES`bS d]\ heSW RWPaDO`WOPZS\ OcT UZSWQV c\R c\UZSWQV ?a^VaP\\ ETaV[TXRW!) RWPaEPaXPQ[T] eTaV[TXRWT] public class Vergleich02 { public static void main(String[] args) { char z1 = 'a'; char z2 = 'b'; System.out.println(z1 != z2); System.out.println(z1 == z2); } } 2S` =^S`Ob]` Tº` ROa >`ºTS\ OcT 5ZSWQVVSWb Wab ROa R]^^SZbS 5ZSWQVVSWbahSWQVS\ ++ 2WSa Wab SW\S aSV` PSZWSPbS 4SVZS`_cSZZS 6ÉcTWU eW`R RWSaS` =^S`Ob]` dS`eSQVaSZb [Wb RS[ SW\TOQVS\ 5ZSWQVVSWbahSWQVS\ ROa Wab OPS` RS` HceSWac\Ua]^S`Ob]` 2Oa T]ZUS\RS 0SWa^WSZ S\bVÉZb SW\S\ 4SVZS` 2WS /cTUOPS RSa >`]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<2DS`Y\º^Tc\U Z]UWaQVS =23@DS`Y\º^Tc\U SW\aQVZWSzS\RSa =@ + heSW aS\Y`SQVbS Ab`WQVS Z]UWaQVS DS`\SW\c\U + /ca`cTc\UahSWQVS\ Z]UWaQVS =23@DS`Y\º^Tc\U OcaaQVZWSzS\RSa =@
?a^VaP\\ ;^VXZ ) ?a¶Ud]V ^Q FTac STa EPaXPQ[T] g ifXbRWT] d]S [XTVc class Logik01 { public static void main(String[] args) { int x = 7; System.out.println(x > 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 x<10 XSeSWZa Tº` aWQV cadT aW\R c\R RO[Wb RWS DS`Y\º^Tc\U Rc`QV ROa Z]UWaQVS C<2 OcQV cadT S`UWPb ÎQd]V id\ ?a^VaP\\ ;^VXZ 0WbbS ºPS`ZSUS\ AWS eWSdWSZ BSabTÉZZS AWS PS\rbWUS\ c[ aWQVS`hcabSZZS\ ROaa ROa >`]U`O[[ OcQV eW`YZWQV TSVZS`T`SW Wab c\bS` BSabTOZZ Wab SW\ ES`b d]\ f hc dS`abS VS\ !"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&# ;^VXbRWT >_TaPc^aT]
:rac\UaVW\eSWaS 3a a]ZZbS [W\RSabS\a [Wb T]ZUS\RS\ fES`bS\ USbSabSb eS`RS\( 3W\ \]`[OZS` ES`b RS` heWaQVS\ c\R ' ZWSUb h0 # + cadT 2O\\ a]ZZbS\ c\PSRW\Ub RWS PSWRS\ 5`S\heS`bS USbSabSb eS`RS\ c\R heO` SW\[OZ a] ROaa ROa 3`USP\Wa cadT ZWSTS`b OZa] h0 c\R ' c\R OcQV a] ROaa ROa 3`USP\Wa UP[bT ZWSTS`b OZa] h0 c\R IdbP\\T]UPbbd]V
2WS Z]UWaQVS\ =^S`Ob]`S\ eS`RS\ PS\cbhb c[ BSWZOcaaOUS\ h0 SW\hSZ\S DS`UZSW QVS hc dS`Y\º^TS\ 2WS =^S`Ob]`S\ Yr\\S\ RW`SYb OZa P]]ZSaQVS ES`bS O\USUSPS\ aSW\(
(a && b)
]RS` OZa DS`UZSWQVS Q]RWS`b eS`RS\ RWS P]]ZSaQVS ES`bS ZWSTS`\(
(x>5) && (y<3).
2Oa 3`USP\Wa Wab Tº` RWS USaO[bS /caaOUS SW\ SW\hSZ\Sa cadT ]RS` UP[bT
'[YYGMKTRUMOQ 2Oa 0W\É`agabS[ RS` VScbWUS\ @SQV\S` Wab RWS WRSOZS 5`c\RZOUS \WQVb \c` Tº` ROa /` PSWbS\ [Wb \c[S`WaQVS\ ES`bS\ a]\RS`\ OcQV Tº` ROa :raS\ d]\ Z]UWaQVS\ >`]PZS [S\ PSW RS\S\ [Wb /caaOUS\ USO`PSWbSb eW`R RWS S\beSRS` eOV` ]RS` TOZaQV aW\R 2WS 0S`SWQVS RS` T]`[OZS\ heSWeS`bWUS\ :]UWY h0 RWS 0]]ZSaQVS /ZUSP`O RWS /caaOUS\Z]UWY c\R RWS >`ÉRWYObS\Z]UWY aW\R EWaaS\aQVOTbS\ RWS aWQV [Wb RS\ @S USZ\ PSTOaaS\ Tº` RWS T]`[OZS @WQVbWUYSWb PSW RS` DS`Y\º^Tc\U d]\ /caaOUS\ 2WS /caaOUS\Z]UWY USVb d]\ PS`SWba TSabUSabSZZbS\ 3W\hSZbObaOQVS\ Oca 2WSaS eS`RS\ /caaOUS\ US\O\\b c\R Sa UWZb RS` Tc\RO[S\bOZS 5`c\RaObh( 3W\S /caaOUS P Wab eOV` ]RS` TOZaQV SbeOa 2`WbbSa UWPb Sa \WQVb 2WS /caaOUS\ Yr\\S\ Rc`QV 8c\Yb]`S\ dS` Y\º^Tb eS`RS\ a] ROaa Z]UWaQVS 4]`[SZ\ S\babSVS\ 0SW RS` DS`Y\º^Tc\U d]\ /caaOUS\ P c\R Q UWPb Sa bVS]`SbWaQV $ ;rUZWQVYSWbS\ Tº` @SUSZTSabZSUc\US\ 0SU`º\Rc\U( ES\\ [O\ aWQV RWS dS`Y\º^TbS /caaOUS OZa 0ZOQY0]f d]`abSZZb RWS heSW 3W\UÉ\US + \É[ZWQV RWS heSW /caaOUS\ VOb c\R eW` OPVÉ\UWU d]\ RS[ 7\^cb RWSaS` heSW 3W\UÉ\US RS\ /caUO\UaeS`b PSabW[[S\ d]`VS`aOUS\ e]ZZS\ RO\\ [ºaaS\ eW` d]\ " c\bS`aQVWSRZWQVS\ 3W\UO\UaY][PW\ObW]\S\ OcaUSVS\ c\R XSRS 3W\UO\UaY][PW\ObW]\ YO\\ OZa DS`O`PSWbc\Ua`SUSZ RS` 0ZOQY0]f ROhc TºV`S\ ROaa XS \OQVRS[ eOa USeº\aQVb eW`R RS` /caUO\U [Wb fPWa ]RS` UP[bRW USTºbbS`b eW`R 0SWa^WSZ( /caUSUO\US\ eW`R d]\ T]ZUS\RS\ heSW /caaOUS\( 9ZOca `OcQVbO >SbS` `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` ]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S\RS =23@
2WS BOPSZZS /PP %! S\bVÉZb SW\S\ ÍPS`PZWQY ºPS` RWS EOV`VSWbeS`bS RS` 0]]ZS aQVS\ /ZUSP`O S`UÉ\hb c[ RWS SfYZcaWd=23@DS`PW\Rc\U F=@ 2OPSW abSVb e Tº` eOV`b`cS c\R T Tº` TOZaQVTOZaS C<2 /caaOUS /caaOUS DS`PW\Rc\U P O
W\QZ =23@ DS`PW\Rc\U jj
SfQZ =23@ F=@ L
e
e
e
e
T
e
T
T
e
e
T
e
T
e
e
T
T
T
T
T
/PP %!( BOTSZ RS` EOV`VSWbaeS`bS Tº` PW\É`S DS`Y\º^Tc\US\ /czS`RS[ YS\\b 8OdO SW\S\ =^S`Ob]` RWS <SUObW]\ Tº` SW\S d]ÊaT ETaZ]¶_Ud]V 3W\S c\É`S DS`Y\º^Tc\U [OQVb Oca SW\S` /caaOUS SW\S \ScS /caaOUS •
/ca`cTc\UahSWQVS\ Tº` RWS <SUObW]\ RV Tº` RWS C[YSV`c\U RSa EOV` VSWbaeS`bSa
!%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
ÎQd]V U¶a QX]ÊaT ETaZ]¶_Ud]VT] 2Oa >`]U`O[[ ;^VXZ! a]ZZ RWS T]ZUS\RS /cTUOPS ZraS\( 4º` OZZS ES`bS RWS heW aQVS\ c\R &' ZWSUS\ a]ZZ ROa >`]U`O[[ cadT ZWSTS`\ ;»bd]Vbe^abRW[PV) ?a^VaP\\ ;^VXZ!
FTacTQTaTXRWT PQUaPVT] class Logik02 { public static void main(String[] args) { int x = 85; boolean richtigeZahl = ((x>0 && x<10) || (x>80 && x<90)); System.out.println(richtigeZahl); } }
2WS 5SaO[bOcaaOUS RSa /caR`cQYa Wab eOV` eS\\ RS` ES`b RS` DO`WOPZS\ f heW aQVS\ c\R ^STa heWaQVS\ & c\R ' ZWSUb 6WS` hSWUb aWQV ROaa c[UO\Uaa^`OQV ZWQV RWS 0SU`WTTS d]S Phe ^STa [O\QV[OZ SbeOa c\aQVO`T PS\cbhb eS`RS\ 7\ RS` ab`S\US\ :]UWY RS` 0]]ZSaQVS\ /ZUSP`O [caa Sa W\ RWSaS[ 4OZZ RWS =RS`DS`PW\Rc\U aSW\ ]Pe]VZ ZOcb /cTUOPS\abSZZc\U OZZS ES`bS USacQVb eS`RS\ RWS heWaQVS\ c\R d]S heWaQVS\ & c\R ' ZWSUS\ ÎQd]V id\ ?a^VaP\\ ;^VXZ! 9O\\ abObb RSa =^S`Ob]`a Tº` ROa SW\aQVZWSzS\RS =RS` OcQV RS` =^S`Ob]` Tº` ROa OcaaQVZWSzS\RS =RS` SW\USaSbhb eS`RS\- 0WbbS É\RS`\ AWS ROa >`]U`O[[ c\R bSabS\ AWS ROa 3`USP\Wa ÎQd]V U¶a d]ÊaT ETaZ]¶_Ud]V =TVPcX^] 1]RWS`S\ AWS SW\ >`]U`O[[ ROa T]ZUS\RS /cTUOPS Zrab( 3a a]ZZ US^`ºTb eS`RS\ ]P SW\ ES`b f ]XRWc heWaQVS\ ]RS` \WQVb heWaQVS\ &' ZWSUb ;»bd]Vbe^abRW[PV) ?a^VaP\\ ;^VXZ"
FTacTQTaTXRW PdbbRW[XTvT] class Logik03 { public static void main(String[] args) { int x = 85; boolean richtigeZahl = !((x>0 && x<10) || (x>80 && x<90)); System.out.println(richtigeZahl); } }
2WS SW\hWUS Ò\RS`c\U RWS \]beS\RWU Wab W[ DS`UZSWQV hc[ >`]U`O[[ ;^VXZ! Wab RWS C[YSV`c\U RSa EOV`VSWbaeS`bSa RS` 5SaO[bOcaaOUS c\R RWSa S`T]ZUb Rc`QV 1]RWS`c\U RSa <=B=^S`Ob]`a /ca`cTc\UahSWQVS\ \WQVb hc dS`eSQVaSZ\ [Wb RS[ SW\TOQVS\ aS\Y`SQVbS\ Ab`WQV !&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&# ;^VXbRWT >_TaPc^aT]
2WS <SUObW]\ W\ Y][^ZSfS\ 0SRW\Uc\US\ Wab [O\QV[OZ aQVeS` dS`abÉ\RZWQV 3W\ 0SWa^WSZ Wab T]ZUS\RS @SUSZ( ES\\ OcT SW\S[ 4ZcUbWQYSb \WQVb SW\ / ]RS` SW\ 0 abSVb c\R eS\\ ROa 2Obc[ \WQVb ]RS` Wab RO\\ Wab RS` 4ZcU \WQVb USQO\QSZb EWS PWbbS- EO\\ TW\RSb RS` 4ZcU abObb- ?a^VaP\\ 0dbSadRZ") =TVXTacT CTX[PdbbPVT] eTaZ]¶_UT] class Ausdruck03 { public static void main(String[] args) { char ticket = 'C'; int datum = 13; if (!(ticket == 'A') || !(ticket == 'B') && (datum == 11 || datum == 12)) System.out.println("Kein Flug"); else System.out.println("Flug"); } } 3W\S D\U^a\d[XTad]V W\ SW\S ^]aWbWdS /caaOUS [OQVb ROa >`]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 <^aVP]bRWTATVT[( Oca ((not (a or b) eW`R Oca (not (a and b)) eW`R
((not a) and (not b)) Phe ((not a) or (not)). !'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
;^VXZPdUVPQT Hc` DS`bWSTc\U RSa BVS[Oa /`PSWbS\ [Wb Z]UWaQVS\ =^S`Ob]`S\ eS`RS\ AWS XSbhb SW\ Y][^ZSbbSa 0SWa^WSZ ZraS\ 2WS 0dUVPQT]bcT[[d]V Wab eWS T]ZUb( 8cZWO ^ZO\b WV`S >O`bg 2WSaS a]ZZ OPS` \c` abObbTW\RS\ eS\\ T]ZUS\RS 0SRW\Uc\US\ S`TºZZb aW\R( ES\\ /\R`SOa / Y][[b RO\\ [caa OcQV 0S`\R0 Y][[S\ 3\beSRS` Y][[S\ /\R`SOa/ c\R 1V`WabWO\1 ]RS` Sa Y][[b YSW\S` d]\ PSW RS\ ! 3\beSRS` Y][[b 0S`\R ]RS` 1V`WabWO\ 2WS >O`bg TW\RSb \c` abObb eS\\ OZZS R`SW 0SRW\Uc\US\ S`TºZZb aW\R 2Oa VSWzb RWS R`SW BSWZ/caaOUS\ [ºaaS\ eOV` aSW\ RO[Wb RWS 5SaO[bOcaaOUS eOV` Wab 0WbbS T]` [cZWS`S\ AWS RS\ /caR`cQY c\R Q]RWS`S\ AWS O\aQVZWSzS\R SW\ 8OdO>`]U`O[[ ROa RWSaS /cTUOPS Zrab :rac\UaVW\eSWa( 3a a]ZZ ZSRWUZWQV [Wb RS\ Z]UWaQVS\ =^S`Ob]`S\ C<2 =23@ c\R <716B USO`PSWbSb eS`RS\ ;»bd]Vbe^abRW[PV U¶a SXT U^a\P[T 1TbRWaTXQd]V STa 1TSX]Vd]VT]) BSWZOcaaOUS( <716B/ =23@ / C<2 0 BSWZOcaaOUS( / C<2 1 =23@ <716B/ C<2 <716B1 ! BSWZOcaaOUS( 0 C<2 <716B1 =23@ <716B0 C<2 1 ?a^VaP\\ ;^VXZ#) ;»bd]V R^SXTac X] 9PeP class Logik04 { public static void main(String[] args) { boolean andreas = true; // Andreas kommt boolean bernd = false; // Bernd kommt nicht boolean christian = true; // Christian kommt boolean party = ((!andreas || andreas && bernd)) && ((andreas && christian) || (!andreas && !christian)) && ((bernd && !christian) || (!bernd && christian)); System.out.println(party); } }
2Oa 3`USP\Wa Wab UP[bT RVRWS >O`bg TW\RSb \WQVb abObb RS\\ PS`SWba RWS S`abS BSWZOca aOUS Wab \WQVb S`TºZZb EWQVbWU Tº` RWS 4]`[cZWS`c\U RS` :rac\U W\ 8OdO Wab ROaa RWS >`W]`WbÉb RS` =^S`Ob]`S\ PSYO\\b Wab( <=B OZa c\É`S` =^S`Ob]` PSaWbhb RWS VrQVabS >`W]`WbÉb RO\OQV UWZb RWS CD=@SUSZ( D\R e]` >RS` 2WS R`W\US\RS 3[^TSVZc\U Wab W[[S` 9ZO[[S`\ hc aSbhS\ 2O[Wb eS`RS\ SdS\bcSZ ZS C\aWQVS`VSWbS\ OcaUSaQVZ]aaS\ c\R RWS :SaPO`YSWb d]\ /caaOUS\ PSa]\RS`a W\ RWSaS` 9][^ZSfWbÉb SW\RScbWU dS`PSaaS`b "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&# ;^VXbRWT >_TaPc^aT]
ÎQd]V id\ ?a^VaP\\ ;^VXZ# 0WbbS É\RS`\ AWS RWS 0]]ZSO\ES`bS a] ROaa RWS >O`bg abObbTW\RS\ YO\\ :rac\Ua VW\eSWa( 8cZWO [rQVbS [Wb 0S`\R OZZSW\ aSW\ RV RWS PSWRS\ O\RS`S\ [ºaaS\ UP[bT PSY][[S\ :daibRW[dbb0dbfTacd]V BW^ac2XaRdXc4eP[dPcX^] 2WS Z]UWaQVS\ =^S`Ob]`S\ /<2 c\R jj =@ eS`RS\ OcQV OZa AV]`b1W`QcWb 3dOZcObW]\=^S`Ob]`S\ PShSWQV\Sb RS\\ RS` /caR`cQY eW`R \c` a]ZO\US OcaUSeS` bSb PWa ROa 3`USP\Wa SW\RScbWU TSababSVb 2WS 0S`SQV\c\U eW`R a]T]`b PSS\RSb eS\\ YZO` Wab eSZQVS` Z]UWaQVS ES`b aWQV S`UWPb A] YO\\ Sa ^OaaWS`S\ ROaa SW\ `SQVba abS VS\RS` BSWZOcaR`cQY \WQVb [SV` OcaUSeS`bSb eW`R eSWZ S` Tº` ROa 5SaO[bS`USP\Wa YSW\S 0SRScbc\U [SV` VOb 0SWa^WSZ( ES\\ PSW DS`Y\º^Tc\U TX] BSWZOcaR`cQY UP[bT ZWSTS`b \dbb RS` 5SaO[bOcaR`cQY OcQV UP[bT eS`RS\ SUOZ eOa \]QV O\ eSWbS `S\ BSWZOcaR`ºQYS\ T]ZUb 7[ 5SUS\aObh hc RWSaS` /`PSWbaeSWaS UWPb Sa W\ 8OdO \]QV RWS T]ZUS\RS\ Z]UWaQVS\ =^S`Ob]`S\ RWS W[[S` c\R W\ XSRS[ 4OZZ RS\ USaO[bS\ /caR`cQY OcaeS`bS\( • •
+ ROa SW\TOQVS c\R \WQVb R]^^SZbS /[^S`aO\R Tº` RWS C<2DS`Y\º^Tc\U j + RS` SW\TOQVS c\R \WQVb R]^^SZbS Ab`WQV Tº` RWS =23@DS`PW\Rc\U
2WSaS PSWRS\ =^S`Ob]`S\ eS`RS\ OcQV OZa \]\A13 \WQVbAV]`b1W`QcWb3dOZcObW]\ =^S`Ob]`S\ PShSWQV\Sb eSWZ RWS 3dOZcWS`c\U RSa /caR`cQYa \WQVb OPUSP`]QVS\ eW`R OcQV eS\\ RWS eSWbS`S /caeS`bc\U YSW\S @]ZZS [SV` Tº` ROa 5SaO[bS`USP\Wa VOb 2WSaS /`b RS` 3dOZcWS`c\U Wab \Obº`ZWQV OcTeÉ\RWUS` OZa RWS \]`[OZS\ Z]UWaQVS\ /caR`ºQYS EO`c[ YO\\ Sa b`]bhRS[ aW\\d]ZZ aSW\ [Wb RWSaS\ =^S`Ob]`S\ hc O`PSW bS\- ?a^VaP\\ BRT ) BW^ac2dc4eP[dPcX^] B24 \Xc D=3>_TaPc^a public class Sce01 { public static void main(String args[]) boolean b1 = false; long z2 = 11; System.out.println(b1 && z2++ > 5); System.out.println(z2); } }
{
/Za 3`USP\Wa eW`R OcaUSUSPS\ ROaa RS` 5SaO[bOcaR`cQY UP[bT Wab c\R ROaa RS` 7\VOZb RS` DO`WOPZS\ i! c\dS`É\RS`b PSW USPZWSPS\ Wab ÎQd]V id\ ?a^VaP\\ BRT Ò\RS`\ AWS RS\ Z]UWaQVS\ C<2=^S`Ob]` OP a] ROaa RS` /caR`cQY OcT XSRS\ 4OZZ Y][^ZSbb OcaUSeS`bSb eW`R 8Sbhb [caa RS` ES`b RS` DO`WOPZS\ i! aWQV dS`É\RS`b VO PS\ "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
2Oa \ÉQVabS 0SWa^WSZ hSWUb SW\S ÉV\ZWQVS /cTUOPS\abSZZc\U 2c`QV RS\ Z]UWaQVS\ =^S`Ob]` jj eW`R RWS /caeS`bc\U OPUSP`]QVS\ eS\\ ROa 3`USP\Wa heSWTSZaT`SW TSab abSVb ?a^VaP\\ BRT!) BW^ac2dc4eP[dPcX^] B24 \Xc >34A>_TaPc^a public class Sce02 { public static void main(String args[]) throws Exception int a = 0; if (a==0 || (a = System.in.read()) > 0) System.out.println(a); } }
{
2WS aTPS;SbV]RS eW`R \WQVb OcaUSTºV`b eSWZ PS`SWba RS` S`abS BSWZOcaR`cQY S`TºZZb Wab PSW =23@ US\ºUb ROa ÎQd]V id\ ?a^VaP\\ BRT! Ò\RS`\ AWS ROa >`]U`O[[ a] OP ROaa W\ XSRS[ 4OZZ OcQV RS` 3W\ZSaSd]`UO\U abObb TW\RSb
(OZ]KOYK5VKXGZUXKT
3a UWPb W\ 8OdO =^S`Ob]`S\ RWS OcT 0WbSPS\S O`PSWbS\ ]Pe]VZ \]`[OZS`eSWaS ROa 0gbS & PWba RWS YZSW\abS OR`SaaWS`PO`S 3W\VSWb Wab ;Wb 6WZTS RWSaS` PWbeSWaS\ =^S`Ob] `S\ YO\\ [O\ RWS SW\hSZ\S\ 0Wba dS`aQVWSPS\ aVWTbS\ ]RS` Z]UWaQV dS`Y\º^TS\
> 1; // nach rechts "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&$
1XcfTXbT >_TaPc^aT]
System.out.println(zeichen2); System.out.println(zeichen3); } } 4º` RWS 7\bS`^`SbObW]\ RS` 3`USP\WaaS ! c\R ! eW`R RWS C\WQ]RSBOPSZZS PS\r bWUb 2S` 0cQVabOPS / eW`R eWS T]ZUb Q]RWS`b(
VSf " OZa X]cES`b `SW\ PW\É`( ! OZa X]cES`b `SW\ PW\É`( !
(OToXK
Z]UWaQVS C<2DS`Y\ºTc\U Z]UWaQVS =23@DS`Y\º^Tc\U
L Z]UWaQVS F=@DS`Y\º^Tc\U l Z]UWaQVSa <=B 3W\S`Y][^ZS[S\b OZZS PWba eS`RS\ W\dS`bWS`b 2Oa 3`USP\Wa SW\S` a]ZQVS\ PWbeSWaS\ DS`Y\º^Tc\U Wab SW\ X]cES`b + `SW\ PW\É` ?a^VaP\\ 1XcETaZ]dT_U ) 4X]iT[]T 1Xcb [^VXbRW eTaZ]¶_UT]
class BitVerknuepf01 { public static void main(String[] args) char zeichen1 = 'A'; char zeichen2 = 'B'; int erg;
{
erg = zeichen1 & zeichen2; System.out.print(erg + " = "); System.out.println((char)erg);
// UND
erg = zeichen1 | zeichen2; System.out.print(erg + " = "); System.out.println((char)erg);
// ODER
erg = zeichen1 ^ zeichen2; System.out.print(erg + " = "); System.out.println((char)erg);
// XOR
} } "!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
2WS /caUOPS RSa >`]U`O[[a Wab( $" + . $% + 1 ! + Ɔ 4º` RWS 7\bS`^`SbObW]\ RS` /caUOPS PS\rbWUS\ eW` RWS C\WQ]RS/A177BOPSZZS 2]`b TW\RS\ aWQV RWS HSWQVS\ Tº` RWS PW\É`S\ 7\VOZbS RS` DO`WOPZS\ TaV 2Oa 3`USP\Wa ec` RS d][ >`]U`O[[ eWS T]ZUb S`[WbbSZb( 2S` 0cQVabOPS / eW`R eWS T]ZUb Q]RWS`b( 2S` 0cQVabOPS 0 eW`R eWS T]ZUb Q]RWS`b( 2WS /<2DS`PW\RcU RS` 0Wba S`UWPb( 2WS =@DS`PW\Rc\U j RS` 0Wba S`UWPb( RWS F=@DS`PW\Rc\U L RS` 0Wba S`UWPb(
VSf " VSf " OZa 7\bSUS`( $" OZa 7\bSUS`( $% OZa 7\bSUS`( !
3W\S W\bS`SaaO\bS OPS` ^`OYbWaQV e]VZ eS\WU SW\USaSbhbS /cTUOPS\abSZZc\U Wab ROa 0WZRS\ RSa PWbeSWaS\ :^\_[T\T]cb SW\Sa UO\hhOVZWUS\ ES`bSa h0 Rc`QV ~'A': 2S` 0cQVabOPS / eW`R eWS T]ZUb Q]RWS`b( 0WbeSWaSa 9][^ZS[S\b PWZRS\( EW`R OZa \SUObWd W\bS`^`SbWS`b RV 3`USP\Wa ESWZ \SUObWd 9][^ZS[S\b PWZRS\
VSf " VSf" + 0
?a^VaP\\ 1XcETaZ]dT_U!) =^c>_TaPc^a U¶a :^\_[T\T]c1X[Sd]V class Bitverknuepf02 { public static void main(String[] args) byte b = 3; System.out.println(~b); } }
{
2WS /caUOPS RSa >`]U`O[[a Wab " RS\\
0000 0011 1111 1100
S\ba^`WQVb ! 9][^ZS[S\b S\ba^`WQVb " 3`ZÉcbS`c\U aWSVS 9O^ % !!
ÎQd]V id\ ?a^VaP\\ 1XceTaZ]dT_U! ÎQd]V ( <]bWS`S\ AWS Tº` aWQV OcT SW\S[ 0ZObb >O^WS` eWS RWSaSa 3`USP\Wa hc AbO\RS USY][[S\ Wab :rac\UaVW\eSWa( 2S` ES`b eW`R OZa \SUObWdS HOVZ W\bS`^`SbWS`b RO \OQV ROa 9][^ZS[S\b USPWZRSb c\R RO`OcT SW\S ORRWS`b ÎQd]V !( EO`c[ eS`RS\ RWS =^S`Ob]`S\ Phe j W\ PSabW[[bS\ /\eSWac\US\ OZa Z]UWaQVS =^S`Ob]`S\ c\R W\ O\RS`S\ /\eSWac\US\ OZa PWbeSWaS DS`Y\º^Tc\Ua]^S`O b]`S\ PSVO\RSZb- :rac\UaVW\eSWa( RWSa VÉ\Ub OP d]\ RS[ 2ObS\bg^ RS` =^S`O\RS\ ""
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&%
0dbfTacd]VbATXWT]U^[VT ?aÊiTST]iaTVT[]
'[Y]KXZ[TMY8KONKTLURMK6Xo`KJKT`XKMKRT
`W]`WbÉbS\ PSW RS` /caeS`bc\U D]ÊaT =^S`Ob]`S\ eS`RS\ hcS`ab Oca USeS`bSb 4º` RWS QX]ÊaT] =^S`Ob]`S\ UWZb( •
/`WbV[SbWaQVS =^S`Ob]`S\ eS`RS\ hcS`ab OcaUSeS`bSb 2OPSW USVb >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<2 dS`Y\º^Tb 2Oa 3`USP\Wa Wab UP[bT eSWZ RS` S`abS BSWZ OcaR`cQY ! # * % TOZaQV Wab 2c`QV RS\ 3W\aObh d]\ 9ZO[[S`\ Yr\\S\ RWSaS @SUSZ\ c[UO\US\ eS`RS\ 3a eW`R OPS` R`W\US\R S[^T]VZS\ RWS 9ZO[[S`\ OcQV hc dS`eS\RS\ eS\\ RWS \]`[OZS /caeS`bc\Ua`SWVS\T]ZUS c\dS`É\RS`b USZbS\ a]ZZ RO[Wb :SaPO`YSWb dS`PSaaS`b eW`R "#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
ÎQd]V id\ ?a^VaP\\ ?aX^aXcPTc! EWS YO\\ OZZSW\ Rc`QV ROa 3W\TºUS\ d]\ 9ZO[[S`\ RWSaS` /caR`cQY cadT ZWSTS`\- Hc` 3`W\\S`c\U( ES\\ Rc`QV 9ZO[[S`\ \WQVba O\RS`Sa S`hec\US\ eW`R VOb RWS ;cZbW^ZWYObW]\ SW\S VrVS`S >`W]`WbÉb OZa RWS /RRWbW]\
'YYU`OGZO\OZoZ 2ORc`QV Wab TSabUSZSUb W\ eSZQVS` @SWVS\T]ZUS SW\ /caR`cQY OcaUSeS`bSb eW`R RS` [SV`S`S =^S`Ob]`S\ \Xc V[TXRWTa ?aX^aXcÊc S\bVÉZb 2WS \]`[OZS /caeS`bc\Ua`SW VS\T]ZUS Wab d]\ ZW\Ya \OQV `SQVba 2Od]\ UWPb Sa heSW /ca\OV[S\( C\É`S =^S`ObW] \S\ h0 W\ RS` 4]`[ iPW[ c\R HceSWac\US\ W\ 4]`[ d]\( x = y = z = 0;. ?a^VaP\\ 0bb^iXPcXeXcPTc ) 0db]PW\bfTXbT aTRWcb QTVX]]T] class Assoziativitaet01 { public static void main(String[] args) int x,y,z; x = y = z = 5; System.out.println(x); y = y + ++z; System.out.println(y); } }
{
IdbP\\T]UPbbd]V
3W\ /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[TMKTQUJOKXKTYZGZKSKTZY
3W\S /\eSWac\U 0STSVZ abObS[S\b PSaQV`SWPb SW\S Y][^ZSbbS /caTºV`c\Ua]^S`O bW]\ Tº` RWS 8D; ÒczS`ZWQVSa ;S`Y[OZ Tº` SW\S Y][^ZSbbS /\eSWac\U Wab ROaa aWS Rc`QV SW\ AS[WY]Z]\ OPUSaQVZ]aaS\ eW`R 7\ RS\ 9O^WbSZ\ " c\R # VOPS\ eW` PS`SWba SW\S eWQVbWUS /\eSWac\U OcaTºV`ZWQV PS VO\RSZb( ROa 2SYZO`ObW]\aabObS[S\b 2]`b VOPS\ AWS USaSVS\ eWS W[ /`PSWbaa^SWQVS` >ZObh Tº` SW\S DO`WOPZS RSYZO`WS`b eW`R eOa SW\ 0ShSWQV\S` Wab c\R eSZQVS 0SRScbc\U RWS 2ObS\bg^S\ VOPS\ ESWbS`S eWQVbWUS /\eSWac\US\ aW\R •
;SbV]RS\OcT`cTS
•
HceSWac\UaO\eSWac\U c\R
•
AbScS`O\eSWac\US\
;SbV]RS\OcT`cTS ec`RS\ aQV]\ W[ 9O^WbSZ $ Tº` RWS 3W\ c\R /caUOPS PS\cbhb c\R eS`RS\ OcaTºV`ZWQV OP 9O^WbSZ PSVO\RSZb 7\ RWSaS[ 9O^WbSZ eS`RS\ AWS RWS HceSWac\US\ c\R AbScS`O\eSWac\US\ YS\\S\ZS` \S\ 2OPSW eW`R RSbOWZZWS`b S`ZÉcbS`b •
eOa HceSWac\US\ aW\R c\R eOa ROPSW hc PSOQVbS\ Wab
•
eSZQVS c\bS`aQVWSRZWQVS\ /`bS\ d]\ BcTdTaP]fTXbd]VT] Sa UWPb c\R eWS aWS SW\USaSbhb eS`RS\
•
ROaa Sa Tº` SW\ c\R RWSaSZPS /cTUOPS\abSZZc\U dS`aQVWSRS\S :rac\Ua[cabS` ^ObbS`\ UWPb /\VO\R SW\S` AQVZSWTS RWS 2ObS\aO[[Zc\US\ aS_cS\bWSZZ PSO` PSWbSb eW`R PSWa^WSZVOTb UShSWUb e] RWS D]` c\R
•
eSZQVS 9]\dS\bW]\S\ SW\USVOZbS\ eS`RS\ a]ZZbS\ RO[Wb Ucb ZSaPO`S c\R ºPS` aWQVbZWQVS ?cSZZbSfbS S\babSVS\
`]U`O[[a c\R AWS eS`RS\ ZS`\S\ eWS >`]U`O[[bSWZS P[cTa]PcXe [Wb RS` XU Phe bfXcRW/\eSWac\U ]RS` \TWaUPRW [Wb RS` fWX[T Phe S^ c\R U^aAQVZSWTS OcaUSTºV`b eS`RS\ Yr\ \S\ "%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
+OTLGINK[TJ`[YGSSKTMKYKZ`ZK'T]KOY[TMKT
8OdO c\bS`aQVSWRSb heWaQVS\ SW\TOQVS\ c\R hcaO[[S\USaSbhbS\ /\eSWac\US\ Hc aO[[S\USaSbhbS /\eSWac\US\ aW\R /\eSWac\US\ RWS O\RS`S /\eSWac\US\ acPabO bS[S\ba S\bVOZbS\ 2WS :WabS RS` AcPabObS[S\ba eW`R ROPSW SW\USaQVZ]aaS\ W\ US aQVeSWTbS 9ZO[[S`\ i k 3a UWPb heSW bg^WaQVS 4]`[S\ RS` hcaO[[S\USaSbhbS\ /\ eSWac\US\ Q][^]c\R abObS[S\ba DS`Pc\RO\eSWac\US\( RS\ /\eSWac\UaPZ]QY c\R RWS AbScS`O\eSWac\US\
'T]KOY[TMYHRUIQ 3W\ 0Z]QY Wab SW\S 4]ZUS d]\ SW\TOQVS\ AbObS[S\ba RWS d]\ USaQVeSWTbS\ 9ZO[[S`\ SW\USTOaab aW\R 0SWa^WSZ Tº` SW\S SW\TOQVS /\eSWac\U aW[^ZS AbObS[S\b(
x = 42;
0SWa^WSZ Tº` SW\S\ 0Z]QY OZa hcaO[[S\USaSbhbS /\eSWac\U DS`Pc\RO\eSWac\U ]RS` Q][^]c\R AbObS[S\b(
{ x = 42; y = 3; z = x + y; }
E] ZWSUb RS` AW\\ a]ZQVS` 9ZO[[S`c\U- •
5O\h OZZUS[SW\ YO\\ RWS 0Z]QYPWZRc\U RS` Ab`cYbc`WS`c\U RWS\S\ 7\ DS`PW\ Rc\U [Wb RS[ 3W\`ºQYS\ W\\S`VOZP RS` HSWZS\ eW`R SW\S ºPS`aWQVbZWQVS 5ZWSRS `c\U S``SWQVb
•
/czS`RS[ PSRScbSb RWSaS 9ZO[[S`c\U ROaa RWS /\eSWac\US\ W[ Q][^]c\R abObS[S\b PSVO\RSZb eS`RS\ eWS TX]T SW\hSZ\S /\eSWac\U AWS Yr\\S\ ºPS`OZZ R]`b abSVS\ e] RWS Ag\bOf SW\S SW\hSZ\S /\eSWac\U dS`ZO\Ub
•
2O`ºPS` VW\Oca Wab Sa [rUZWQV ROaa W\\S`VOZP RWSaSa 0Z]QYa DO`WOPZS\ RSYZO`WS`b eS`RS\ RWS RO\\ Z]YOZS DO`WOPZS\ US\O\\b eS`RS\ eSWZ aWS \c` W\\S`VOZP RWS aSa 0Z]QYa O\USa^`]QVS\ USZSaS\ ]RS` dS`É\RS`b eS`RS\ Yr\\S\ c\R eSWZ aWS \c` SfWabWS`S\ Tº` RWS HSWb RS` /caTºV`c\U RWSaSa Q][^]c\RabObS[S\ba 2Oa T]ZUS\RS >`]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^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ac\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&)
public class Zuweisung07 { public static void main(String args[]) { int x = 1; int y = 10; x = y = 0; System.out.println("x= " + x + " y= " + y); } } 4º` RWSaS 1]RWS`c\U Wab SW\S eWQVbWUS 0Sa]\RS`VSWb hc PSOQVbS\( RWS @SWVS\T]ZUS RS` /caTºV`c\U Wab \WQVb eWS a]\ab OZZUS[SW\ ºPZWQV d]\ ZW\Ya \OQV `SQVba a]\RS`\ #!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
aWS PSUW\\b `SQVba [Wb( h , RO\OQV eW`R RO\\ OcaUSTºV`b( g , h 3a eW`R XSR]QV S[^T]VZS\ RWSaS AQV`SWPeSWaS hc dS`[SWRS\ ?a^VaP\\ IdfTXbd]V') BcX[UaPVT] U¶a IdfTXbd]V public class Zuweisung08 { public static void main(String args[]) { int zahl; int zahl1; System.out.println(zahl = 2); System.out.println(zahl +=5); // Vermeiden! System.out.println(zahl1 = zahl = 6); // Vermeiden! } } ÎQd]V id\ ?a^VaP\\ IdfTXbd]V' 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa Sa ZSWQVbS` ZSaPO` Wab DS`[SWRS\ AWS RS\ hc aO[[S\USaSbhbS\ HceSWac\Ua]^S`Ob]` c\R OcQV RWS DS`eS\Rc\U d]\ [SV`S`S\ =^S`O\RS\ OZa 3[^TÉ\US` SW\S` HceSWac\U
9ZK[KXGT]KOY[TMKT
3W\ >`]U`O[[ Wab SW\S :rac\UaPSaQV`SWPc\U /ZU]`WbV[ca T]`[cZWS`b Rc`QV RWS HcaO[[S\abSZZc\U d]\ /\eSWac\US\ W\ SW\S` ag[P]ZWaQVS\ >`]U`O[[WS`a^`OQVS 4Oab OZZS PWaVS`WUS\ 0SWa^WSZS RWSaSa 0cQVa PSabO\RS\ Oca SW\S` ZW\SO`S\ 4]ZUS d]\ SZS[S\bO`S\ AQV`WbbS\ RWS ]PRWTX]P]STa aS_cS\bWSZZ c\R OcQV ]da YTfTX[b TX] \P[ OcaUSTºV`b ec`RS\ 2WSaS >`]U`O[[S S\ba^`SQVS\ \Obº`ZWQV \WQVb RS\ `SOZS\ /\T]`RS`c\US\ AWS \cbhS\ OcQV W\ YSW\S` ESWaS RWS D]`bSWZS RS` 1][^cbS` \É[ZWQV •
RWS 4ÉVWUYSWb aSV` aQV\SZZ aSV` dWSZS 2ObS\ hc dS`O`PSWbS\ c\R
•
RWS ;rUZWQVYSWb RWS DS`O`PSWbc\U OPVÉ\UWU hc [OQVS\ d]\ 0SRW\Uc\US\
3a aW\R OZa] 9]\b`]ZZab`cYbc`S\ \]beS\RWU RWS RWS =`R\c\U RS` /caTºV`c\U RWS @SWVS\T]ZUS c\R RWS 6ÉcTWUYSWb TSabZSUS\ ASWb W\ RS\ %S` 8OV`S\ RWS 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OaS
EWSRS`V]Zc\U :]]^ AQVZSWTS 7bS`ObW]\
eVWZS R]eVWZS T]`
A^`c\UO\eSWac\US\
P`SOY) Q]\bW\cS) ZOPSZ) `Sbc`\)
/PP &( 2`SW /`bS\ d]\ AbScS`O\eSWac\US\ /ZZS\ AbScS`O\eSWac\US\ US[SW\aO[ Wab ROaa aWS [Wb /caR`ºQYS\ O`PSWbS\ RWS d][ 0]]ZSO\2ObS\bg^ aSW\ [ºaaS\ RV RWSaS [ºaaS\ \OQV RS` /caeS`bc\U S\beSRS` cadT ]RS` UP[bT ZWSTS`\ 2WS 8OdOA^`OQV[WbbSZ RWSaS` OZU]`WbV[WaQVS\ 5`c\RT]`[S\ c\bS`aQVSWRS\ aWQV YOc[ d]\ RS\ A^`OQVSZS[S\bS\ W\ O\RS`S\ >`]U`O[[WS`a^`OQVS\ AWS aW\R h0 TOab WRS\ bWaQV [Wb RS` Ag\bOf RS` AbScS`O\eSWac\US\ W\ RS` 1A^`OQVS 2SaeSUS\ Yr\\S\ RWS 2S\Y[cabS` RWS W\ RWSaS[ 9O^WbSZ SW\USºPb eS`RS\ Rc`QVOca OcT O\RS`S A^`O QVS\ ºPS`b`OUS\ eS`RS\
2Oa XUAbObS[S\b S`[rUZWQVb Sa RS[ >`]U`O[[WS`S` O\RS`S /\eSWac\US\ aSZSYbWd OcaTºV`S\ hc ZOaaS\
*OK-X[TJLUXSKTJKXOL'T]KOY[TM
2WS Ag\bOf Tº` RWS SW\TOQVabS 4]`[ RS` WT/\eSWac\U Wab( if (ausdruck) { // Ja-Block (Dann-Block); } ##
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
2S` /caR`cQY \dbb W\ `c\RS\ 9ZO[[S`\ abSVS\
public class If01 { public static void main(String args[]) throws Exception if (5 < 3) { System.out.println("5 ist kleiner 3"); } else { System.out.println("5 ist nicht kleiner als 3"); } } }
{
2WS USaQVeSWTbS\ 9ZO[[S`\ Yr\\S\ S\bTOZZS\ eS\\ RS` 0Z]QY Oca \c` SW\S` /\eSW ac\U aW[^ZS abObS[S\b PSabSVb 2]QV eW`R S[^T]VZS\ W[[S` [Wb 9ZO[[S`\ hc O`PSWbS\ RO[Wb SW\ 0Z]QY S\babSVb Q][^]c\R abObS[S\b eSWZ RWS >`]U`O[[S RO Rc`QV PSaaS` ZSaPO` c\R eO`bPO` eS`RS\ BcadZc^VaP\\T 5S[SW\aO[ [Wb RS\ 7RSS\ RS` Ab`cYbc`WS`bS\ >`]U`O[[WS`c\U S\babO\RS\ 2O`abSZ Zc\UaT]`[S\ Tº` /ZU]`WbV[S\ [Wb RS\S\ RWS 3W\VOZbc\U RS` 3\bec`Ta c\R 1]RWS` bSQV\WYS\ S`hec\US\ ec`RS( RWS
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'#
ETaifTXVd]VT] BT[TZcX^] 0dbfPW[
/PP & ( Ab`cYb]U`O[[ Tº` RWS 7T/\eSWac\U
?a^VaP\\ 8U!) 1TXb_XT[ U¶a TX]bTXcXVT 850]fTXbd]V
public class If02 { public static void main(String args[]) { char c = 'A'; if (Character.isUpperCase(c)) { System.out.println("Der Zeichen " + c + " ist ein Grossbuchstabe"); } } } ?a^VaP\\ 8U") 1TXb_XT[ U¶a ifTXbTXcXVT 850]fTXbd]V public class If03 { public static void main(String args[]) { char c = 'a'; if (Character.isUpperCase(c)) { System.out.println("Der Zeichen " + c + " ist ein Grossbuchstabe"); } else { System.out.println("Das Zeichen " + c + " ist ein Kleinbuchstabe"); } } } 2Oa T]ZUS\RS 0SWa^WSZ S\bVÉZb SW\S\ VW\bS`VÉZbWUS\ 4SVZS` 7\ RS` HSWZS ! abSVb SW\ AS[WY]Z]\ RWSaSa eW`Yb eWS SW\S :SS`O\eSWac\U c\R PSS\RSb RWS 7T/\eSWac\U ?a^VaP\\ ;TTaP]fTXbd]V ) 1T[XTQcTa PQTa bRWfTa id T]cSTRZT]STa 5TW[Ta public class Leeranweisung01 { public static void main(String[] args) { if (3>5); System.out.println("3 ist größer 5"); } } #%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
BcX[UaPVT] ^STa) 4X]a¶RZT] Xbc fXRWcXV HeO` Wab 8OdO SW\S T]`[ObT`SWS A^`OQVS RV Sa UWPb YSW\S @SUSZ\ Tº` RWS /cTbSWZc\U SW\S` HSWZS b`]bhRS[ a]ZZbS\ SW\WUS PSeÉV`bS @SUSZ\ Tº` RWS ÉczS`S 4]`[ RSa ?cSZZ bSfba SW\USVOZbS\ eS`RS\ Hc` PSaaS`S\ :SaPO`YSWb aW\R PSa]\RS`a RWS 3W\`ºQYc\Ua `SUSZ\ W\RS\bObW]\ `cZSa hc PSOQVbS\ 2WSa UWZb OcT XSRS\ 4OZZ Tº` ROa 1]RWS`S\ d]\ /ZbS`\ObWdS\ ]RS` EWSRS`V]Zc\US\ RS\\ Rc`QV RWSaS AbScS`O\eSWac\US\ PS Y][[S\ >`]U`O[[S ]RS` Y]\Y`SbS`( ;SbV]RS\ SW\S PSabW[[bS Ab`cYbc` C\R RWS 3`TOV`c\U hSWUb ROaa RWS 4SVZS`acQVS W[ ?cSZZbSfb c\R RWS 3W\O`PSWbc\U W\ SWUS\S ]RS` T`S[RS >`]U`O[[S S`VSPZWQV S`ZSWQVbS`b eS`RS\ eS\\ RWSaS Ab`cYbc` ÉczS`ZWQV S`YS\\PO` eW`R eS\\ RS` Rg\O[WaQVS >`]U`O[[OPZOcT Oca RS` abObW aQVS\ <WSRS`aQV`WTb S`aWQVbZWQV Wab 0aQTXcT] \Xc TX]T\ Z^\_[TgT] 0dbSadRZ 3W\ /caR`cQY RS` RS\ eSWbS`S\ /PZOcT abScS`b YO\\ PSZWSPWU Y][^ZSf aSW\ RV Sa Yr\\S\ PSZWSPWU dWSZS /caaOUS\ Rc`QV Z]UWaQVS =^S`Ob]`S\ dS`Y\º^Tb eS`RS\ ?a^VaP\\ 8U#) :^\_[TgTa 0dbSadRZ U¶a SXT 0Q[PdUbcTdTad]V
public class If04 { public static void main(String args[]) { boolean fehler = false; int monat = 12; if ((!fehler) && (monat > 0) && (monat < 13)) System.out.println("Alles o.k."); else System.out.println("Fehler aufgetreten oder Monat falsch"); } }
6W\bS` RS[ AQVZºaaSZe]`b XU [caa SW\ /caR`cQY W\ `c\RS\ 9ZO[[S`\ abSVS\ RS` heO` Oca PSZWSPWU dWSZS\ BSWZPSRW\Uc\US\ PSabSVS\ YO\\ O[ 3\RS OPS` ZSRWUZWQV SW\S\ SW\hWUS\ EOV`VSWbaeS`b ZWSTS`\ [caa( cadT ]RS` UP[bT 0Sa]\RS`a W\bS`SaaO\b Wab W\ RS[ >`]U`O[[ 8U# RWS ÍPS`^`ºTc\U RS` P]]ZSaQVS\ DO`WOPZS\ UTW[Ta ES\\ RWS 0SRW\Uc\U S`TºZZb Wab S\bVÉZb RWS DO`WOPZS UTW[Ta RS\ ES`b cadT C\R ROa a]ZZ PSRScbS\ ROaa SW\ 4SVZS` OcTUSb`SbS\ Wab 7\ RWSaS[ >`] U`O[[ PSY][[b aWS RS\ ES`b UP[bT c\R ROa VSWzb Sa Wab OZZSa W\ =`R\c\U Sa Wab YSW\ 4SVZS` OcTUSb`SbS\ 2SaeSUS\ [caa W\ RS[ /caR`cQY RS` <716B=^S`Ob]` PS\cbhb eS`RS\ ÎQd]V id\ ?a^VaP\\ 8U# BSabS\ AWS ROa >`]U`O[[ [Wb RS[ ;]\Ob ! Ò\RS`\ AWS RO\OQV RWS 0SRW\Uc\U a] OP ROaa \c` RWS ;]\ObS RSa ! ?cO`bOZa d]\ %' OZa Y]``SYb hcUSZOaaS\ eS`RS\ #&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'#
ETaifTXVd]VT] BT[TZcX^] 0dbfPW[
-KYINGINZKRZK/,'T]KOY[TM <]QV Y][^ZSfS` eW`R SW\S XU/\eSWac\U eS\\ W\\S`VOZP RSa 8O0Z]QYa ]RS` W\\S` VOZP RSa <SW\0Z]QYa SW\S eSWbS`S XU/\eSWac\U abSVb 2WS /cTUOPS RSa \OQVT]ZUS\ RS\ >`]U`O[[a a]ZZ Sa aSW\ heSW HOVZS\ hc dS`UZSWQVS\ ?a^VaP\\ 8U$) 8U0]fTXbd]V X]]TaWP[Q STb =TX]IfTXVTb bRW[TRWc R^SXTac public class If05 { public static void main(String args[]) { int a = 2500; int b = 1500; if (a < b) { System.out.println("a ist kleiner als b "); if (b > 1000) System.out.println("und b ist groesser als 1000"); } else { System.out.println("a ist nicht kleiner als b "); if (b > 1000) System.out.println("und b ist groesser als 1000"); } } }
2WS 74AQVOQVbSZc\U YO\\ PSZWSPWU bWST S`T]ZUS\ /ca 5`º\RS\ RS` ÍPS`aWQVbZWQVYSWb eW`R S[^T]VZS\ \WQVb [SV` OZa ]RS` ! USaQVOQVbSZbS /ZbS`\ObWdS\ W\\S`VOZP SW\Sa HeSWUSa hc Y]RWS`S\ /ca\OV[S\ Yr\\S\ a] US\O\\bS XU9OaYORS\ aSW\ PSW RS\S\ XSeSWZa W[ T[bTHeSWU eWSRS`c[ SW\S XU/\eSWac\U abSVb( ?a^VaP\\ 8U%) 8U4[bT:PbZPST] public class If06 { public static void main(String args[]) { char c1 = 'z'; char c2 = 'z'; if (c1 == ' ') System.out.println("c1 ist leer"); else if (c1 < c2) System.out.println("c1 ist kleiner c2"); else if (c1 > c2) System.out.println("c1 ist groesser c2"); else if (c1 == c2) System.out.println("c1 ist gleich c2"); } }
#'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
*GTMROTM+RYK 0SW USaQVOQVbSZbS\ XUa YO\\ Sa hc [SV`RScbWUS\ AWbcObW]\ Y][[S\ \É[ZWQV RO\\ eS\\ Sa SW\S c\^OO`WUS /\hOVZ d]\ XU c\R T[bTAQVZºaaSZer`bS`\ UWPb 2O\\ YO\\ Sa ^OaaWS`S\ ROaa SW\ T[bT W\ RS` :cTb VÉ\Ub RO\UZS S\UZ Tº` POc[SZ\ 0SWa^WSZ(
if (a > b) if (a > 0 .... else ....
2O`Oca S`UWPb aWQV RWS 4`OUS( Hc eSZQVS[ XU USVr`b RS` T[bTHeSWU- /\be]`b( T[bT US Vr`b W[[S` hc[ c\[WbbSZPO` ROd]` abSVS\RS\ XU ?a^VaP\\ 8U&) XUT[bTBRWPRWcT[d]V
public class If07 { public static void main(String args[]) { int dollar = 0; boolean kreditkarte=true; if (!kreditkarte) { if (dollar == 0) System.out.println("Weder Dollar noch Karte"); } else System.out.println("Kreditkarte vorhanden"); } } 2WS @SUSZ eWS RWS ;SV`RScbWUYSWb OcTUSZrab eW`R a]ZZbS OcQV Oca RS` AQV`SWPeSWaS S`YS\\PO` eS`RS\ `WQVbWU SW\`ºQYS\ ÎQd]V id\ ?a^VaP\\ 8U& 7\ RWSaS[ >`]U`O[[ PSabSVb RS` 8OHeSWU RSa S`abS\ 7Ta Oca \c` SW\S` /\eSWac\U 2SaeSUS\ Yr\\bS [O\ TÉZaQVZWQVS`eSWaS OcT RWS 7RSS Y][[S\ RWS USaQVeSWTbS\ 9ZO[[S`\ W\ HSWZS\ # c\R & eSUhcZOaaS\ 4]`[OZ Wab ROa W\ =`R\c\U Z]UWaQV ZSW RS` TOZaQV 2WS /caTºV`c\U ZÉcTb RO\\ \É[ZWQV \WQVb a] eWS Sa RWS 3W\`ºQYc\U S` eO`bS\ ZÉzb 0WbbS bSabS\ AWS RWSa Rc`QV S\ba^`SQVS\RS >`]U`O[[É\RS`c\U 2Oa \OQVT]ZUS\RS >`]U`O[[ 8U' a]ZZ T]ZUS\RS /cTUOPS ZraS\( Hc\ÉQVab a]ZZ ºPS` ^`ºTb eS`RS\ ]P Sa abW[[b ROaa O YZSW\S` Wab OZa P ES\\ ROa abW[[b a]ZZ OPUST`OUb eS`RS\ ]P P , Wab c\R OPVÉ\UWU ROd]\ a]ZZ hcaÉbhZWQV OcaUSUSPS\ eS`RS\( P Wab U`rzS` ;»bd]Vbe^abRW[PV UTW[TaWPUc) public class If08 { public static void main(String args[])
{
$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'#
ETaifTXVd]VT] BT[TZcX^] 0dbfPW[
int a = 2500; int b = 1500; if (a < b) if (b > 1000) System.out.println("a ist kleiner b " + "und b ist groesser als 1000"); else System.out.println("a ist nicht kleiner b "); System.out.println("Programmende"); } } ÎQd]V id\ ?a^VaP\\ 8U' 2S` :rac\Uad]`aQVZOU 8U'YPeP Wab TOZaQV Sa eW`R ZSRWUZWQV >`]U`O[[S\RS OcaUS USPS\ 0WbbS ^`ºTS\ AWS e] RS` 4SVZS` ZWSUb c\R Y]``WUWS`S\ AWS ROa >`]U`O[[ 6W\eSWaS hc` :rac\U( 2Oa >`]PZS[ RSa RO\UZW\U SZaS YO\\ \c` d]`Y][[S\ eS\\ RWS /\eSWac\US\ \WQVb Rc`QV 0Z]QYYZO[[S`\ PSU`S\hb ec`RS\
(KJOTM[TMYUVKXGZUX,XGMK`KOINKTUVKXGZUX
3a UWPb SW\S\ =^S`Ob]` RSaaS\ EW`Yc\U RS[ 7T0STSVZ aSV` ÉV\SZb RS` 0SRW\Uc\Ua ]^S`Ob]` 2SaeSUS\ eS`RS\ eW` WV\ O\ RWSaS` AbSZZS PSa^`SQVS\ 2S` 0SRW\Uc\Ua ]^S`Ob]` PSabSVb Oca R`SW =^S`O\RS\ c\R RS\ PSWRS\ HSWQVS\ - c\R ( 3` Wab RS` SW\ hWUS bS`\É`S =^S`Ob]` OZZS O\RS`S\ aW\R c\É`S h0 ]RS` ]RS` PW\É`S h0 ]RS` =^S`Ob]`S\ /ZZUS[SW\S Ag\bOf SW\Sa 0SRW\Uc\UaOcaR`cQYa(
1^^[TbRWTa PdbSadRZ
.
PdbSadRZ
)
PdbSadRZ!*
2S` P]]ZSaQVS /caR`cQY eW`R OcaUSeS`bSb ES\\ S` RS\ ES`b cadT S`UWPb eW`R Pdb SadRZ SdOZcWS`b d]S OZa 3`USP\Wa USZWSTS`b O\RS`\TOZZa RS` PdbSadRZ! 0SWRS /ca R`ºQYS [ºaaS\ RS\ UZSWQVS\ 2ObS\bg^ VOPS\ RWSa eW`R d][ 1][^WZS` ºPS`^`ºTb 0SWa^WSZ(
a > b ? x + 5 : y / 5
EWS PSW SW\S[ /caR`cQY ºPZWQV eW`R TX] 3`USP\Wa SdOZcWS`b /PVÉ\UWU d]\ RS` 0S RW\Uc\U eW`R S\beSRS` g $ ]RS` g # OZa 3`USP\Wa USZWSTS`b A][Wb YO\\ SW\ RS`O`b hcaO[[S\USaSbhbS` /caR`cQY \c` BSWZ SW\S` Y][^ZSbbS\ /\eSWac\U aSW\ h0 SW\ >O`O[SbS` SW\Sa ;SbV]RS\OcT`cTa ]RS` BSWZ SW\S` HceSWac\U ?a^VaP\\ 5aPVTiTXRWT] ) 1TSX]Vd]Vb^_TaPc^a
public class Fragezeichen01 { public static void main(String[] args)
{ $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
System.out.println((6 > 5) ? 17 + 5 : 25 / 5); } } 2WS PSWRS\ \ÉQVabS\ 0SWa^WSZS hSWUS\ ROaa RS` 0SRW\Uc\Ua]^S`Ob]` SW\S Y][^OYbS /ZbS`\ObWdS Tº` SW\S\ OcaTºV`ZWQVS\ 7T0STSVZ aSW\ YO\\ ?a^VaP\\ 5aPVTiTXRWT]!) Id]ÊRWbc SXT XU0]fTXbd]V public class Fragezeichen02 { public static void main(String[] args) String text = " " ; if (6 > 5) text = "Groesser"; else text = "Kleiner/Gleich"; System.out.println(text); } }
{
ES\\ RWS 0SRW\Uc\U W\ SW\S\ /caR`cQY SW\USPSbbSb eW`R YO\\ OcT RWS 6WZTadO`WOPZS cTgc dS`hWQVbSb eS`RS\ ?a^VaP\\ 8U>_TaPc^a!) D]S ]d] STa 1TSX]Vd]Vb^_TaPc^a
public class IfOperator02 { public static void main(String[] args) { System.out.println((6 > 5) ? "groesser" : "kleiner/gleich"); } }
2WS Ag\bOf Tº` RS\ 0SRW\Uc\Ua]^S`Ob]` Wab OZZS`RW\Ua \WQVb W[[S` ZSWQVb hc ZSaS\ 2SaeSUS\ UWZb RWS 3[^TSVZc\U( DS`eS\RS\ AWS RS\ =^S`Ob]` -( \c` W\ PSU`º\RSbS\ /ca\OV[STÉZZS\
9]OZIN9ZGZKSKTZ ES\\ RS` eSWbS`S /PZOcT SW\Sa >`]U`O[[a [SV` OZa heSW ;rUZWQVYSWbS\ PWSbSb [caa SW\S XUT[bT9OaYORS ^`]U`O[[WS`b eS`RS\ RS\\ RS` 7T0STSVZ YS\\b \c` SW\S /ZbS` \ObWdS( S\beSRS` ]RS` ES\\ OPS` OZZS HeSWUS d]\ RS[ ES`b SW\S` SW\hWUS\ DO`W OPZS\ OPVÉ\US\ a] YO\\ SdbZ [Wb RS` bfXcRW/\eSWac\U USO`PSWbSb eS`RS\ 0SWa^WSZ( 3W\ >`]U`O[[ T]`RS`b d][ 0SRWS\S` SW\S\ \c[S`WaQVS\ ES`b Tº` SW\S\ PS ZWSPWUS\ ;]\Ob RSa 6OZPXOV`Sa O\ PWa $ 2WS eSWbS`S DS`O`PSWbc\U VÉ\Ub OZZSW\ d]\ RWSaS[ SW\S\ ES`b OP ?a^VaP\\ BfXcRW ) <^]PcbcTgcT U¶a SPb 7P[QYPWa \Xc XU PdbVTQT] import java.util.*;
$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'#
ETaifTXVd]VT] BT[TZcX^] 0dbfPW[
public class Switch01 { public static void main(String[] args) { System.out.println("Bitte geben Sie den Monat 1.Halbjahr ein: "); Scanner eingabe = new Scanner(System.in); int monat = eingabe.nextInt(); if (monat == 1) System.out.println("Januar"); else if (monat == 2) System.out.println("Februar"); else if (monat == 3) System.out.println("März"); else if (monat == 4) System.out.println("April"); else if (monat == 5) System.out.println("Mai"); else if (monat == 6) System.out.println("Juni"); else System.out.println("Falsche Eingabe"); } }
4º` RWSaS /cTUOPS\abSZZc\U PWSbSb aWQV O\ RS\ bfXcRW0STSVZ SW\hcaSbhS\ 2WSaS` Wab SW\S DO`WO\bS RSa 8U0STSVZa 7[[S` eS\\ SW\S 5O\hhOVZ OcT [SV`S`S c\bS`aQVWSRZW QVS ES`bS hc ^`ºTS\ Wab YO\\ bfXcRW SW\S /ZbS`\ObWdS hc USaQVOQVbSZbS\ XUa aSW\ /ZZUS[SW\S Ag\bOf( switch (ausdruck) { case wert: anweisung-1; case wert: anweisung-2; default: anweisung-n; } 2Oa 3`USP\Wa RSa /caR`cQYa eW`R [Wb XSRS[ ES`b dS`UZWQVS\ ES\\ SW\S` ºPS`SW\ abW[[b eS`RS\ RWS \OQVT]ZUS\RS\ /\eSWac\US\ OcaUSTºV`b ES\\ YSW\S` ^Oaab eW`R RWS /\eSWac\U VW\bS` STUPd[c OcaUSTºV`b FPb bX]S SXT 1TbRWaÊ]Zd]VT] U¶a ST] PdbSadRZ d]S U¶a ST] fTac. 2S` PdbSadRZ [caa OZa 3`USP\Wa SW\S\ \c[S`WaQVS\ ES`b ZWSTS`\ 2WSaS` ES`b [caa UO\hhOVZWU ]RS` \]QV US\OcS`( d][ X]cBg^ aSW\ 3`UWPb RWS /caeS`bc\U RSa /caR`cQYa SW\S\ bW^ac QhcT ]RS` RWPaBg^ eW`R RWSaS` c[USeO\RSZb W\ X]cBg^ <WQVb S`ZOcPb aW\R RWS ^`W[WbWdS\ Bg^S\ Q^^[TP] [^]V U[^Pc ]RS` S^dQ[T 2S` fTac VW\bS` RS[ AQVZºaaSZe]`b RPbT [caa SW\ Y]\abO\bS` /caR`cQY aSW\ 2O` c\bS` dS`abSVb [O\ SW\S\ ES`b RS` hc` 1][^WZShSWb PSYO\\b Wab h0 # ]RS` # ! <WQVb S`ZOcPb aW\R DO`WOPZS\ 2O\OQV T]ZUS\ RS` 2]^^SZ^c\Yb c\R SW\S SW\hSZ\S /\eSWac\U ]RS` OcQV [SV`S`S /\eSWac\US\ 9`WbWaQVS` 6W\eSWa 2WSa OZZSa aW\R U`OdWS`S\RS 3W\aQV`É\Yc\US\ Tº` RWS 3W\aObh[rUZWQVYSWbS\ RSa bfXcRWabObS[S\ba 2WSaSa A^`OQVY]\ab`cYb Wab \WQVb O\\ÉVS`\R a] ZSWabc\UaTÉVWU eWS $!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
ÉV\ZWQVS ;rUZWQVYSWbS\ W\ O\RS`S\ A^`OQVS\ Sa TSVZb h0 RWS /PT`OUS d]\ ES`bSPS `SWQVS\ ]RS` RWS ;rUZWQVYSWb SW\S\ /caR`cQY VW\bS` RPbT hc T]`[cZWS`S\ 1Tb^]STaWTXcT] STa bfXcRWBh]cPg
2WS /\eSWac\US\ VW\bS` RS[ RPbTAQVZºaaSZe]`b [ºaaS\ \WQVb OZa 0Z]QY USYZO[[S`b aSW\ 3W\ 4OZZ eW`R Rc`QV ROa \ÉQVabS AQVZºaaSZe]`b RPbT PSS\RSb /PS` /QVbc\U( 5`c\RaÉbhZWQV UWZb ROaa PSW[ S`abS\ /cTb`SbS\ RSa USacQVbS\ ES`bSa RWS DS`O`PSWbc\U PSUW\\b c\R P[[T \OQVT]ZUS\RS\ QOaS OcaUSTºV`b eS`RS\ c\R heO` a]ZO\US PWa SW\ QaTPZ USTc\RS\ eW`R ]RS` PWa RWS bfXcRW/\eSWac\U PSS\RSb Wab
/PP &!( Ab`cYb]U`O[[ Tº` AeWbQV ;SV`TOQVdS`heSWUc\U
?a^VaP\\ BfXcRW!) <^]PcbcTgcT U¶a SPb 7P[QYPWa \Xc bfXcRW PdbVTQT] import java.util.*; public class Switch02 { public static void main(String[] args) { System.out.println("Bitte Monat eingeben (1.Halbjahr)"); Scanner eingabe = new Scanner(System.in); int monat = eingabe.nextInt(); switch (monat) { case 1: System.out.println("Januar"); break; case 2: System.out.println("Februar"); break; case 3: System.out.println("Maerz"); break; case 4: System.out.println("April"); break; case 5: System.out.println("Mai"); break; case 6: System.out.println("Juni"); break; default: System.out.println("Der Monat ist falsch"); } System.out.println("Programm-Ende"); } }
ÎQd]V id\ ?a^VaP\\ BfXcRW! 0WbbS ^`ºTS\ AWS Rc`QV >`]U`O[[É\RS`c\U ]P O\abSZZS RS` Y]\abO\bS\ HOVZS\ VW\bS` RS[ AQVZºaaSZe]`b RPbT OcQV SW\ DO`WOPZS\\O[S abSVS\ YO\\ HeSW /\UOPS\ aW\R PSa]\RS`a hc PSOQVbS\( $"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'#
ETaifTXVd]VT] BT[TZcX^] 0dbfPW[
•
Hc[ SW\S\ RWS /\eSWac\U QaTPZ W\ XSRS[ RPbT AWS PSS\RSb RWS eSWbS`S /caTºV `c\U RS` AeWbQV/\eSWac\U c\R ºPS`UWPb RWS AbScS`c\U O\ RS\ \ÉQVabS\ 0STSVZ VW\bS` RWSaS` AeWbQV/\eSWac\U ES\\ ROa QaTPZAbObS[S\b TSVZb eW`R [Wb RS[ \ÉQVabS\ RPbT eSWbS`US[OQVb
•
Hc[ O\RS`S\ ROa AQVZºaaSZe]`b STUPd[c 2WSaS /\UOPS Wab ]^bW]\OZ 2O[Wb Yr\ \S\ OZZS \WQVb OPUST`OUbS\ 4ÉZZS OPUSTO\US\ c\R PSVO\RSZb eS`RS\
?a^VaP\\ BfXcRW") 3XT FXaZd]V STa QaTPZ0]fTXbd]V
import java.util.*; public class Switch03 { public static void main(String[] args) throws Exception { System.out.println("Bitte einen Buchstaben eingeben:"); Scanner eingabe = new Scanner(System.in); byte c = eingabe.nextByte(); switch (c) { case 'A': System.out.println("a"); case 'B': System.out.println("b"); case 'C': System.out.println("c"); case 'E': System.out.println("e"); default : System.out.println ("Alle anderen Buchstaben"); } } }
2WS ;SbV]RS ]Tgc1hcT S`eO`bSb RS\ 7\bSUS`eS`b RSa /A177HSWQVS\a h0 $# Tº` / ÎQd]V id\ ?a^VaP\\ BfXcRW" BSabS\ AWS ROa >`]U`O[[ Rc`QV 3W\UOPS RS` HOVZ $$ Tº` ROa /A177HSWQVS\ 0 ÍPS`^`ºTS\ AWS RWS /caUOPS 2O RWSaS ]TTS\aWQVbZWQV TOZaQV Wab Y]``WUWS`S\ AWS ROa >`]U`O[[ 6W\eSWa( 3a TSVZb RWS QaTPZ/\eSWac\U 2Oa T]ZUS\RS 0SWa^WSZ S``SQV\Sb RWS /\hOVZ BOUS RWS SW\ ;]\Ob VOb c\bS` 0S`ºQY aWQVbWUc\U RS` AQVOZbXOV`S 3W\ AQVOZbXOV` Wab Rc`QV " OPS` \WQVb Rc`QV bSWZPO` Sa aSW RS\\ Sa Wab Rc`QV " bSWZPO` ?a^VaP\\ BfXcRW#) 0]iPW[ CPVT TX]Tb <^]Pcb Ta\XccT[] public class Switch04 { public static void main(String[] args) { int monat = 2; int jahr = 2000; int tage = 0;
$#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
switch (monat) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: tage = 31; break; case 4: case 6: case 9: case 11: tage = 30; break; case 2: if ( ((jahr % 4 == 0) && !(jahr % 100 == 0)) || (jahr % 400 == 0) ) tage = 29; else tage = 28; break; } System.out.println("Anzahl der Tage = " + tage); } } 2WS ZSS`S\ RPbT9ZOcaSZ\ eW`YS\ eWS SW\ SW\aQVZWSzS\RSa =RS` A]POZR RS` /caR`cQY [Wb RS` 9]\abO\bS\ ºPS`SW\abW[[b PSUW\\b RWS /caTºV`c\U OZZS` \OQVT]ZUS\RS\ /\ eSWac\US\ PWa hc[ 3\RS RSa AeWbQVAbObS[S\ba c\R aWS eW`R \c` OPUSP`]QVS\ eS\\ SW\ QaTPZAbObS[S\b OcTb`Wbb T]d\Ch_T] X] bfXcRW0]fTXbd]V eTafT]ST] <SPS\ RS\ \]`[OZS\ 9ZOaaS\ UWPb Sa OcQV T]d\Bg^S\ RWS SPS\TOZZa W\ 9ZOaaS\ PSaQV`WSPS\ eS`RS\ Yr\\S\ 3`ZÉcbS`c\US\ aWSVS 9O^WbSZ ' 3\c[Bg^S\ eS` RS\ OcQV /cThÉVZc\Uabg^S\ US\O\\b eSWZ RWS [rUZWQVS\ ES`bS RWS SW\S DO`WOPZS RWSaSa Bg^a OcT\SV[S\ YO\\ W\ 4]`[ SW\S` /cThÉVZc\U O\USUSPS\ eS`RS\ 2O\\ YO\\ SW\S DO`WOPZS d][ T]d\Bg^ OZa RPbTES`b PS\cbhb eS`RS\ ?a^VaP\\ BfXcRW$) 0QUaPVT e^] TX]T\ T]d\Ch_ PQWÊ]VXV \PRWT] public class Switch05 { enum Wochentage {montag, dienstag, mittwoch, donnerstag, freitag, samstag, sonntag} public static void main (String[] args) { $$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'$
BRW[TXUT] 8cTaPcX^] FXTSTaW^[d]V ;^^_
Wochentage w = Wochentage.samstag; switch(w) { case montag: System.out.println("Wochenbeginn"); case samstag: System.out.println("Arbeitsfrei"); } } } 4OhWb( 2WS bfXcRW/\eSWac\U eW`R SW\USaSbhb eS\\ d][ ES`b SW\S` \c[S`WaQVS\ DO `WOPZS\ RWS YO\\ OcQV SW\ T]d\Bg^ aSW\ [SV`S`S /ZbS`\ObWdS\ OPVÉ\US\ D]`Oca aSbhc\U Wab( 3a eW`R RS` ES`b SW\S` UO\hhOVZWUS\ DO`WOPZS\ OPUST`OUb QhcT bW^ac RWPa ^STa X]c [^]V Wab \WQVb S`ZOcPb
9INRKOLKT/ZKXGZOUT=OKJKXNUR[TM2UUV
;Wb AQVZSWTS\PSTSVZS\ YO\\ [O\ S``SWQVS\ ROaa >`]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\<` O\USPS\ ÎQd]V !) ;]RWTWhWS`S\ AWS ROa >`]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 <= 'z') System.out.println(buchstabe++); } }
{
2Oa >`]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
public class While03 { public static void main(String[] args) { char buchstabe = 'a'; while (buchstabe <= 'z') { System.out.println((char)(buchstabe - 32)); buchstabe++; } } } ?a^VaP\\ FWX[T#YPeP) 4]S[^bBRW[TXUT
import java.util.*; public class While04 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); String zeile; while (true) { System.out.println("Bitte Text eingeben:"); zeile = eingabe.next(); System.out.println("Eingegeben wurde: " + zeile); } } } 2Oa >`]U`O[[ FWX[T#YPeP ZWSab hSWZS\eSWaS d]\ BhbcT\X] 2WS Er`bS` SW\S` 3W\ UOPShSWZS eS`RS\ OcTUSa^ZWbbSb c\R W\ XSeSWZa SW\S` SWUS\S\ HSWZS OcaUSUSPS\ ^O` aS\ RS` 3W\UOPShSWZS ESWZ RWS 0SRW\Uc\U RS` fWX[TAQVZSWTS ROa :WbS`OZ cadT S\b
$'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
VÉZb Wab aWS W[[S` eOV` 2SaeSUS\ YO\\ RWSaS 3\RZ]aaQVZSWTS \c` USeOZbaO[ c\bS` EW\R]ea [Wb 1B@:1 OPUSP`]QVS\ eS`RS\ 7[ >`]U`O[[ FWX[T$YPeP eS`RS\ d][ 0SRWS\S` HOVZS\ O\UST]`RS`b RWS W[ >`] U`O[[ a]ZO\US OcTORRWS`b eS`RS\ PWa RWS Ac[[S RS\ ES`b d]\ S``SWQVb VOb ?a^VaP\\ FWX[T$) IPW[T] PdUbd\\XTaT] import java.util.*; public class While05 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); int zahl; int summe = 0; while (summe < 100) { System.out.println("Bitte Zahl eingeben:"); zahl = eingabe.nextInt(); summe = summe + zahl; } System.out.println("Die Summe betraegt: " + summe); } } ?a^VaP\\ FWX[T%) ;^VXbRWTa 5TW[Ta public class While06 { public static void main(String[] args) { boolean ichBinMillionaer = false; while (ichBinMillionaer == true); { System.out.println("Ich bin Millionaer"); } } } 2Oa >`]U`O[[ UWPb eS\\ AWS Sa US\Oc a] OPbW^^S\ eWS d]`USUSPS\ RS\ BSfb Oca( Ich bin Millionaer OPS` ROa Wab USZ]US\ RS\\ RWS DO`WOPZS XRW1X]<X[[X^ ]PTa S\bVÉZb RS\ ES`b UP[bT ÎQd]V id\ ?a^VaP\\ FWX[T% DS`acQVS\ AWS aSZPababÉ\RWU RS\ 4SVZS` hc TW\RS\ c\R Y]``WUWS`S\ AWS ROa >`] U`O[[ :rac\UaVW\eSWa( 2Oa >`]U`O[[ ;TTaP]fTXbd]V YPeP W[ /PaQV\Wbb &" S\bVÉZb RS\aSZPS\ 4SVZS`
%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'$
BRW[TXUT] 8cTaPcX^] FXTSTaW^[d]V ;^^_
*U9INRKOLK ;Wb RS` 2]/\eSWac\U eW`R SW\S TczUSabScS`bS AQVZSWTS `SOZWaWS`b 2ORc`QV YO\\ [O\ S``SWQVS\ ROaa SW\ >`]U`O[[bSWZ [W\RSabS\a SW\[OZ OcaUSTºV`b c\R RO\OQV W[[S` eWSRS` PWa SW\S 0SRW\Uc\U UP[bT S`UWPb 2WS Ag\bOf RS` 2]AQVZSWTS Wab( do { // Schleifen-Block } while (Boolescher Ausdruck); 2S` AQVZSWTS\PZ]QY eW`R OcaUSTºV`b c\R RO\OQV RS` 0]]ZSaQVS /caR`cQY SdOZcWS`b ES\\ ROa 3`USP\Wa cadT Wab PSUW\\b SW\ \ScS` 2c`QVZOcT 2S` AQVZSWTS\PZ]QY eW`R RO\\ S`\Scb OcaUSTºV`b c\R O[ 3\RS eW`R US^`ºTb ]P SW\ eSWbS`S` 2c`QVZOcT S`T]` RS`ZWQV Wab cae 2WSaS /`b RS` AQVZSWTS\PWZRc\U \S\\b [O\ TczUSabScS`b ]RS` \WQVbOPeSWaS\R RS\\ RWS >`ºTc\U S`T]ZUb ]PRW RS[ AQVZSWTS\Rc`QVZOcT 2S` 0Z]QY eW`R OcT XSRS\ 4OZZ SW\[OZ dWSZZSWQVb a]UO` [SV`[OZa Rc`QVZOcTS\
/PP&#( Ab`cYb]U`O[[ Tº` 2]AQVZSWTS >`ºTc\U O[ 3\RS
?a^VaP\\ 3^ ) 0dbVPQT b^[P]VT iPW[ + $
public class Do01 { public static void main(String[] args) int zahl = 5; do System.out.println(zahl++); while (zahl < 5); } }
{
/Za]( =Pe]VZ RWS 0SRW\Uc\U \WQVb S`TºZZb Wab eW`R RS` AQVZSWTS\`c[^T OcaUSTºV`b eSWZ PSW RS` 2]AQVZSWTS RWS >`ºTc\U S`ab O[ 3\RS RS` AQVZSWTS abObbTW\RSb ÎQd]V id\ ?a^VaP\\ 3^ Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa Sa O\OZ]U hc[ >`]U`O[[ FWX[T YPeP RWS HOVZS\ " OcaUWPb 6W\eSWa( 3a Wab \c` RWS Ò\RS`c\U SW\Sa :WbS`OZa \]beS\RWU
%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
2Oa >`]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 <= 10; zahl++) { %"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'$
BRW[TXUT] 8cTaPcX^] FXTSTaW^[d]V ;^^_
sum = sum + zahl; } System.out.println("Summe ist = " + sum); } } ÎQd]V
0WbbS Q]RWS`S\ AWS SW\ \ScSa >`]U`O[[ 5^a"YPeP ROa A]\RS`hSWQVS\ RSa C\WQ]RSa OcaUWPb c\R heO` RWS HSWQVS\ [Wb RS\ 1]RS^]W\ba Jc PWa Jc 4 3a a]ZZ [Wb SW\S` 4=@AQVZSWTS USO`PSWbSb eS`RS\ 2S\YS\ AWS RO`O\ ROaa OcQV [Wb RWPaBg^S\ US`SQV\Sb eS`RS\ YO\\ ;»bd]Vbe^abRW[PV public class For03 { public static void main(String[] args) { for (char c = '\u0021'; c < '\u002F'; c++) System.out.println(c); } } 5>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 <^SXUXZPcX^] X]]TaWP[Q public class For05 { public static void main(String[] args) { int i= 0; for (; i < 1;) { System.out.println("Ich werde einmal ausgegeben"); i++; } } } 3W\S eSWbS`S 0Sa]\RS`VSWb hSWUb ROa T]ZUS\RS >`]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%) `]U`O[[dS`VOZbS\ eS\\ RWS PSWRS\ 0SRW\Uc\US\ [Wb RS[ C<2=^S`Ob]` dS`Y\º^Tb eS`RS\- 2Oa \ÉQVabS >`]U`O[[ hSWUb SW\S TSVZS`VOTbS >`ºTPSRW\Uc\U 2WS >`º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 ;^^_
ES\\ RWS 4]`AQVZSWTS hc` DS`O`PSWbc\U d]\ 2ObS\aO[[Zc\US\ h0 /``Og ]RS` 1]Z ZSQbW]\ SW\USaSbhb eW`R c\R eS\\ \c` ZSaS\R OcT RWS SW\hSZ\S\ 9][^]\S\bS\ hcUS U`WTTS\ eW`R RO\\ UWPb Sa SW\S dS`SW\TOQVbS DO`WO\bS RS` 0OaWa4]`AQVZSWTS RWS a] US\O\\bS U^aTPRWAQVZSWTS AWS Rc`QVZÉcTb RWS 2ObS\aO[[Zc\U d]\ d]`\S PSUW\ \S\R ZºQYS\Z]a PWa hc[ 3\RS c\R abSZZb W[ AQVZSWTS\PZ]QY RS\ ES`b SW\S` XSRS\ 9][^]\S\bS hc` DS`TºUc\U Hc[ Y][^ZSbbS\ DS`abÉ\R\Wa aW\R /``Og9S\\b\WaaS S` T]`RS`ZWQV aWSVS 9O^WbSZ ! ?a^VaP\\ 5^a4PRW ) BT`dT]cXT[[Tb ;TbT] TX]Tb 0aaPhb class ForEach01 { public static void main(String[] args) int[] sammlung = {1,5,7,3}; for (int zahl : sammlung) System.out.println(zahl); } }
{
C[ SW\ DS`abÉ\R\Wa Tº` RWS Ag\bOf hc PSY][[S\ eW`R RS` 2]^^SZ^c\Yb eWS W\ USZSaS\ OZa] Tº` XSRS HOVZ W\ AO[[Zc\U ESWbS`S 7\T]`[ObW]\S\ c\R 0SWa^WSZS hc RWSaS` 4]`[ SW\S` U^aTPRW:]]^ UWPb Sa W[ 9O^WbSZ !( /``Oga 1TfTacd]V STa d]cTabRWXTS[XRWT] BRW[TXUT]:^]bcadZcT 3a PSabSVb YSW\ U`c\RaÉbhZWQVS` C\bS`aQVWSR heWaQVS\ RS\ R`SW AQVZSWTS\T]`[S\ fWX [T S^ c\R U^a 8SRS 4=@AQVZSWTS YO\\ OcQV [Wb E67:3 US[OQVb eS`RS\ c\R c[US YSV`b 3PS\a] YO\\ SW\S 2=AQVZSWTS Rc`QV SW\S 4=@ ]RS` E67:3AQVZSWTS S`aSbhb eS`RS\ /ZZS`RW\Ua Wab XS \OQV /cTUOPS\abSZZc\U [OZ RWS SW\S 4]`[ ºPS`aWQVbZWQVS` c\R [OZ RWS O\RS`S 5`c\RaÉbhZWQV a]ZZ RWS /`b RS` 1]RWS`c\U RWS >`]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 <= 3; zahl1++) { for (int zahl2 = 1; zahl2 <=5; zahl2++) System.out.println(zahl1 + " " + zahl2); } } } 2WS /caUOPS RSa >`]U`O[[a 5^a'YPeP aWSVb eWS T]ZUb Oca( 1 1 2 2 3 3
1 2 1 2 1 2
ÎQd]V 0WbbS Q]RWS`S\ AWS ROa >`]U`O[[ 5^a(YPeP 3a a]ZZ [Wb SW\S` 4]`AQVZSWTS O`PSWbS\ 2S` AQVZSWTS\`c[^T a]ZZ ![OZ Rc`QVZOcTS\ eS`RS\ c\R T]ZUS\RS /cTUOPS\ S`TºZZS\( •
2S` BSfb /caaS\aQVZSWTS a]ZZ OcaUSUSPS\ eS`RS\
•
/czS`RS[ a]ZZ W\\S`VOZP RWSaSa @c[^Ta SW\S W\\S`S 4=@AQVZSWTS Q]RWS`b eS` RS\ RWS heSW[OZ Rc`QVZOcTS\ eW`R c\R W\ RS` ZSRWUZWQV RS` BSfb 7\\S\aQVZSWTS OcaUSUSPS\ eW`R
;»bd]Vbe^abRW[PV public class For09 { public static void main(String[] args) { for (int i=0; i < 3; i++) { System.out.println("Aussenschleife"); for (int j = 0; j < 2; j++) System.out.println("Innenschleife"); } } } %&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'%
B_ad]V0]fTXbd]VT] QaTPZ R^]cX]dT
ÎQd]V id\ ?a^VaP\\ 5^a( 0WbbS ZraS\ AWS RWS /cTUOPS\abSZZc\U RS` >`]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 <= 3) { int zahl2 = 1; while (zahl2 <=5) { System.out.println(zahl1 + " " + zahl2); zahl2++; } zahl1++; } } } 7\aPSa]\RS`S Tº` ROa /`PSWbS\ [Wb [SV`RW[S\aW]\OZS\ /``Oga PWSbS\ USaQVOQVbSZbS 4=@AQVZSWTS\ SW\S aSV` ºPS`aWQVbZWQVS AQV`SWPeSWaS aWSVS 9O^WbSZ !( /``Oga
9VX[TM'T]KOY[TMKTHXKGQIUTZOT[K
7\ [O\QVS\ AWbcObW]\S\ Wab Sa \]beS\RWU RWS \]`[OZS 9][^ZSbbWS`c\U SW\Sa AQVZSW TS\Rc`QVZOcTa hc dS`VW\RS`\ 2O\\ [caa RS` @Sab RS` AQVZSWTS\`c[^Ta ºPS`a^`c\US\ eS`RS\ 0SWa^WSZ( 7\ SW\S` 2ObSW RWS aS_cS\bWSZZ USZSaS\ eW`R abSVS\ OZZS 9c\RS\RO bS\ SW\Sa C\bS`\SV[S\a 3a eS`RS\ W[ >`]U`O[[ \c` RWS 9c\RS\ [Wb SW\S[ PS abW[[bS\ ;W\RSabc[aObh PS\rbWUb /Za] [caa SW\S AQVZSWTS ^`]U`O[[WS`b eS`RS\ RWS SbeO eWS T]ZUb OcaaWSVb( i Lese aus der Datei solange noch Sätze vorhanden sind Prüfe, ob Mindestumsatz vorhanden Wenn nein, beginne die Schleife von vorn Wenn ja, verarbeite den gelesenen Satz k 2S` d]`hSWbWUS /PP`cQV SW\Sa AQVZSWTS\Rc`QVZOcTa PSRScbSb ROaa RWS `SabZWQVS\ 0S TSVZS RSa AQVZSWTS\`c[^Ta ºPS`a^`c\US\ eS`RS\ 2WS /PZOcTabScS`c\U eW`R O\ SW\S O\RS`S AbSZZS b`O\aTS`WS`b EWS Sa RO\OQV eSWbS` USVb VÉ\Ub W\ 8OdO d]\ RS` /`b RS` A^`c\U/\eSWac\U OP( •
[Wb SW\S` QaTPZ/\eSWac\U eW`R RWS AQVZSWTS Z^\_[Tcc OPUSP`]QVS\ c\R %'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
•
[Wb SW\S` R^]cX]dT/\eSWac\U eW`R ]da RS` OYbcSZZS 2c`QVZOcT d]`hSWbWU PSS\ RSb
ÎQd]V( DS`acQVS\ AWS TSabhcabSZZS\ eSZQVS /`b d]\ d]`hSWbWUS[ AQVZSWTS\OPP`cQV W\ RS[ PSaQV`WSPS\S\ 4OZZ RS` C[aObhRObSW d]`ZWSUb /\be]`b( 2S` OYbcSZZS 2c`QVZOcT eW`R PSS\RSb OPS` Sa eW`R US^`ºTb ]P SW\ S`\ScbS` 2c`QVZOcT \]beS\RWU Wab 3a VO\RSZb aWQV OZa] c[ RWS R^]cX]dT/\eSWac\U
HXKGQ'T]KOY[TM ;Wb RS` 0`SOY/\eSWac\U eW`R RWS OYbcSZZS AQVZSWTS Y][^ZSbb PSS\RSb 2S` AQVZSWTS\ `c[^T eW`R dS`ZOaaS\ c\R RWS DS`O`PSWbc\U [Wb RS` S`abS\ /\eSWac\U ]PRW RS` AQVZSWTS T]`bUSaSbhb 2Oa T]ZUS\RS >`]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<10; i++) ... if (....) continue; ... }
{
// 10mal die Schleife ausführen // Diesen Durchlauf abbrechen
0SW USaQVOQVbSZbS\ AQVZSWTS\ eW`R \c` RWS W\\S`S AQVZSWTS OPUSP`]QVS\ 2Oa T]ZUS\RS >`]U`O[[ 2^]cX]dT YPeP S``SQV\Sb RS\ 9SV`eS`b RS` HOVZS\ PWa ÍPS`a^`c\US\ eS`RS\ a]ZZ PSW RWSaS` 0S`SQV\c\U OPS` RWS
public class Continue01 { public static void main(String[] args) { for (int i= -10; i <11; i++) { if (i == 0) continue; // Laufende Iteration beenden System.out.println("Kehrwert von " + i + " = " + 1.0 / i); } } }
6TbRWPRWcT[cT BRW[TXUT] PQQaTRWT] 0SW USaQVOQVbSZbS\ AQVZSWTS\ eW`R \c` RS` W\\S`S AQVZSWTS\`c[^T OPUSP`]QVS\ c\R \WQVb SbeO RWS USaO[bS AQVZSWTS ?a^VaP\\ 2^]cX]dT!) 0QQadRW STa X]]TaT] BRW[TXUT import java.util.*; public class Continue02 { public static void main(String[] args)
{ &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
int zahl; int summe = 0; for (int i=0; i < 3; i++) { System.out.println("Aussenschleife " + i); for (int j=0; j < 4; j++) { if (i == 1) continue; System.out.println("Innenschleife " + i); } } } } ES\\ RWS /cTUOPS\abSZZc\U Sa XSR]QV dS`ZO\Ub ROaa OZZS AQVZSWTS\ OPUSP`]QVS\ eS`RS\ [ºaaS\ a] YO\\ RWSa [Wb RS[ 0SaQV`WTbS\ d]\ AQVZSWTS\ Rc`QV :OPSZ aSV` ZSWQVb `SOZWaWS`b eS`RS\
(KTGTTZK9INRKOLKT2GHKR A]e]VZ RWS 1aTPZ OZa OcQV RWS 2^]cX]dT/\eSWac\U Yr\\S\ c[ SW\S\ 7RS\bWTWS` ;O`YS S`UÉ\hb eS`RS\ h0
continue hauptschleife;
7\ RWSaS[ 4OZZ VO\RSZb Sa aWQV PSW VOc^baQVZSWTS c[ RS\
&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'%
B_ad]V0]fTXbd]VT] QaTPZ R^]cX]dT
ÎQd]VT] id\ ?a^VaP\\ ;PQT[ ÎQd]V ) BSabS\ AWS ROa >`]U`O[[dS`VOZbS\ eS\\ PSW RS` Q]\bW\cS/\eSWac\U ROa :OPSZ RWS ;O`YS eSUUSZOaaS\ eW`R ÎQd]V !( 0WbbS ^`ºTS\ AWS ]P :OPSZ W[[S` O[ AQVZSWTS\PSUW\\ abSVS\ [ºaaS\ ]RS` ]P aWS O\ SW\S` PSZWSPWUS\ AbSZZS OcQV h0 eSWbS` VW\bS\ W\ RS` AQVZSWTS RSYZO`WS`b c\R O\USa^`c\US\ eS`RS\ Yr\\S\ 6W\eSWaS hc` :rac\U( :OPSZ aW\R W\ 8OdO \c` S`ZOcPb OZa
/\RS`S >`]U`O[[WS`a^`OQVS\ PWSbS\ SW\S\ 5=B=0STSVZ c[ A^`º\US W\\S`VOZP SW \Sa >`]U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 { 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\
import java.util.Scanner; public class Next04 { public static void main (String[] args) { Scanner cons = new Scanner(System.in); String ein = null; System.out.println("Bitte Text eingeben: "); while (cons.hasNext()) { ein = cons.next(); if (ein.equals("ende")) break; System.out.println("Eingabe ist " + ein); } System.out.println("Programmende"); } } 3a UWPb SW\WUS 8OdOAbO\RO`RYZOaaS\ RWS S\bVOZbS\ Tº` RWS 7bS`ObW]\ PSa]\RS`S ;SbV] RS\ RWS ROa >`]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`PSWbS\ O\ PSabSVS\ RS` A]TbeO`S \]beS\RWU EÉV`S\R RS` USaO[bS\ A]TbeO`S:SPS\ahSWb eW`R []RWTW hWS`b S`UÉ\hb ]RS` Y]``WUWS`b h0 c[ 4SVZS` hc PSaSWbWUS\ eSUS\ USÉ\RS`bS` /cTUO PS\abSZZc\U OcTU`c\R USaSbhZWQVS` Ò\RS`c\US\ cae 3W\ 7\RWh ROTº`( 2Oa 3W\a^WSZS\ d]\ C^RObSa c\R AS`dWQS^OQYa USVr`b hc RS\ abÉ\RWU eWSRS`YSV`S\RS\ 6Oc^bOcTUO PS\ RS` AgabS[dS`eOZbS` 2SaeSUS\ Wab Sa eWQVbWU ºPS`aWQVbZWQVS c\R ZSWQVb dS`abÉ\RZWQVS ?cSZZS\^`]U`O[[S hc aQV`SWPS\ 2WS \OQVT]ZUS\RS\ AbO\RO`Ra S\ba^`SQVS\ RS\ 3[^TSVZc\US\ RS` 8OdO3\beWQYZS` 2WSaS aW\R OcaTºV`ZWQV R]Yc[S\bWS`b W\ RS\ 8OdO 1]RS 1]\dS\bW]\a c\R Yr\\S\ ºPS` RWS /R`SaaS Wcc_)YPePbd]R^\S^RbR^STR^]e Y]abS\Z]a PSh]US\ eS`RS\
&&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
''
BcX[UaPVT]) :^]eT]cX^]T] id\ ?a^VaP\\XTabcX[
+SVLKNR[TMKTLXJOK7[KRRZK^ZJGZKO •
9][[S\bO`hSWZS\ hc 0SUW\\ /cTUOPS RS` 9ZOaaS PSaQV`SWPS\ DS`aW]\ RSTW\WS `S\ ESWbS`S 9][[S\bO`S W[[S` R]`b e] hcaÉbhZWQVS 3`ZÉcbS`c\US\ S`T]`RS` ZWQV aW\R eSWZ RS` ?cSZZbSfb OZZSW\ \WQVb OcaaOUSTÉVWU Wab
•
3W\S HSWZS a]ZZbS \WQVb [SV` OZa & HSWQVS\ S\bVOZbS\ RO[Wb RWS 0WZRaQVW`[O\hSW US c\R 2`cQYOcaUOPS ºPS`aWQVbZWQV PZSWPb
•
ES\\ SW\S ?cSZZS\RObSW [SV`S`S 9ZOaaS\ S\bVÉZb a] a]ZZbS RWS _dQ[XR1ZOaa RWS RWS \PX];SbV]RS S\bVÉZb RWS S`abS 9ZOaaS W\ RWSaS` C[eO\RZc\UaSW\VSWb aSW\
•
HeSW :SS`hSWZS\ heWaQVS\ RS\ SW\hSZ\S\ 9ZOaaS\ SW\S` ?cSZZRObSW) SW\S :SS`hSWZS heWaQVS\ RS\ ;SbV]RS\ SW\S` 9ZOaaS
•
:SS`abSZZS\ PZO\Ya heWaQVS\ RS\ SW\hSZ\S\ B]YS\ RS` 8OdOA^`OQVS SW\USPS\
•
3a UWPb SW\S PSa]\RS`S 4]`[ Tº` 9][[S\bO`S ROa aW\R RWS 2]Yc[S\bObW]\a Y][[S\bO`S AWS eS`RS\ PSU`S\hb Rc`QV c\R Yr\\S\ Rc`QV [WbUSZWS TS`bS B]]Za Sfb`OVWS`b c\R W\ SW\S` 6B;:2ObSW OcTPS`SWbSb eS`RS\ ÉV\ZWQV eWS RWS />72]Yc[S\bObW]\ ESWbS`S 7\T]`[ObW]\S\ c\bS` RS` /R`SaaS( http://java.sun.com/products/jdk/javadoc/
+SVLKNR[TMKT`[S)UJOKXYZORLX9ZGZKSKTZY •
5S\S`SZZ UWZb( 2WS AQV`SWPeSWaS [caa Y]\aWabS\b RV Rc`QVUSVS\R UZSWQV aSW\ h0 a]ZZS\ RWS @SUSZ\ hc[ 3W\`ºQYS\ \WQVb dO`WWS`S\ a]\RS`\ Y]\aS_cS\b PS \cbhb eS`RS\
•
2WS /\eSWac\US\ a]ZZS\ [rUZWQVab SW\TOQV aSW\ c\R RS[ [S\aQVZWQVS\ :SaS` SW\S\ c\[WbbSZPO`S\ 3W\PZWQY W\ WV`S /cTUOPS c\R EW`Yc\U USPS\ 2WSa UWZb PS a]\RS`a Tº` RWS AbScS`PSTSVZS 2Oa HcaO[[S\a^WSZ RS` SW\hSZ\S\ 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 OcQV RWS /caTºV`c\U aQV\SZZS` Wab /PS` aWS S`aQVeS`b RS[ [S\aQVZW QVS\ :SaS` ROa DS`abÉ\R\Wa Tº` RS\ ?cSZZbSfb >`]U`O[[S eS`RS\ VÉcTWUS` US ZSaS\ OZa USaQV`WSPS\ 2SaeSUS\ Wab Sa VÉcTWU PSaaS` RWS dS`abÉ\RZWQVS :O\U aQV`SWPeSWaS hc eÉVZS\
•
;O\QVS >`]U`O[[WS`S` \SWUS\ hc SZSUO\bS\ 4]`[cZWS`c\US\ e]PSW SZSUO\b RO\\ ZSWRS` \c` SW\S C[aQV`SWPc\U Wab Tº` c\dS`abÉ\RZWQVS c\R ]Tb TSVZS`O\TÉZZW US >`]U`O[[WS`b`WQYa Wab
+SVLKNR[TMKTLXJOK4GSKTY\KXMGHK •
2WS 8ST]cXUXTa T`SW USeÉVZbS
•
:[PbbT]]P\T] a]ZZbS\ Oca SW\S[ 6Oc^be]`b PSabSVS\ c\R W[[S` [Wb SW\S[ 5`]zPcQVabOPS\ PSUW\\S\ ES\\ [SV`S`S Er`bS` hcaO[[S\USaSbhb eS`RS\ a] PSUW\\b XSRSa E]`b [Wb SW\S[ 5`]zPcQVabOPS\ h0 1dUUTaTS8]_dcBcaTP\
•
'
(( merker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OQVS\ W\ RS` 2SaWU\ c\R @SOZWaWS`c\Ua^VOaS SW\US aSbhb eS`RS\ c\R eSZQVS D]` c\R
'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
(
7TaPdbU^aSTad]VT] d]S E^aVTWT]bfTXbT]
.KXG[YLUXJKX[TMKT[TJ
<WQVb eS\WUS >`]XSYbS aQVSWbS`\ 2WS 5`º\RS ROTº` aW\R PSYO\\b( [O\USZ\RS D]`PS `SWbc\U TSVZS\RS AgabS[ObWY c\ab`cYbc`WS`bS D]`USVS\aeSWaS US`W\US B`O\a^O`S\h D]` OZZS[ OPS`( SXT BhbcT\T fTaST] X\\Ta Z^\_[TgTa 2Oa [OU hc[ SW\S\ O\ RS` /cTUOPS\abSZZc\U ZWSUS\) VÉcTWU b`OUS\ OPS` c\`SOZWabWaQVS HWSZd]`abSZZc\US\ ROhc PSW ROaa >`]XSYbS UO` \WQVb ]RS` \c` [Wb hcaÉbhZWQVS[ \WQVb US^ZO\bS[ /cTeO\R hc 3\RS USTºV`b eS`RS\ Yr\\S\ >`]XSYbS aW\R aSZbS\ RO`O\ USaQVSWbS`b ROaa RWS :rac\ US\ W[ S`abS\ /\ZOcT c\d]ZZabÉ\RWU eO`S\ /PS` VÉcTWU PZWSPS\ U`]zS A]TbeO`S^`] XSYbS c\d]ZZS\RSb eSWZ UZSWQV hc 0SUW\\ hc dWSZ OcT SW\[OZ dS`acQVb ec`RS 2WS S`T]ZU`SWQVS @SOZWaWS`c\U d]\ 32D>`]XSYbS\ S`T]`RS`b RSaVOZP ^`ÉhWaS D]`PS`SW bc\U U`]zSa EWaaS\ dWSZ 3`TOV`c\U a]eWS agabS[ObWaQVSa /`PSWbS\ RS` BSO[[WbUZWS RS` PSW RS` @SOZWaWS`c\U <WQVb RWS 9`SObWdWbÉb RSa 3W\hSZ\S\ abSVb W[ D]`RS`U`c\R a]\RS`\ RWahW^ZW\WS`bSa /`PSWbS\ ]`WS\bWS`b O\ TSabS\ @SUSZ\ c\R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WbbaeSWaS Rc`QV Y]\Y`SbS =^S`ObW]\S\ dS`TSW\S`b c\R W[^ZS[S\bWS`b eW`R b]^R]e\3\bec`T 2Oa T]ZUS\RS 0SWa^WSZ a]ZZ RWSaSa D]`US VS\ RS[]\ab`WS`S\ 2WS /cTUOPS RSa >`]U`O[[a C^_3^f] YPeP Wab Sa SW\S HOVZ hc ^]bS\hWS`S\ 2WS 3W\UOPSRObS\ eS`RS\ d][ 0WZRaQVW`[ USZSaS\ c\R ROa 3`USP\Wa O[ 0WZRaQVW`[ OcaUSUSPS\ /Za] [caa ROa >`]U`O[[ T]ZUS\RS CTX[PdUVPQT] S`TºZ ZS\( 2ObS\ SW\ZSaS\ c\R ^`ºTS\ dS`O`PSWbS\ ^]bS\hWS`S\ OcaUSPS\ '!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
EW` hS`ZSUS\ RWS 5SaO[bOcTUOPS W\ SW\hSZ\S ;]RcZS XSRS RWSaS` BSWZOcTUOPS\ Wab SW\S SWUS\S ;SbV]RS 2WS 7[^ZS[S\bWS`c\U abO`bSb hc\ÉQVab \c` [Wb RS` \PX] ;SbV]RS S`UÉ\hb c[ RWS @SOZWaWS`c\U ]da TX]Tb RWSaS` ;]RcZS h0 _^cT]iXTaT] ?a^VaP\\ C^_3^f] P) 4abcTa BRWaXcc
class TopDown01a { public static void main(String[] args) { int erg = potenzieren(5,3); System.out.println(erg); } static int potenzieren(int z1, int z2) { int erg = z1; if (z2 == 0) return(1); for (; z2>1; z2--) { erg = erg * z1; } return erg; } } ES\\ RWSaSa @c[^T^`]U`O[[ Tc\YbW]\WS`b eW`R aQV`WbbeSWaS XSeSWZa SW\S eSWbS`S ;SbV]RS VW\hcUSTºUb c\R USbSabSb h0 W[ heSWbS\ AQV`Wbb RWS ;SbV]RS PdbVPQT c\R RO\OQV W[ R`WbbS\ AQV`Wbb RWS ;SbV]RS TX]VPQT S`UÉ\hb
ÎQd]VT] id\ ?a^VaP\\ C^_3^f] P 0WbbS dS`acQVS\ AWS aSZPababÉ\RWU RWS >`]U`O[[S B]^2]e\P S`UÉ\hb c[ RWS ;S bV]RS PdbVPQT c\R B]^R]e\Q S`UÉ\hb c[ RWS ;SbV]RS TX]VPQT hc S`abSZZS\ =`WS\bWS`S\ AWS aWQV ROPSW O\ RS[ T]ZUS\RS\ :rac\Uad]`aQVZOU Tº` ROa S\RUºZbWUS >`]U`O[[ ;»bd]Vbe^abRW[PV)
3Pb Z^\_[TccT ?a^VaP\\ TabcT[[c X] # BRWaXccT] PS import java.io.*; class TopDown01d { public static void main(String[] args) { System.out.println("Bitte eine Zahl als Basis eingeben: "); int basis = eingabe(); System.out.println("Bitte eine Zahl als Exponent eingeben: "); int exponent = eingabe(); int erg = potenzieren(basis, exponent); ausgabe(erg); } static int eingabe() {
'"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
(
7TaPdbU^aSTad]VT] d]S E^aVTWT]bfTXbT]
String str = null; try { str = new DataInputStream(System.in).readLine(); } catch (Exception e) { System.out.println(e); } return Integer.parseInt(str); } static int potenzieren(int z1, int z2) { int erg = z1; if (z2 == 0) return(1); for (; z2>1; 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]\
static int eingabe() { Scanner ein = new Scanner(System.in); int zahl = 0; try { zahl = ein.nextInt(); } catch (Exception e) { System.out.println(e); '#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
} return zahl; } k FPb bX]S VdcT ?a^VaP\\T. `]U`O[[agabS[S\ ROaa RWS >`]U`O[[S `WQVbWU Tc\YbW]\WS`S\ RV aWS a]ZZbS\ TSVZS`T`SW aSW\ EOa [OQVb RO` ºPS` VW\Oca SW\ UcbSa >`]U`O[[ Oca- 6WS` SW\WUS /\be]`bS\( • • • •
5cbS >`]U`O[[S a]ZZS\ PS\cbhS`T`Sc\RZWQV SW\TOQV c\R `]Pcab aSW\ 5cbS >`]U`O[[S a]ZZS\ ºPS`aWQVbZWQV c\R Tº` RS\ ;S\aQVS\ ZSWQVb ZSaPO` aSW\ 5cbS >`]U`O[[S a]ZZS\ eWSRS`dS`eS\RPO` c\R ^]`bOPSZ aSW\ 5cbS >`]U`O[[S a]ZZS\ STTWhWS\b aSW\ aQV\SZZ [Wb eS\WU A^SWQVS`PSRO`T
3a UWPb \Obº`ZWQV AWbcObW]\S\ e] RWS 3TTWhWS\h SW\Sa >`]U`O[[a ROa eWQVbWUabS 9`WbS `Wc[ Wab `SOZbW[SAgabS[S 7\ RS` @SUSZ aW\R XSR]QV RWS O\RS`S\ HWSZS eWQVbWUS`( 2WS 0S\cbhS`OYhS^b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S 3W\VSWb PWZRS\ c\R RS`S\ /cTUOPS [Wb [rUZWQVab SW\S[ E]`b PSaQV`WSPS\ eS`RS\ YO\\
'$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
(
7TaPdbU^aSTad]VT] d]S E^aVTWT]bfTXbT]
•
3W\aObh SW\S` PSU`S\hbS\ /\hOVZ d]\ AbScS`PSTSVZS\ AS_cS\h /ZbS`\ObWdS c\R EWSRS`V]Zc\U
•
DS`[SWRc\U d]\ A^`c\UPSTSVZS\ RWS hc a] US\O\\bS[ A^OUVSbbWQ]RS TºV`S\ 7\ 8OdO eS`RS\ A^`º\US W[ >`]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 RWS abObWaQVS <WSRS`aQV`WTb SW\S` ;SbV]RS [rUZWQVab ºPS`SW\abW[[S\ [Wb RS[ Rg\O[WaQVS\ /PZOcT RSa >`]U`O[[a
•
2WS Ab`cYbc`PZrQYS VOPS\ \c` SW\S\ 3W\UO\U Wab W\ 8OdO OcQV \WQVb O\RS`a [rU ZWQV A]ZZbS SW\ 0Z]QY [SV`S`S /caUÉ\US VOPS\ QaTPZ aTcda] R^]cX]dT a] Wab RWSa S\ba^`SQVS\R hc YS\\hSWQV\S\
•
3W\S PSa]\RS`S ;rUZWQVYSWb RS` /PZOcTabScS`c\U VOb RS` 8OdO>`]U`O[[WS`S` Rc`QV a^ShWSZZS A^`OQV[WbbSZ c[ ;SbV]RS\ ^O`OZZSZ OcaTºV`S\ hc ZOaaS\ ;cZbW BV`SORW\U 2WSa Wab SW\ BVS[O Tº` 4]`bUSaQV`WbbS\S
•
2S` >`]U`O[[WS`c\U W[ AW\\S d]\ 9]RWS`S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cZraS\ <WQVb OZZS HWSZS aW\R UZSWQVhSWbWU S``SWQVPO` 6ÉcTWU ZSWRSb RWS ?cOZWbÉb eSWZ RWS HSWb Y\O^^ eW`R =RS` RWS 9]abS\ S`VrVS\ aWQV PSW VrVS`S[ HSWbOcTeO\R 2WS /cTUOPS RS` DS`O\be]`bZWQVS\ Wab Sa ROa =^bW[c[ hc TW\RS\ @dP[XcÊc bXRWTa] HSWbR`cQY RO`T \WQVb ROhc TºV`S\ ROaa RWS ?cOZWbÉb ZSWRSb ES\\ RWS ?cOZWbÉb RSa \ScS\ AgabS[a c\hc`SWQVS\R Wab ZSWRSb S\beSRS` RWS /YhS^bO\h eSWZ RS` /cTeO\R Tº` RS\ `]U`O[[S U`rzS` ]RS` c\PST`WSRWUS\R Wab ]RS` Sa [caa \OQV USPSaaS`b eS`RS\ C\R PSWRSa eW`R eOV`aQVSW\ZWQV bSc`S` =XRWc b_PaT] PdU
:^bcT] STa @dP[XcÊc
A]TbeO`SagabS[S aW\R W\ RS` @SUSZ dWSZS 8OV`S W[ 3W\aObh <]QV VScbS eS`RS\ >`] U`O[[S US\cbhb RWS d]` 8OV`hSV\bS\ S`abSZZb e]`RS\ aW\R C\bS`acQVc\US\ ºPS` A]TbeO`SY]abS\ VOPS\ S`USPS\ ROaa RWS 9]abS\ Tº` RWS EO`bc\U d]\ >`]U`O[[S\ RWS 3`abSZZc\UaY]abS\ VÉcTWU ºPS`abSWUS\ `]PZS[ RS` A]TbeO`SS\beWQYZc\U Wab RS` 9O[^T [Wb RS` 9][^ZSfWbÉb 2WS \ScS\ /\eS\Rc\US\ eS`RS\ W[[S` U`rzS` W[[S` O\a^`cQVad]ZZS` 5`OTWY 0SRWS\S`Y][T]`b W\bS`\ObW]\OZS` c\R aW\R W[[S` abÉ`YS` dS`\Sbhb 7\bS`\Sb c\R 9][^]\S\bS\bSQV\]Z]UWS\ AW\R a]ZQVS /\eS\Rc\US\ RWS Rc`QVOca Oca SW\WUS\ ;WZZW]\S\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Sa OZa RWS ^S`T]`[O\QS RSa >`]U`O[[a
2WS idZ¶]UcXVT 5SP`OcQVaTÉVWUYSWb PSaQV`SWPb SW\S`aSWba RWS 1VO\QS\ Tº` RWS EWS RS`dS`eS\RPO`YSWb c\R O\RS`S`aSWba RWS EO`bc\UaT`Sc\RZWQVYSWb RSa >`]U`O[[a FXTSTaeTafT]SQPaZTXc •
8S OZZUS[SW\UºZbWUS` ROa >`]U`O[[ S`abSZZb e]`RS\ Wab c[a] PSaaS` aW\R RWS ;rUZWQVYSWbS\ hc` EWSRS`dS`eS\Rc\U
?^acPQX[XcÊc •
2O[Wb RS` hcYº\TbWUS 3W\aObh RS` A]TbeO`S \WQVb d]\ d]`\VS`SW\ SW\USU`S\hb eW`R a]ZZbS\ RWS >`]U`O[[S YSW\S a^ShWTWaQVS\ 3WUS\O`bS\ SW\S` a^ShWSZZS\ >ZObb T]`[ Oca\cbhS\ h0 a]ZZbS YSW\S >`]U`O[[WS`a^`OQVS USeÉVZb eS`RS\ RWS \c` OcT PSabW[[bS\ AgabS[S\ ZOcTTÉVWU Wab
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
(!
<^ST[[T ida E^aVTWT]bfTXbT
3UJKRRK`[X
A]TbeO`S3\beWQYZc\U S`T]ZUb aQV`WbbeSWaS Sa PSUW\\b [Wb RS` >`]RcYbRSTW\WbW]\ RO \OQV S`T]ZUb RWS @SOZWaWS`c\U c\R \OQV RS[ S`T]ZU`SWQVS\ BSabS\ RS` /\eS\Rc\U [caa ROa >`]U`O[[agabS[ O\ RWS >`]RcYbW]\ac[USPc\U ºPS`USPS\ W[^ZS[S\ bWS`b eS`RS\ ASWb 0SUW\\ RS` >`]U`O[[WS`bÉbWUYSWb d]\ SW\WUS\ 8OV`hSV\bS\ ec`RS\ W[[S` eWSRS` \ScS >`W\hW^WS\ c\R ;SbV]RS\ S\beWQYSZb RWS RWSaS\ A]TbeO`S 3\beWQYZc\Ua^`]hSaa agabS[ObWaWS`S\ c\R abO\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QVS\ eS`RS\ [Wb RS[ 6S`abSZ ZS\ d]\ ;]RcZS\ OZa 7\Rcab`WS^`]RcYbS <]beS\RWU aW\R •
?aX]iX_XT] RWS OZZUS[SW\ O\S`YO\\b aW\R c\R
•
6XOT`OVOKTJKX'T]KTJ[TMYKTZ]OIQR[TM >`W\hW^WS\ aW\R OZZUS[SW\ UºZbWUS 5`c\RaÉbhS RWS RWS D]`USVS\aeSWaS PSW RS` 3\b eWQYZc\U bVS]`SbWaQV PSaQV`SWPS\( ?aX]iX_ STb ?a^c^ch_X]V •
2WS /\eS\RS` a]ZZbS\ U`c\RaÉbhZWQV a] eSWb eWS [rUZWQV PSbSWZWUb eS`RS\ O[ 3\bec`T RSa \ScS\ AgabS[a c\R PSW[ 3\beWQYSZ\ RS` /\eS\Rc\Ua[]RcZS 2WSa USVb O[ PSabS\ Rc`QV RS\ 3W\aObh d]\ ;]RSZZS\ >`]b]bg^S\ 3W\ >`]b]bg^ Wab heO` SW\ OPZOcTTÉVWUSa ;cabS` RSa HWSZagabS[a S`TºZZb OPS` \]QV \WQVb RWS Y][ ^ZSbbS\ /\T]`RS`c\US\ !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
2S` D]`bSWZ RWSaS` D]`USVS\aeSWaS PSabSVb RO`W\ ROaa RS` 3\RPS\cbhS` SW\S\ S`abS\ 3W\R`cQY PSY][[b eWS ROa AgabS[ Tc\YbW]\WS`S\ a]ZZ 2SaWU\TSVZS` Yr\\S\ c C `SQVbhSWbWU S`YO\\b eS`RS\ c\R RS` 3\beWQYZS` YO\\ RS\ /cT eO\R c\R RWS ;OQVPO`YSWb OPaQVÉbhS\ 2WS 3`abSZZc\U RSa S\RUºZbWUS\ HWSZaga bS[a S`T]ZUb RO\\ Rc`QV Sd]ZcbW]\É`S 3\beWQYZc\U
?aX]iX_ STa 0QbcaPZcX^]
•
2WSa Wab SW\S OZZUS[SW\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\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\ae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( 2S` 0Z]QY eW`R [W\R SW\[OZ Rc`QVZOcTS\ S`ab RO\OQV eW`R US^`ºTb ]P RWS 0SRW\Uc\U S` TºZZb Wab c SdbZ eWSRS`V]Zb eW`R
5^aBRW[TXUT HÉVZaQVZSWTS) W[ 9]^T abSVS\ RWS 7\WbWOZWaWS`c\U RWS /P P`cQVPSRW\Uc\U c\R RWS 7\ Y`S[S\bWS`c\U
/PP'!( 3W\WUS AW\\PWZRS` \OQV 27< $$ $ Ab`cYb]U`O[[S
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
2Oa \OQVT]ZUS\RS 0SWa^WSZ hSWUb SW\S :rac\UaPSaQV`SWPc\U Tº` ROa 3``SQV\S\ RS` 4OYcZbÉb OZa] Tº` RWS 3`[WbbZc\U SW\Sa >`]RcYba Oca \Obº`ZWQVS\ HOVZS\ h0 Wab RWS 4OYcZbÉb d]\ " UZSWQV ! " RV OZa] "
BcadZc^VaP\\) 4aaTRW]T] STa 5PZd[cÊc e^] ] z := 1
f := 1
Solange z <= n
f := f*z
z := z + 1
Ergebnis = f
/PP '"( 2O`abSZZc\U RSa /ZU]`WbV[ca Tº` ROa 3``SQV\S\ RS` 4OYcZbÉb ÎQd]V) 0WbbS Q]RWS`S\ AWS RWS /cTUOPS RWS W\ RS` /PP '" OZa Ab`cYb]U`O[[ PS aQV`WSPS\ Wab W\ 8OdO ;»bd]Vbe^abRW[PV U¶a ] , #)
public class Fakultaet { public static void main(String[] args) int z = 1; int f = 1;
{
while (z <= 4) { f = f * z; z++; } System.out.println(f); } }
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
($
4]cfdaUbb_aPRWT]
6YK[JUIUJK 3W\S dS`POZS YSW\S U`OTWaQVS 3\bec`Taa^`OQVS ;Wb c[UO\Uaa^`OQVZWQVS\ 4]`[cZWS `c\US\ eS`RS\ 2ObS\ c\R 9]\b`]ZZab`cYbc`S\ P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class Kaefer01 { public static void main(String[] args) throws Exception { for (int spinne=1; spinne<10; spinne++) for (int kaefer=1; kaefer<15; kaefer++) if ((spinne * 8) + (kaefer * 4) == 64) System.out.printf("Kaefer = %d, Spinne =%d \n", kaefer, spinne); } }
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
+TZYINKOJ[TMYZGHKRRKT 3W\S 3\baQVSWRc\UabOPSZZS 3B Wab SW\S ;Ob`Wf Oca E3<<2/<<0ShWSVc\US\ AWS Wab Ucb USSWU\Sb eS\\ [SV`S`S /YbW]\S\ RWS d]\ 0SRW\Uc\US\ OPVÉ\US\ O\OZg aWS`b RO`USabSZZb c\R OcT D]ZZabÉ\RWUYSWb ºPS`^`ºTb eS`RS\ [ºaaS\ 2WS 3\baQVSWRc\Ua^`]hSRc`S\ eS`RS\ W\ bOPSZZO`WaQVS` 4]`[ RO`USabSZZb 7\ RS` S`a bS\ A^OZbS RS` BOPSZZS eS`RS\ hc\ÉQVab OZZS 1TSX]Vd]VT] OcTUSTºV`b [Wb OZZS\ 9][PW\ObW]\S\ RWS [rUZWQV aW\R 2S` c\bS`S BSWZ RS` 0ZcX^]bcTX[ S\bVÉZb RWS /cT hÉVZc\U OZZS` ;Oz\OV[S\ RWS USb`]TTS\ eS`RS\ eS\\ OZZS 0SRW\Uc\US\ SW\S` A^OZ bS hcb`STTS\ 7\ RS\ eSWbS`S\ A^OZbS\ eS`RS\ RO\\ OZZS @SUSZ\ OcTUSTºV`b
@SUSZ @SUSZ @SUSZ @SUSZ\
0SRW\Uc\U 8
8
<
0SRW\Uc\U 8
<
<
0SRW\Uc\U! 8
<
<
/YbW]\
F
F
/YbW]\
F
/YbW]\!
F
/PP'#( /cTPOc SW\S` 3\baQVSWRc\UabOPSZZS 2WS 0SRW\Uc\UaO\hSWUS` PSaQV`SWPS\ RWS XSeSWZWUS\ @SUSZ\ RWS RO\\ a^OZbS\eSW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PSZZS W\ >`]U`O[[Q]RS aSV` SW\TOQV SdbZ OcQV [OaQVW\SZZ Rc`QV 3B5S\S`Ob]`S\ [rUZWQV Wab 6ÉcTWU Wab SW\S 1]RWS`c\U [Wb 4OZZc\bS`aQVSWRc\U AE7B161/A3 [rU ZWQV O\RS`\TOZZa TºV`b XSRS @SUSZ hc SW\S[ 3:A3HeSWU 2S` `] U`O[[a USSWU\Sb aW\R \É[ZWQV \c` Tº` /ZbS`\ObWdS\ c\R \WQVb h0 Tº` RWS /\OZgaS c\R 2O`abSZZc\U d]\ AQVZSWTS\
#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
1USVRKZZHKOYVOKR
0dUVPQT]bcT[[d]V) :[TX]bcT e^] SaTX IPW[T] Ta\XccT[] D]\ RS\ R`SW HOVZS\ h h h! Wab RWS YZSW\abS OcahceÉVZS\ 0SW 5ZSWQVVSWb S\baQVSW RSb RWS VrVS`S >`W]`WbÉb( h VOb RWS VrQVabS c\R h! RWS \WSR`WUabS >`W]`WbÉb 7ab h Oca USeÉVZb S`T]ZUb RWS DS`O`PSWbc\U W\ / PSW h W\ 0 c\R PSW h! W\ 1 ÎQd]V)
•
EWS eW`R RWSaS ÍPc\U W[ ?bTdS^R^ST PSaQV`WSPS\-
•
EWS aWSVb ROa BcadZc^VaP\\ Oca-
•
EWS aWSVb RS` ?a^VaP\\PQ[PdU Oca-
•
EWS aWSVb RWS 4]cbRWTXSd]VbcPQT[[T Oca-
•
EWS eº`RS [O\ RWS 3\baQVSWRc\UabOPSZZS W\ 9PeP Q]RWS`S\-
;»bd]Vbe^abRW[PV U¶a ?bTdS^R^ST
if (z1 nicht größer z2) AND (z1 nicht größer z3) Ausführung A else if (z2 nicht größer z3) Ausführung B else Ausführung C ;»bd]Vbe^abRW[PV U¶a 4]cbRWTXSd]VbcPQT[[T O D]ZZabÉ\RWUS 3\baQVSWRc\UabOPSZZS
i +, i!
9
9
9
9
= = = =
i +, i"
9
9
= = 9
i! +, i"
9
= 9
= 9
= 9
=
1[^RZ 0
G
G
1[^RZ 1
G
G
1[^RZ 2
G
9
= =
G
/PP '&( D]ZZabÉ\RWUS 3B hc` 3`[WbbZc\U RS` YZSW\abS\ HOVZ $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
(%
:^\_[TccQTXb_XT[
P 3\baQVSWRc\UabOPSZZS [Wb R]\b QO`S
i +, i!
9
=
i +, i"
9
i! +, i"
9
1[^RZ 0
G
1[^RZ 1
G
1[^RZ 2
G
/PP ''( 3B hc` 3`[WbbZc\U RS` YZSW\abS\ HOVZ dS`Yº`hb
;»bd]Vbe^abRW[PV
U¶a
BcadZc^VaP\\
Einlesen z1,z2,z3
z1<=z2 && z1<=z3 Ja
Nein z2<=z3 Nein
Ja
A
B
C
/PP '(
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
;»bd]Vbe^abRW[PV U¶a ?a^VaP\\PQ[PdU_[P] ja Block A
z1 <= z3
z1<=z2
nein
z2 <= z3
Block C
Block B
/PP'( >/> hc` 3`[WbbZc\U RS` YZSW\abS\ HOVZ
2^SXTad]V X] 9PeP) 4a\Xcc[d]V STa Z[TX]bcT] IPW[ e^] i i! d]S i"
public class KleinsteZahl { public static void main(String[] args) int z1, z2, z3; z1 = 20; z2 = 11; z3 = 10;
{
if (z1 <= z2 && z1 <= z3) System.out.println("Block-A wird ausgeführt"); else if (z2 <= z3) System.out.println("Block-B wird ausgeführt"); else System.out.println("Block-C wird ausgeführt"); } }
&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
3KZNUJKTKXQRoXKTOSVRKSKTZOKXKT[TJHKT[Z`KT
7\ 8OdO YO\\ SW\ /\eSWac\UaPZ]QY SW\S\ `]U`O[[WS`a^`OQVS\ OcQV OZa C\bS`^`]U`O[[S >`]hS Rc`S\ AcP`]cbW\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RS\ 9O^WbSZ eW`R RO\\ OcTPOcS\R OcT RS\ 3`YS\\b\Wa aS\ RWS AWS W\ RWSaS[ 9O^WbSZ USe]\\S\ VOPS\ ROa /`PSWbS\ [Wb 9ZOaaS\ c\R [Wb RS\ ROhcUSVr`S\RS\ 7\abO\h;SbV]RS\ OcaTºV`ZWQV PSVO\RSZb '
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
=GYYOTJ3KZNUJKT%
3W\S ;SbV]RS Wab SW\S 0STSVZaU`c^^S SW\ >`]U`O[[PZ]QY RWS SW\S\ `]U`O[[abScS`c\U eWSRS` hc`ºQY O\ RWS AbSZZS RSa /cT`cTa /cT`cT RS` ;SbV]RS( gQTaTRW]T]*
/`Uc[S\bS
3`USP\Wa
PS`SQV\S\ OcaTºV`S\ `Sbc`\)
/PP ( EWS S`T]ZUb RWS >`]U`O[[abScS`c\U PSW SW\S[ ;SbV]RS\OcT`cT- 0SW RS[ /cT`cT Yr\\S\ ES`bS O\ RWS ;SbV]RS ºPS`USPS\ eS`RS\ ;Wb RWSaS\ 2ObS\ YO\\ W\\S`VOZP RS` ;SbV]RS USO`PSWbSb eS`RS\
methodenkopf { Methodenblock }
3KZNUJKTQUVLNKGJKX[TJ3KZNUJKTHRUIQHUJ_
7[ O`O[SbS` PS aQV`WSPS\ eS`RS\ c\R RS` 2ObS\bg^ RSa 3`USP\WaaSa TSabUSZSUb eW`R 2WS >O`O[SbS` eS`RS\ c\[WbbSZPO` VW\bS` RS[ `]U`O[[ S\bVÉZb [W\RSabS\a SW\S ;SbV]RS \É[ZWQV RWS ;SbV]RS [Wb RS[
public class Methode01 { public static void main (String[] args) System.out.println(args[0]); } }
{
// Kopf // Block
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
FPb bX]S
7\ RS` S`abS\ HSWZS eW`R RWS 9ZOaaS RSTW\WS`b 7ab RWS 9ZOaaS SW\ OcaTºV`PO`Sa >`] U`O[[ a] Wab RS` 9ZOaaS\\O[S [Wb RS[ >`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`cTS\ Tº` PSabW[[bS =PXSYbS 3W\ ;SbV]RS\OcT`cT eW`R OcQV PShSWQV\Sb OZa ROa AS\RS\ d]\
objekt.methode(parameter);
?a^VaP\\ QYTZcT class Methode02 { public static void main (String[] args) { String zeile = new String("Dies ist ein Satz"); String wort = zeile.substring(9,12); System.out.println(wort); } }
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
4º` RS\ ;SbV]RS\OcT`cT aW\R OZa] R`SW /\UOPS\ S`T]`RS`ZWQV( •
QYTZcb VWS`( iTX[T
•
•
ES`b RS` ?PaP\TcTa VWS`( ( !
=PXSYb\O[S c\R ;SbV]RS\\O[S eS`RS\ Rc`QV SW\S\ >c\Yb USb`S\\b ?d]Zc]^cP cX^] 2Oa =PXSYb eW`R OcQV 3fS[^ZO` ]RS` 7\abO\h SW\S` 9ZOaaS US\O\\b 3a [caa d]`VS` S`hScUb eS`RS\ [Wb RS[ AQVZºaaSZe]`b ]Tf 0SWa^WSZ(
String str = new String("Dies ist ein Satz");
C[ ;SbV]RS\ SW\S` O\RS`S\ 9ZOaaS OcThc`cTS\ [caa RS` 7RS\bWTWS` RSa =PXSYba RS[ ;SbV]RS\\O[S\ d]`O\USabSZZb eS`RS\ 7\\S`VOZP RS` 9ZOaaS US\ºUb RWS /\UOPS RSa ;SbV]RS\PShSWQV\S`a ]V\S eSWbS`S ?cOZWTWhWS`S`
3OZMKROKLKXZK3KZNUJKTHKT[Z`KT
ES\\ SW\S ;SbV]RS OcTUS`cTS\ eS`RS\ a]ZZ a] [caa RS`S\ AQV\WbbabSZZS PSYO\\b aSW\ RV RS` /cT`cTS` [caa \WQVb \c` RS\ O`O[SbS` RWS ;SbV]RS S`eO`bSb c\R eOa aWS OZa 3`USP\Wa O\ WV\ hc`ºQY ZWS TS`b 2WS AbO\RO`R0WPZW]bVSY RS` 8 A3 S\bVÉZb SW\WUS BOcaS\R 9ZOaaS\ RWS hc[ 0OaWa A^`OQVc[TO\U d]\ 8OdO USVr`S\ 8SR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W\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
'XHKOZKTSOZ3KZNUJKTJKXSOZMKROKLKXZKT1RGYYK8GTJUS 3a UWPb RWS 9ZOaaS AP]S^\ RS`S\ 2WS\abZSWabc\U RO`W\ PSabSVb HcTOZZahOVZS\ hc S` hScUS\ c\R ;SbV]RS\ PS`SWb hc abSZZS\ c[ RO[Wb hc O`PSWbS\ 2WS />7 2]Yc[S\bObW]\ S\bVÉZb XSeSWZa OcaTºV`ZWQVS 0SaQV`SWPc\US\ RS` 9ZOaaS\SZS[S\bS 8SR]QV Wab RWS Y][^ZSbbS 2]Yc[S\bObW]\ \c` W\ S\UZWaQVS` A^`OQVS dS`TºUPO` A] Wab SW\S bg^WaQVS ;SbV]RS RS` @O\R][9ZOaaS W\ RS` />72]Yc[S\bObW]\ eWS T]ZUb PSaQV`WSPS\( int nextInt(int n) Returns a pseudorandom, uniformly distributed int value be-
tween 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence. 2WS S`abS HSWZS Wab WRS\bWaQV [Wb RS[ 9]^T RS` ;SbV]RS c\R RWS HSWZS\ RO\OQV S` ZÉcbS`\ dS`POZ RWS 4c\YbW]\ RWSaS` ;SbV]RS /ca RS[ 9]^T YO\\ [O\ S`YS\\S\( •
EWS VSWzb RWS ;SbV]RS-
•
ESZQVS 3W\UO\Ua^O`O[SbS` PS\rbWUb RWS ;SbV]RS-
/\e]`b( SW\S\ X]cES`b
•
ESZQVS\ 3`USP\Wabg^ ZWSTS`b RWS ;SbV]RS(
/\e]`b( SW\S\ X]cES`b
/\be]`b( ]Tgc8]c
2WS 3`ZÉcbS`c\US\ ROhc PSaQV`SWPS\ ROaa RWS ;SbV]RS SW\S\ @O\R][ES`b ZWSTS`b RS` heWaQVS\ W\YZcaWdS c\R RS[ a^ShWTWhWS`bS\ >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
Hc` 2]Yc[S\bObW]\ SW\S` ;SbV]RS USVr`b RWS 0SaQV`SWPc\U RS` AQV\WbbabSZZS 2O[Wb eW`R TSabUSZSUb eSZQVS 7 /^^ZWQObW]\ >`]U`O[[S` 7\bS`TOQS c\R [SW\b RO[Wb SW\S AO[[Zc\U d]\ ;SbV]RS\aWU\Obc`S\ Hc` AWU\Obc` USVr`S\( • •
]aWbW]\ RS` >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 ))
?a^VaP\\ `]U`O[[ W\ HSWZS " ZOcbSb( generator.nextInt(50); /cQV aWS S\bVÉZb eWSRS` RWS R`SW 0SabO\RbSWZS 7\abO\h\O[S ;SbV]RS\\O[S >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[[ a] ROaa [Wb RS[ X\_^acAbObS[S\b USO`PSWbSb eW`R
'XHKOZKTSOZ3KZNUJKTJKXSOZMKROKLKXZKT1RGYYK6XOTZ9ZXKGS 2Oa \OQVT]ZUS\RS 0SWa^WSZ `]U`O[[WS`S` \WQVb aSZPab S`hScUb VOb a]\RS`\ RWS W\ XSRS[ >`]U`O[[ W[^ZWhWb hc` DS`TºUc\U abSVb( BhbcT\^dc 3a VO\RSZb aWQV ROPSW c[ SW\S 9ZOaaS\dO`WOPZS [Wb RS[ QYTZc QT]dciT] id\
{
7[ >`]U`O[[ O`O[SbS` abSVb W\ RS` DO`WOPZS\ PaVbJL 2WS DO`WOPZS PaVbJL Wab SW\ /``Og aWSVS 9O^WbSZ ! aWS S\bVÉZb RWS /cT`cT^O`O[SbS` RWS PSW[ AbO`b RSa >`]U`O[[a ºPS`USPS\ e]`RS\ aW\R "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! <XcVT[XTUTacT
ÎQd]V id\ ?a^VaP\\ 72]Yc[S\bObW]\ eSZQVS\ 2ObS\bg^ ROa 4SZR BhbcT\^dc VOb 2Ohc Wab RWS 0SaQV`SWPc\U RS` 9ZOaaS BhbcT\ hc O\OZgaWS`S\ ÎQd]V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Sa >`]U`O[[a ºPS` 1][[O\RZW\S <»V[XRWZTXc !) /cT`cT W[ 8=3 0SW[ /`PSWbS\ [Wb RS[ 8OdO3RWb]` 8=3 S`aQVSW\b \OQV RS[ /cT`cT RSa ;S\c^c\Yba JAVA|Starten mit Argumenten SW\ 4S\abS` Tº` RWS 3W\UOPS RS` /`Uc[S\bS ESWbS`S 6W\eSWaS hc[ /`PSWbS\ [Wb /`Uc[S\bS\ PSW[ AbO`b SW\Sa >`]U`O[[a( 2WS 2ObS\ eS`RS\ W[[S` OZa Ab`W\UBg^S\ PSVO\RSZb ES\\ W[ >`]U`O[[ [Wb /`Uc[S\ bS\ USO`PSWbSb eW`R RO\\ [ºaaS\ OcQV S\ba^`SQVS\RS ES`bS ºPS`USPS\ eS`RS\ O\RS`\TOZZa UWPb Sa 4SVZS` PSW RS` /caTºV`c\U RSa >`]U`O[[a 7[ 9O^WbSZ ! /``Oga UWPb Sa OcaTºV`ZWQVS 0SWa^WSZS hc RWSaS[ BVS[O #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'XHKOZKTSOZ3KZNUJKTJKXSOZMKROKLKXZKT1RGYYK3GZN 7\ RS` [WbUSZWSTS`bS\ 9ZOaaS
Returns the greater of two int values 2WS S`abS 0Sa]\RS`VSWb Wab ROa AQVZºaaSZe]`b bcPcXR W[ 9]^T RS` ;SbV]RS 2O[Wb Wab TSabUSZSUb ROaa RWSaS ;SbV]RS SW\S a] US\O\\bS 9ZOaaS\[SbV]RS Wab AWS YO\\ PS \cbhb eS`RS\ ]V\S ROaa d]`VS` SW\S 7\abO\h S`hScUb eS`RS\ [caa 9ZOaaS\[SbV] RS\ aW\R O\ RWS 9ZOaaS c\R \WQVb O\ SW\hSZ\S 7\abO\hS\ USPc\RS\ 2WS AWU\Obc` RWSaS` ;SbV]RS PSaQV`SWPb OczS`RS[ ROaa aWS heSW UO\hhOVZWUS /`Uc [S\bS S`eO`bSb <WQVb S`YS\\PO` Wab RWS AS[O\bWY OZa] RWS EW`Yc\U RSa /cT`cTa 2WS aS Wab dS`POZ W\ RS` 2]Yc[S\bObW]\ PSaQV`WSPS\ c\R eW`R OZa A^ShWTWYObW]\ PS hSWQV\Sb 2S` /cT`cT Tº` RWS /caTºV`c\U RWSaS` ;SbV]RS [caa RS` AWU\Obc` S\ba^`S QVS\ ROa eW`R ºPS`^`ºTb d][ 1][^WZS` 2Oa DS`VOZbS\ RS` ;SbV]RS [caa ºPS`SW\ abW[[S\ [Wb RS` A^ShWTWYObW]\ ROa YO\\ [OaQVW\SZZ \WQVb ºPS`^`ºTb eS`RS\ 2WS ;SbV]RS ZWSTS`b SW\S\ X]cES`b hc`ºQY ?a^VaP\\ `]U`O[[ a] ROaa [Wb 6WZTS SW\S` ;SbV]RS RS` 9ZOaaS OQYOUSa YPeP[P]V 2WSaSa >OYSb Wab W\ XSRS[ 8OdO >`]U`O[[ PSYO\\b ]V\S ROaa RS` >`]U`O[[WS`S` RWSa Sf^ZWhWb O\USPS\ [caa /ZZS O\RS`S\ >OQYOUSa [ºaaS\ OcaR`ºQYZWQV Rc`QV SW\S a^ShWSZZS /\eSWac\U RWS X\_^ac /\eSWac\U W[ >`]U`O[[ PSYO\\b US[OQVb eS`RS\ RO[Wb SW\ HcU`WTT OcT RWS 9ZOa aS\ RWSaSa >OYSbSa [rUZWQV Wab 3W\S O\RS`S ;rUZWQVYSWb Wab RWS d]ZZ_cOZWTWhWS`bS
$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! <XcVT[XTUTacT
'XHKOZKTSOZ3KZNUJKTJKXSOZMKROKLKXZKT1RGYYK9_YZKS
3W\S VÉcTWU PS\cbhbS 9ZOaaS Wab RWS 9ZOaaS BhbcT\ AWS S\bVÉZb dS`aQVWSRS\S \ºbhZWQVS 4SZRS` c\R ;SbV]RS\ /ZZS ;S[PS` aW\R bcPcXR OZa] 9ZOaaS\[S[PS` RWS PS\cbhb eS`RS\ Yr\\S\ ]V\S d]`VS` SW\S 7\abO\h hc S`hScUS\ C[ RWSaS ;S[PS` hc `STS `S\hWS`S\ [caa RWS DO`WOPZS ]RS` RWS ;SbV]RS _cOZWTWhWS`b eS`RS\ [Wb RS[ 9ZOaaS\ \O[S\ h0 BhbcT\]cb ]RS` BhbcT\USbASQc`Wbg;O\OUS` 2Oa T]ZUS\RS >`]U`O[[ PS\cbhb RWS AgabS[YZOaaS heSW[OZ \É[ZWQV PSW[ /cT`cT RS` ;SbV]RS VTc?a^_Tach c[ RS\ 0S\cbhS`\O[S\ RSa AgabS[a hc S`[WbbSZ\ c\R RO\\ PSW RS` /caUOPS [Wb _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 ))
2c`QV RS\ 3W\aObh d]\ E`O^^S`9ZOaaS\ S`VÉZb RS` >`]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 ))
"
9INGINZKRT[TJ
2S` d]`VS`WUS :rac\Uad]`aQVZOU hSWUb eWS ;SbV]RS\OcT`cTS USaQVOQVbSZb eS`RS\ Yr\\S\ 3W\S AQVOQVbSZc\U YO\\ T]ZUS\RS\ /cTPOc VOPS\(
object.methode1(object.methode2());
2Oa S\ba^`WQVb RS[ /caR`cQY RSa ZSbhbS\ AbObS[S\ba 2]`b Wab RWS ;SbV]RS c^ 7TgBcaX]V BSWZ RSa >O`O[SbS`OcaR`cQYa Tº` RWS ;SbV]RS _aX]c[] 5SYZO[[S`bS /ca R`ºQYS eS`RS\ W[[S` hcS`ab OcTUSZrab RV Sa eW`R d]\ W\\S\ \OQV OczS\ USO`PSW bSb c\R RO\\ eS`RS\ RWS /cT`cTS d]\ ZW\Ya \OQV `SQVba OPUSO`PSWbSb 3W\ 0SWa^WSZ Tº` RWS DS`YSbbc\U d]\ [SV`S`S\ ;SbV]RS\OcT`cTS\ RWS ]PRWTX]P]STa OcaUSTºV`b eS`RS\ S\bVÉZb ROa T]ZUS\RS 0SWa^WSZ ?a^VaP\\ 1XV3TRX\P[ ) ETaZTccd]V e^]
} 6WS` VOb RWS DS`YSbbc\U W\ RS` ZSbhbS\ HSWZS RS\ T]ZUS\RS\ /cTPOc W\\S`VOZP RS` 9ZO[[S`(
object.methode1().methode2().methode3();
2WS D]`OcaaSbhc\U Tº` RWSaS /`b RS` DS`YSbbc\U d]\ ;SbV]RS\ Wab ROaa ;SbV]RS c\R ;SbV]RS XSeSWZa SW\ =PXSYb SW\S @STS`S\hdO`WOPZS OZa 3`USP\Wa ZWSTS`\ 7X]fTXbT id\ X\_^acBcPcT\T]c 2WS S`abS HSWZS RSa >`]U`O[[a S\bVÉZb SW\S X\_^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VZºaaSZ YSg c\R RS` heSWbS Ab`W\U RS\ ROhc USVr`S\RS\ ES`b dOZcS S\bVÉZb 2WSaS /`b RS` A^SWQVS`c\U Wab Tº` dWSZS /cTUOPS\abSZZc\US\ VWZT`SWQV h0 eS`RS\ >O `O[SbS` heWaQVS\ VSbS`]US\S\ AgabS[S\ VÉcTWU W\ RS` 9SgDOZcS4]`[ OcaUSbOcaQVb ]RS` AgabS[eS`bS W\ RWSaS` 4]`[ USa^SWQVS`b c\R OPUST`OUb h0 W\ 3\dW`]\[S\b DO`WOPZS\ ?a^VaP\\ ?a^_TacXTb ) 0aQTXcT] \Xc :ThEP[dT?PPaT] import java.util.*; public class Properties01 { public static void main (String[] args) { Properties prop = new Properties(); prop.setProperty("name", "Roman Merker"); prop.setProperty("beruf", "Programmierer"); prop.setProperty("ort", "Steinfurt"); prop.list(System.out); } } ÎQd]V id\ ?a^VaP\\ ?a^_TacXTb 2WS 9ZOaaS ?a^_TacXTb PWSbSb Y][T]`bOPZS ;rUZWQVYSWbS\ Tº` RS\ 2W`SYbhcU`WTT OcT SW\ hSZ\S >`]^S`bWSa 2OPSW [caa ZSRWUZWQV RS` AQVZºaaSZ YSg OZa AcQVPSU`WTT O\USUSPS\ eS`RS\ 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa \c` RS` E]V\]`b OcaUSUSPS\ eW`R [rUZWQVab Rc`QV SW\S\ USaQVOQVbSZbS\ ;SbV]RS\OcT`cT :rac\Uad]`aQVZOU Tº` RWS /caUOPS( System.out.println(prop.getProperty("ort"))* 2Oa T]ZUS\RS >`]U`O[[ hSWUb eWS Y][^OYb SW\ /caR`cQY Q]RWS`b eS`RS\ YO\\ RS` SW\S\ USaQVOQVbSZbS\ ;SbV]RS\OcT`cT S\bVÉZb ?a^VaP\\ ?a^_TacXTb!) 6TbRWPRWcT[cTa
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"
2WS HSWZS [Wb RS[ _aX]c[]0STSVZ S\bVÉZb RS\ /cT`cT RS` abObWaQVS\ ;SbV]RS Bhb cT\VTc?a^_TacXTb 2WSaS ;SbV]RS ZWSTS`b OZa 3`USP\Wa SW\ =PXSYb [Wb SW\S` HcaO[ [S\abSZZc\U OZZS` AgabS[SWUS\aQVOTbS\ 2O`Oca eW`R SW\S UO\h PSabW[[bS >`]^S`bg USZSaS\( [Wb VTc?a^_Tach eW`R RS` :Th ^b]P\T USacQVb c\R RSaaS\ EP[dT [Wb _aX]c[] OcaUSUSPS\ 2WS /caTºV`c\U RWSaS` USaQVOQVbSZbS\ ;SbV]RS\ S`T]ZUb \OQVSW\O\RS` d]\ ZW\Ya PS UW\\S\R
'XHKOZKTSOZ3KZNUJKTJKXSOZMKROKLKXZKT1RGYYK*KIOSGR,UXSGZ
2Oa \ÉQVabS 0SWa^WSZ RS[]\ab`WS`b dS`aQVWSRS\S ;rUZWQVYSWbS\ Tº` ROa 4]`[ObWS`S\ c\R /caUSPS\ d]\ 2ShW[OZhOVZS\ 5ShSWUb eW`R eSZQVS ;rUZWQVYSWbS\ Sa UWPb Tº` ^`W[WbWdS Bg^S\ c\R Tº` Bg^S\ RS` 9ZOaaS 1XV3TRX\P[ ?a^VaP\\ IPW[T] ) 5^a\PcXTaT] d]S 0dbVTQT] e^] 3TiX\P[iPW[T] import java.text.DecimalFormat; import java.math.*; class Zahlen01 { public static void main(String[] args)
{
// Primitive Datentypen runden / aufbereiten double zahl1 = 0.15780003; DecimalFormat df = new DecimalFormat("##,##0.00"); System.out.println(df.format(zahl1)); // Komfortabler mit BigDecimal und MethContext BigDecimal zahl2 = new BigDecimal(0.15780003); int nachkomma = 3; MathContext mc = new MathContext(nachkomma, RoundingMode.HALF_UP); BigDecimal erg = zahl2.round(mc); System.out.println(erg); } } 4º` ROa /`PSWbS\ [Wb RS` DO`WOPZS\ iPW[! eS`RS\ \OQVSW\O\RS` R`SW ;SbV]RS\ OcT US`cTS\( hc\ÉQVab eW`R [Wb ]Tf SW\S 7\abO\h RS` 9ZOaaS
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
;»bd]Vbe^abRW[PV)
import java.text.DecimalFormat; import java.math.*; class Zahlen02 { public static void main(String[] args) { BigDecimal zahl1 = new BigDecimal(0.15780003); System.out.println(zahl1.round(new MathContext(3, RoundingMode.HALF_UP))); } }
ESWZ RWS R`SW ;SbV]RS\ XSeSWZa W\ `c\RS\ 9ZO[[S`\ SW\USTOaab aW\R S`T]ZUb RWS /P O`PSWbc\U d]\ W\\S\ \OQV OczS\( hcS`ab ]Tf RO\OQV a^d]S c\R RO\\ _aX]c[]
+OMKTK3KZNUJKTKXYZKRRKT
3W\S ;SbV]RS Wab W[[S` 0SabO\RbSWZ SW\S` 9ZOaaS C[ SW\S ;SbV]RS hc RSYZO`WS`S\ eW`R SW\S 9ZOaaS S`abSZZb c\R RO\\ WV`S ;SbV]RS\ c\R /bb`WPcbS RO`W\ PSaQV`WSPS\ 3W\S ;SbV]RS VOb heSW 0SabO\RbSWZS( RWS ;SbV]RS\RSYZO`ObW]\ RS\ 9]^T c\R RWS 7[^ZS[S\bWS`c\U RS\ @c[^T( ^cPZWQ abObWQ d]WR [OW\Ab`W\UIK O`Ua i DS`O`PSWbc\U `Sbc`\ S`USP\Wa) k /PP !( 2STW\WbW]\ SW\S` ;SbV]RS 2WS O`O [SbS` RSYZO`WS`b eS`RS\ RWS RO\\ PSW[ /cT`cT [Wb OYbcSZZS\ ES`bS\ USTºZZb eS`RS\ 2WS ;SbV]RS\W[^ZS[S\bWS`c\U S\bVÉZb RWS AO[[Zc\U d]\ AbObS[S\ba SW\USaQVZ]a !
# 4XVT]T
aS\ W\ USaQVeSWTbS\ 9ZO[[S`\ ik EOVZeSWaS YO\\ [Wb RS[ AQVZºaaSZe]`b aTcda] SW\ 3`USP\WaeS`b O\ RS\ /cT`cTS` hc`ºQY USUSPS\ eS`RS\
4K[K3KZNUJKOT.G[VZQRGYYKKXYZKRRKT[TJHKT[Z`KT
2Oa \ÉQVabS 0SWa^WSZ S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ZZb c\R PS\cbhb eW`R- EW` hSWUS\ SW\WUS 0SWa^WSZS PSW RS\S\ SWUS\abÉ\RWUS OP USaQVZ]aaS\S /cTUOPS\ W\ \ScS 9ZOaaS\ OcaUSZOUS`b eS`RS\ RO[Wb aWS RO\\ d]\ RW dS`aS\ O\RS`S\ >`]U`O[[S\ US\cbhb eS`RS\ Yr\\S\ !!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'XHKOZKTSOZYZGZOI3KZNUJKT1RGYYKT3KZNUJKT
2WS /cTUOPS\abSZZc\U Tº` T]ZUS\RS \Sc hc S`abSZZS\RS 9ZOaaS ZOcbSb( 3a a]ZZS\ 2ObS\ d]\ BhbcT\X] SW\USZSaS\ OZa ES`bS d][ Bg^ S^dQ[T W\bS`^`SbWS`b c\R O\ RS\ /cT`c TS` RS` ;SbV]RS ºPS`USPS\ eS`RS\ ?a^VaP\\ ;TbT]) 4X]T 7X[UbZ[PbbT \Xc TX]Ta ;TbT`]U`O[[ ZSRWUZWQV RWS C[eO\RZc\U Wab [rUZWQV 7[ heSWbS\ AQV`Wbb S`abSZZS\ eW` SW\ OcaTºV`PO`Sa >`]U`O[[ ROa RWS 2WS\abZSWabc\U RWSaS` 9ZOaaS ;TbT] \cbhb Rc`QV /cT`cT RS` ;SbV]RS [XTb3^dQ[T ?a^VaP\\ ;TbT]CTbc ) 4X][TbT] d]S 0dbVTQT] e^] 3^dQ[TFTacT] public class LesenTest01 { public static void main(String[] args) throws Exception double d = Lesen.liesDouble(); System.out.println(d); } }
{
0SWRS 9ZOaaS\ Yr\\S\ W\ TX]Ta ?cSZZbSfbRObSW abSVS\ 2S`
3`abSZZS\ AWS SW\S \ScS OcaTºV`PO`S 9ZOaaS O`O[SbS`eS`bS c\R UWPb RWS Ac[[S OZa 3`USP\Wa hc`ºQY !"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# 4XVT]T
;»bd]Vbe^abRW[PV bcPcXR`]U`O[[a VOPS\ W\ RWSaS[ 4OZZ RS\ 2ObSW\O[S\
'XHKOZKTSOZTUTYZGZOI3KZNUJKT/TYZGT`3KZNUJKT
2WS ch_XbRWT E^aVTWT]bfTXbT W\ ]PXSYb]`WS\bWS`bS\ >`]U`O[[agabS[S\ PSabSVb W\ RS[ 4aiTdVT] e^] >QYTZcT] c\R RS[ /cabOcaQVS\ d]\
{
!#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
double d = obj1.liesDouble(); System.out.println(d); } }
ÎQd]V id\ ?a^VaP\\ `]U`O[[
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$
} } class A { int x = 5; static int addieren(int a, int b) { return a + b + x; } } ÎQd]V id\ ?a^VaP\\ `]U`O[[ a] ROaa Sa TSVZS`T`SW ZÉcTb 6W\eSWaS( 2WS ;SbV]RS RO`T \WQVb bcPcXR aSW\ eSWZ aWS OcT RWS 7\abO\hdO`WOPZS f hcU`SWTb 2WS ;SbV]RS [caa OcT US`cTS\ eS`RS\ [Wb SW\S[ 7\abO\h\O[S\ c\R \WQVb [Wb RS[ 9ZOaaS\\O[S\
3KZNUJKTHRUIQOSVRKSKTZOKXKT
2S` 7[^ZS[S\bWS`c\UaQ]RS SW\S` ;SbV]RS abSVb W[ ;SbV]RS\PZ]QY P]Rg
3OZ]KRINKT*GZKTQGTTOTTKXNGRHKOTKX3KZNUJKMKGXHKOZKZ]KXJKT%
Hc\ÉQVab SW\[OZ abSVS\ SW\S` ;SbV]RS OZZS DO`WOPZS\ RS` SWUS\S\ 9ZOaaS hc` DS`Tº Uc\U 2WSaS DO`WOPZS\ aW\R S\beSRS` 9ZOaaS\dO`WOPZS\ ]RS` 7\abO\hdO`WOPZS\ /P VÉ\UWU ROd]\ abSVS\ aWS S\beSRS` XSRS` ;SbV]RS hc` DS`TºUc\U RWS 7\abO\hdO`WOP ZS\ ]RS` \c` RS\ bcPcXR;SbV]RS\ RWS 9ZOaaS\dO`WOPZS\ RS\\ RWS aW\R SPS\TOZZa [Wb bcPcXR RSYZO`WS`b 2O\\ Yr\\S\ W\\S`VOZP RS` ;SbV]RS \ScS DO`WOPZS\ RSTW\WS`b c\R [Wb ES`bS\ USTºZZb eS`RS\ 2WSaS eS`RS\ Z]YOZS DO`WOPZS\ US\O\\b C\R aSV` eWQVbWU OczS`RS[ Yr\\S\ SW\S` ;SbV]RS d]\ OczS\ Rc`QV RS\ /cT`c TS` 2ObS\ ºPS`USPS\ eS`RS\ 2WSaS eS`RS\ /`Uc[S\bS >O`O[SbS` US\O\\b $ :[PbbT]ePaXPQ[T ^STa 8]bcP]iePaXPQ[T.
?a^VaP\\
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
ÎQd]V id\ ?a^VaP\\
;^ZP[T EPaXPQ[T]
HcaÉbhZWQV hc RS\ 4SZRS`\ WV`S` 9ZOaaS Yr\\S\ ;SbV]RS\ SWUS\S DO`WOPZS RSYZO`WS `S\ c\R PS\cbhS\ 2WSaS \S\\b [O\ Z]YOZS DO`WOPZS\ RS\\ aWS aW\R \c` W\\S`VOZP RWSaS` ;SbV]RS O\a^`SQVPO` A]POZR RWS ;SbV]RS OPUSO`PSWbSb Wab c\R PSS\RSb eW`R Wab OcQV RWS Z]YOZS DO`WOPZS \WQVb [SV` dS`TºUPO` 3W\S Z]YOZS DO`WOPZS eW`R \WQVb Ocb][ObWaQV W\WbWOZWaWS`b RV aWS VOb YSW\S\ 2STOcZb eS`b eWS RWS 4SZRS` SW\S` 9ZOaaS 2SaeSUS\ [caa RS` >`]U`O[[WS`S` ROTº` a]`US\ ROaa RWS Z]YOZS DO`WOPZS e^a RS[ S`abS\ DS`O`PSWbc\UaPSTSVZ SW\S\ Y]``SYbS\ ES`b S\bVÉZb ?a^VaP\\
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$
ÎQd]V !( ;OQVS\ AWS RWS ES`bShceSWac\U W\ RS` ;SbV]RS PdbVTQT] hc SW\S[ 9][[S\bO` ESZQVS 4SVZS`[SZRc\U Y][[b PSW RS` C[eO\RZc\U EO`c[ Wab ROa a]- ÎQd]V ") 4ºUS\ AWS RS` \PX];SbV]RS OZa ZSbhbSa AbObS[S\b RS\ T]ZUS\RS\ /caUO PSPSTSVZ VW\hc( System.out.println("Die Variable i enthält: " + i)); EO`c[ TºV`b RWSaS` DS`acQV hc SW\S[ C[eO\RZc\UaTSVZS`- EWS YO\\ RS` 4SV ZS` c[UO\US\ eS`RS\- :rac\UaVW\eSWa( 2WS 2SYZO`ObW]\ RS` DO`WOPZS\ W RO`T \WQVb W[ 9]^T RS` 5^aAQVZSWTS d]`US\][[S\ eS`RS\ eSWZ RWSaS RORc`QV hc SW\S` Z]YOZS\ DO`WOPZS\ Tº` RWSaS\ /\eSWac\UaPZ]QY eW`R :]YOZS DO`WOPZS aW\R W[[S` RO\\ aW\\d]ZZ eS\\ HeWaQVS\S`USP\WaaS USa^SWQVS`b ]RS` bS[^]`É`S HcabÉ\RS TSabUSVOZbS\ eS`RS\ [ºaaS\ RWS \OQV /PZOcT SW\Sa 0Z]QYa \WQVb [SV` PS\rbWUb eS`RS\
kHKXRGJKT\UT3KZNUJKTU\KXRUGJ
2WS AWU\Obc` YS\\hSWQV\Sb SW\S ;SbV]RS SW\RScbWU AWS PSabSVb Oca ;SbV]RS\\O[S c\R 2SYZO`ObW]\ RS` >O`O[SbS` EWS AWS PS`SWba PSW RS` 3`ZÉcbS`c\U hc[ >`]U`O[[ `]U`O[[a RS\aSZPS\ ;SbV]RS\\O[S\ [SV`TOQV hc dS`eS\RS\ eS\\ RWS ;SbV]RS\ aWQV Rc`QV RWS >O`O[SbS`ZWabS c\bS`aQVSWRS\ 0SW[ /cT`cT RWSaSa ;SbV]RS\\O[S\a acQVb aWQV 8OdO Ocb][ObWaQV RWS ^OaaS\RS ;SbV]RS c\R heO` OPVÉ\UWU d]\ RS` AWU\Obc` 1TXb_XT[
) ÎQTa[PST] e^] eTa[^PSX]V
public class Methode11 { public static void main (String[] args) { A a = new A(); System.out.println(a.addieren(5,3)); System.out.println(a.addieren(15.3, 27.9)); } } class A { int addieren(int a, int b) { System.out.println("Ganzzahlen addieren"); return a + b; } double addieren(double a, double b) { System.out.println("Gleitkommazahlen addieren"); return a + b; } k EOa Wab RS` D]`bSWZ RWSaS` BSQV\WY- 2c`QV RWS ;rUZWQVYSWb ;SbV]RS\ hc ºPS`ZORS\ YO\\ RS` >`]U`O[[WS`S` UZSWQVS\ 4c\YbW]\OZWbÉbS\ RS\aSZPS\
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
eS\\ aWS d]\ dS`aQVWSRS\S\ ;SbV]RS\ OcaUSTºV`b eS`RS\ 2ORc`QV eW`R ROa >`] U`O[[ ZSaPO`S` c\R ;SbV]RS\OcT`cTS dS`abÉ\RZWQVS`
2G[L`KOZLKNRKXHKNGTJKRTH`]]KOZKXXKOINKT
0SW RS` /caTºV`c\U SW\S` ;SbV]RS YO\\ Sa hc :OcThSWbTSVZS`\ Y][[S\ 8S \OQV /`b RSa 4SVZS`a eW`R RS` >`]U`O[[WS`S` S\beSRS` UShec\US\ RWS @SOYbW]\ RO`OcT aSZPab hc ^`]U`O[[WS`S\ ]RS` RWS AbScS`c\U eW`R eS\\ \WQVba O\RS`Sa Q]RWS`b Wab O\ RWS 8D; ºPS`USPS\ RWS RO\\ S\ba^`SQVS\RS /YbW]\S\ Rc`QVTºV`b ?a^VaP\\ BcP]SPaS8]!) ;PdUiTXcUTW[Ta QTWP]ST[] Qif fTXcTa aTXRWT] class StandardIn02 { public static void main(String[] args) throws Exception int zeichen1 = System.in.read(); System.out.println(zeichen1); } }
{
2c`QV RWS /\UOPS throws Exception PSabW[[b RS` >`]U`O[[WS`S` ROaa SdS\ bcSZZS 4SVZS` W\ RWSaS` ;SbV]RS \WQVb W\RWdWRcSZZ PSVO\RSZb eS`RS\ a]ZZS\ a]\RS`\ O\ RWS \ÉQVabVrVS`S 3PS\S eSWbS` US`SWQVb eS`RS\ W\ RWSaS[ 4OZZ O\ RWS 8D; ÎQd]V id\ ?a^VaP\\ BcP]SPaS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º` RS\ ;SbV]RS\OcT`cT YS\\S\ RV S` [caa \WQVb \c` RWS 2ObS\bg^S\ RWS S`eO`bSb eS`RS\ YS\\S\ S` [caa OcQV eWaaS\ O\ fT[RWTa >]aWbW]\ W\ RS` >O`O[SbS`ZWabS fT[RWTa Bg^ S`eO`bSb eW`R 0ZcdT[[T ?PaP\TcTa 0SW[ /cT`cT RS` ;SbV]RS [caa Tº` XSRS\ T]`[OZS\ >O`O[SbS` SW\ ^OaaS\RSa /`Uc [S\b ºPS`USPS\ eS`RS\ 2WS /`Uc[S\bS eS`RS\ PZcdT[[T ?PaP\TcTa US\O\\b AWS [ºaaS\ d][ Bg^ VS` ^OaaS\ c\R eS`RS\ ^]aWbW]\aUS\Oc eWS d][ 3[^TÉ\US` US T]`RS`b ºPS`USPS\ 2WS T]`[OZS\ >O`O[SbS` eW`YS\ eWS >ZObhVOZbS` Tº` RWS ES`bS RS` OYbcSZZS\ >O`O[S bS` 7\\S`VOZP RS` ;SbV]RS dS`VOZbS\ aWQV RWS T]`[OZS\ >O`O[SbS` eWS Z]YOZS DO`WOP ZS\ RWS W\WbWOZWaWS`b eS`RS\ W\RS[ RS` ES`b RS` OYbcSZZS\ >O`O[SbS` W\ RWSaS A^SW QVS`hSZZS\ Y]^WS`b eS`RS\ ?a^VaP\\ ;TTaiTX[T] )
public class Leerzeilen01 { public static void main (String[] args) { leerzeilen(5); } static void leerzeilen(int anzahl) { System.out.println("Nun werden " + anzahl + "Leerzeilen ausgegeben"); for (int i = 1; iO`O[SbS` /`Uc[S\bS Yr\\S\ PSW[ /cT`cT O\USUSPS\ eS`RS\( DO`W OPZS :WbS`OZS ]RS` /caR`ºQYS /Za 2ObS\bg^ aW\R ^`W[WbWdS c\R OcQV @STS`S\hbg^S\ [rUZWQV ÎQd]V id\ ?a^VaP\\ ;TTaiTX[T] 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] OP ROaa heSW >O`O[SbS` ºPS`USPS\ eS`RS\( SW\ RWPaES`b c\R SW\ X]cES`b 2O\\ a]ZZ RWS ;SbV]RS RS\ RWPaES`b a] ]Tb OcaUSPS\ eWS W\ RS` 5O\hhOVZ O\USUSPS\ 0SWa^WSZ( EW`R OZa /`Uc[S\bS O # ºPS`USPS\ a] a]ZZ Tº\T[OZ RS` 0cQVabOPS O OcaUSUSPS\ eS`RS\
"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
=OK]KXJKT6GXGSKZKXHKXMKHKT%
EW` VOPS\ PS`SWba USYZÉ`b ROaa RWS ÍPS`UOPS RS` OYbcSZZS\ >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\\
class Methode12 { public static void main (String[] args) { double zahl = 123.45; aendern(zahl); System.out.println(zahl); } static public void aendern(double zahl) { zahl = zahl + 200; System.out.println(zahl); } } /caUSUSPS\ eS`RS\ ! !"# c\R !"# 2Oa hSWUb ROaa RS` 7\VOZb RS` DO`WOPZS\ iPW[ aWQV W\ RS` 6Oc^b[SbV]RS \PX] \WQVb USÉ\RS`b VOb eSWZ \É[ZWQV RWS ;SbV]RS PT] STa] [Wb SW\S` 9]^WS RS` 2ObS\ O`PSWbSb
2WS 9ZOaaS ?d]Zc YPeP PWSbSb T]ZUS\RS\ AS`dWQS( AWS YO\\ RWS ES`bS Tº` SW\S >]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:39:00 ))
{
7\ RS[ d]`ZSbhbS\ AbObS[S\b eW`R RWS ;SbV]RS b_TXRWTa] OcTUS`cTS\ c\R ROPSW RWS OYbcSZZS\ >O`O[SbS` O c\R P ºPS`USPS\ 2WS OYbcSZZS\ ES`bS RS` PSWRS\ DO`WOPZS\ eS`RS\ Y]^WS`b c\R RO\\ RWSaS 2c^ZWYObS O\ ;SbV]RS b_TXRWTa] ºPS`b`OUS\ ÎQd]V id\ ?d]Zc 0WbbS É\RS`\ AWS RWS ;SbV]RS b_TXRWTa] a] OP ROaa AWS RWS DO`WOPZS O [Wb RS[ ES`b TºZZS\ ES`bShceSWac\U 4ºUS\ AWS RO\\ W[ >`]U`O[[ ?d]ZcCTbc RWS T]ZUS\RS HSWZS VW\hc c\R ºPS`^`ºTS\ AWS ROa 3`USP\Wa( System.out.println(a);
8KLKXKT`Z_VKTGRY6GXGSKZKX
O`O[SbS` RSYZO`WS`b eS`RS\ /ZZS` RW\Ua ^OaaWS`b RO\\ SbeOa Tc\RO[S\bOZ O\RS`Sa OZa PSW[ /`PSWbS\ [Wb ^`W[WbWdS\ 2O bS\bg^S\ C[ RWS c\bS`aQVWSRZWQVS EW`Yc\U hc RS[]\ab`WS`S\ []RWTWhWS`S\ eW` RWS ]PWUS\ >`]U`O[[S Hc\ÉQVab eW`R RWS 9ZOaaS ?d]Zc S`UÉ\hb c[ RWS ;SbV]RS PS SXTaT] 2WSaS ;SbV]RS S`eO`bSb OZa >O`O[SbS` SW\ =PXSYb RS` 9ZOaaS ?d]Zc! ?a^VaP\\ ?d]Zc!) 3XT :[PbbT T]cWÊ[c idbÊci[XRW SXT
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% ?PaP\TcTa ¶QTaVTQT] d]S T\_UP]VT]
else System.out.println("Der Punkt liegt im Fenster"); } void addieren(Punkt02 p2) { x = x + p2.x; y = y + p2.y; } } 2O\OQV É\RS`\ eW` ROa 1ZWS\b^`]U`O[[ ?d]ZcCTbc a] ROaa SW\S heSWbS 7\abO\h S`hScUb eW`R c\R RWSaS OZa >O`O[SbS` O\ RWS PSSXcX^]b;SbV]RS ºPS`USPS\ eW`R ?a^VaP\\ ?d]ZcCTbc!)
public class PunktTest02 { public static void main(String[] args) int a = 5; int b = 3; Punkt02 p = new Punkt02(); p.speichern(a, b); Punkt02 p2 = new Punkt02(); p.addieren(p2); } }
{
ÎQd]V id\ ?a^VaP\\ ?d]ZcCTbc! 3`UÉ\hS\ AWS RWS ;SbV]RS PSSXTaT] W\ RS` 9ZOaaS ?^bXcX^]!YPeP c[ T]ZUS\RS /\ eSWac\U( p2.x = -17; 2ORc`QV eW`R SW\ 3ZS[S\b RSa ^ =PXSYba USÉ\RS`b 2OPSW W\bS`SaaWS`b c\a PSa]\RS`a RWS 4`OUS ]P RWSaS Ò\RS`c\U OcQV W[ =`WUW\OZ]PXSYb Rc`QVUSTºV`b ec`RS >`ºTS\ AWS RSaVOZP W[ >`]U`O[[ ?^bXcX^]CTbc!YPeP ]P RWSaS Ò\RS`c\U VWS` eW`Y aO[ USe]`RS\ Wab Rc`QV /cT`cT RS` ;SbV]RS _adTU Tº` RWSaSa =PXSYb( p2.pruef(); 3a [caa RWS 7\T]`[ObW]\ Y][[S\ 2S` >c\Yb ZWSUb OcaaS`VOZP 2O[Wb Wab T]ZUS\RSa PSeWSaS\( 0SW RS` ÍPS`UOPS d]\ 7\abO\hS\ OZa >O`O[SbS` eW`R RWS @STS`S\hdO`WOPZS Y]^WS`b c\R RWSaS 9]^WS eW`R O\ RWS OcTUS`cTS\S ;SbV]RS ºPS`b`OUS\ 2O[Wb VOb RWS ;SbV]RS RWS =`WUW\OZOR`SaaS RS` 7\abO\h 8SRS ;O\W^cZObW]\ O\ RWSaS[ =PXSYb dS`É\RS`b a][Wb ROa =`WUW\OZ]PXSYb 4OhWb( 0SW RS` ÍPS`UOPS d]\ @STS`S\hdO`WOPZS\ OZa >O`O[SbS` Wab RWS EW`Yc\U RWSaSZ PS eWS PSW 1OZZ Pg @STS`S\QS( 2S` 3[^TÉ\US` O`PSWbSb [Wb RS[ =`WUW\OZ 8SRS Ò\RS `c\U eW`Yb aWQV OcQV PSW RS[ /cT`cTS` RS` ;SbV]RS Oca "#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
IdbP\\T]UPbbd]V STa ATVT[] QTX\ 2P[[ Qh EP[dT
•
8OdO O`PSWbSb PSW RS` >O`O[SbS`ºPS`UOPS U`c\RaÉbhZWQV [Wb 1OZZ Pg dOZcS 2Oa VSWzb RWS >O`O[SbS` eS`RS\ Y]^WS`b c\R RWSaS 9]^WS S`VÉZb RO\\ RWS OcTUS`cTS \S ;SbV]RS
•
/ZZS`RW\Ua Wab RWS EW`Yc\U RWSaSa ;SQVO\Wa[ca b]bOZ c\bS`aQVWSRZWQV XS \OQV RS[ ]P ^`W[WbWdS DO`WOPZS ]RS` @STS`S\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 RS\ USeº\aQVbS\ Bg^ 3W\S ^`]PZS[Z]aS C[eO\RZc\U d]\ 2ObS\bg^S\ Wab W[[S` RO\\ [rUZWQV eS\\ RORc`QV YSW\ 7\T]`[ObW]\adS`Zcab OcTb`Wbb ?a^VaP\\ ;TTaiTX[T]") ÎQTaVPQT e^] bW^acCh_ 4\_UP]V P[b X]cCh_ public class Leerzeilen03 { public static void main (String[] args) short zahl = 5; leerzeilen(zahl); } static void leerzeilen(int anzahl) { for (int i = 1; i
{
2S` /cT`cT RS` ;SbV]RS [TTaiTX[T] S`T]ZUb [Wb RS[ OYbcSZZS\ >O`O[SbS` iPWZ 2WSaS` Wab heO` d][ Bg^ bW^ac c\R S`eO`bSb eW`R RS` Bg^ X]c 2O OPS` bW^ac hceSWac\Ua dS`b`ÉUZWQV Wab eW`R abWZZaQVeSWUS\R SW\S Bg^c[eO\RZc\U d]`US\][[S\ c\R RWS ;SbV]RS OcaUSTºV`b
'QZ[KRRK6GXGSKZKXQTTKTG[INOTKOTKS'[YJX[IQYZKNKT
0SW[ /cT`cT SW\S` ;SbV]RS Yr\\S\ RWS OYbcSZZS\ >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; i
{
"%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
<WQVb W[[S` Wab Sa [rUZWQV PSW RS` 2SYZO`ObW]\ SW\S` ;SbV]RS RWS US\OcS /\hOVZ RS` hc ºPS`USPS\S\ >O`O[SbS` O\hcUSPS\ 2SaVOZP UWPb Sa RWS ;rUZWQVYSWb SW\S dO `WOPZS /\hOVZ hc RSYZO`WS`S\ 2WSa USaQVWSVb Rc`QV 1]RWS`S\ d]\ ! >c\YbS\ heW aQVS\ RS[ Bg^ c\R RS[ 7RS\bWTWS` ?a^VaP\\ EPa0aVb ) EPaXPQ[T 0]iPW[ ?PaP\TcTa T\_UP]VT] public class VarArgs01 { public static void main (String[] args) ausgabe("Roman", "Erwin"); } static void ausgabe(String ... namen) { for (String n : namen) { System.out.println("Hallo " + n); } } }
{
8IQMGHK]KXZ
0SW[ /cT`cT d]\ ;SbV]RS\ Wab hc c\bS`aQVSWRS\ heWaQVS\ ;SbV]RS\ RWS SW\S\ @ºQYUOPSeS`b ZWSTS`\ c\R ;SbV]RS\ RWS ZSRWUZWQV SW\S /cTUOPS S`TºZZS\ OPS` YSW\ 3`USP\Wa O\ RS\ /cT`cTS` hc`ºQYUSPS\ ;O\QV[OZ eS`RS\ RWSaS PSWRS\ c\bS`aQVWSR ZWQVS\ /`bS\ d]\ C\bS`^`]U`O[[S\ OcQV OZa 4c\YbW]\ [Wb @ºQYUOPSeS`b c\R >`] hSRc` ]V\S @ºQYUOPSeS`b PShSWQV\Sb 7\ 8OdO UWPb Sa RWSaS C\bS`aQVSWRc\U \WQVb PSWRS /`bS\ aW\R OZa ;SbV]RS\ hc W[^ZS[S\bWS`S\ Hc\ÉQVab [caa RScbZWQV USaOUb eS`RS\ ROaa [OfW[OZ TX] 3`USP\WaeS`b O\ RS\ /cT `cTS` ºPS`b`OUS\ eS`RS\ YO\\ ;SV` OZa SW\ ES`b Wab \WQVb [rUZWQV 2WSa Wab RSaeS US\ OPS` YSW\ eW`YZWQVSa >`]PZS[ eSWZ R]QV [SV`S`S DO`WOPZS\ hcaO[[S\USTOaab eS`RS\ Yr\\S\ h0 OZa /``Og OZa =PXSYb ]RS` OZa SW\S 1]ZZSQbW]\ d]\ 7\abO\hS\ ES\\ RWS OcTUS`cTS\S ;SbV]RS SW\ 3`USP\Wa O\ RS\ /cT`cTS` ZWSTS`b a] [caa RWSa PSW RS` 2SYZO`ObW]\ RS` ;SbV]RS TSabUSZSUb eS`RS\ 7[ 9]^T RS` ;SbV]RS abSVb RS` 2ObS\bg^ RSa 3`USP\WaaSa c\R RO\\ \dbb RWS 7[^ZS[S\bWS`c\U OcQV [Wb RS[ AQVZºaaSZe]`b aTcda] ROa 3`USP\Wa ZWSTS`\ 5ZSWQVhSWbWU eW`R RWS ;SbV]RS a]T]`b dS` ZOaaS\ eS\\ aTcda] OcaUSTºV`b eW`R 7\\S`VOZP SW\S` ;SbV]RS YO\\ aTcda] [SV`TOQV OZbS`\ObWd Q]RWS`b eS`RS\ 2S` /cT`cT SW\S` ;SbV]RS [Wb @ºQYUOPSeS`b S`T]ZUb Rc`QV(
ergebnis = objekt.methode(parameter);
6WS`hc SW\ 0SWa^WSZ
"&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& A¶RZVPQTfTac
?a^VaP\\ ?^cT]i ) 4aVTQ]Xba¶RZVPQT public class Potenz01 { public static void main(String[] args) { int a = 5; int b = 3; System.out.println(potenzieren(a,b)); } static int potenzieren(int z1, int z2) { int erg = z1; if (z2 == 0) return 1; for (; z2>1; 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\ RO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\S Ocb][ObWaQVS /\^Oaac\U abObb "'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
2Oa T]ZUS\RS >`]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\abSZ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\TOQVS\ DO`WOPZS\ [Wb RS` 2ObS\Y]^WS c\R PSW 7\abO\hS\ [Wb RS[ =`WUW\OZ]PXSYb 0SW SW\S` ;SbV]RS RWS YSW\ 3`USP\Wa ZWSTS`b [caa O\abSZZS RSa @Sbc`\bg^a ROa AQVZºaaSZe]`b e^XS O\USUSPS\ eS`RS\ 4SVZb RWSaSa AQVZºaaSZe]`b a] [caa W\\S`VOZP RS` ;SbV]RS [Wb aTcda] SW\ ES`b USZWSTS`b eS`RS\ ;SbV]RS\ aW\R W[[S` OZa BSWZ SW\S` 9ZOaaS RSTW\WS`b 2OPSW eS`RS\ 9ZOaaS\ ;SbV]RS\ c\R 7\abO\h;SbV]RS\ c\bS`aQVWSRS\ 9ZOaaS\;SbV]RS\ RSTW\WS`b [Wb RS[ AQVZºaaSZe]`b bcPcXR aW\R OZZUS[SW\S 2WS\abZSWabc\US\ RS` 9ZOaaS eÉV`S\R 7\ abO\h;SbV]RS\ \c` OcT d]`VS` S`hScUbS 7\abO\hS\ RWSaS` 9ZOaaS ]^S`WS`S\ 2c`QV ROa AS\RS\ d]\ ;SaaOUSa hc RWSaS[ =PXSYb eS`RS\ RWS ;SbV]RS\ OYbWdWS`b 2S` /cTPOc SW\S`
klassenname.methodenname objektname.methodenname
7\ SW\S` 9ZOaaS [caa RWS AWU\Obc` SW\S` ;SbV]RS SW\RScbWU c\W_cS aSW\ 3a RO`T YSW\S heSW ;SbV]RS\ [Wb RS[aSZPS\ O`O[SbS`ZWabS USPS\ eSWZ RO\\ RWS 8D; YSW\ C\bS`aQVSWRc\UaY`WbS`Wc[ VOb PSW RS` /caeOVZ RS` `WQVbWUS\ ;SbV]RS /ZZS`RW\Ua UWPb Sa RWS BSQV\WY RSa ÍPS`ZORS\a ]dS`Z]OR PSW RS` Sa W\ SW\S` 9ZOaaS [SV`S`S ;SbV]RS\ [Wb UZSWQVS[ O`O[SbS` #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQ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aSZer`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`
9ZOaaS *\O[S, 7\abO\hDO`WOPZS\ 9ZOaaS\DO`WOPZS\ 7\abO\h;SbV]RS\ 9ZOaaS\;SbV]RS\ /PP ( 2O`abSZZc\U d]\ /cTPOc c\R 7\VOZb SW\S` 9ZOaaS OZa C;:2WOU`O[[ 2Oa T]ZUS\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 9ZOaaS S\bVÉZb OZa 0ccaXQdcT 4SZRS` DO`WOPZS\ ]P\T ]a
+ Tº` ROa A^SWQVS`\ RSa >O`b\S`\O[S\a + Tº` ROa A^SWQVS`\ RS` 7RS\bWTWYObW]\a\c[[S`
/Za DS`O`PSWbc\Ua\TcW^ST] Tº` RWSaS 2ObS\ a]ZZS\ ^`]U`O[[WS`b eS`RS\( ]Td PdbVTQT]
bTc=P\T
+ Tº` ROa /\ZSUS\ SW\Sa \ScS\ 5SaQVÉTba^O`b\S`a + Tº` RWS /\hSWUS RS` 2ObS\ SW\Sa PSabW[[bS\ 5SaQVÉTba^O`b\S`a + Tº` RWS ;rUZWQVYSWb RS\
?a^VaP\\ ?Pac]Ta ) :[PbbT]QTbRWaTXQd]V ^W]T \PX]
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
System.out.println(nr + " " + name); } void setName(String name1) { name = name1; } } 7[ 0]Rg eS`RS\ RWS 3ZS[S\bS RS` 9ZOaaS RWS ;S[PS` RSTW\WS`b 2Ohc USVr`S\ RWS 4SZRS` /bb`WPcbS c\R RWS ;SbV]RS\ 2WS 4SZRS` aW\R [Wb RS[ OQQSaa []RWTWS` _aXePcT RSYZO`WS`b RO[Wb eW`R TSabUSZSUb ROaa aWS \c` d]\ ;SbV]RS\ RWSaS` 9ZOaaS US ZSaS\ ]RS` dS`É\RS`b eS`RS\ Yr\\S\ 2WS @SWVS\T]ZUS RS` 3ZS[S\bS W[ ?cSZZbSfb a^WSZb YSW\S @]ZZS 2WS 4SZRS` Yr\\bS\ OcQV O[ 3\RS RSa 0]Rga OcTUSTºV`b eS`RS\ c\R OcQV RWS @SWVS\T]ZUS RS` ;SbV] RS\ a^WSZb YSW\S @]ZZS aWS eS`RS\ SV \c` RO\\ OcaUSTºV`b eS\\ aWS Sf^ZWhWb OcTUS `cTS\ eS`RS\ ÎQd]V id\ ?a^VaP\\ ?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WS 2O`abSZZc\U RS` DS`S`Pc\UaVWS`O`QVWS
'XHKOZKTSOZ/TYZGT`KTJKX1RGYYKT
FPb Xbc TX]T 8]bcP]i. 2WS ]PXSYb]`WS\bWS`bS >`]U`O[[WS`c\U YS\\b OZa hS\b`OZS\ 0SU`WTT ROa =PXSYb :SW RS` Wab RS` 0SU`WTT \WQVb SW\RScbWU RSTW\WS`b( [SWabS\a Wab RO[Wb RWS Y]\Y`SbS /ca^`É Uc\U SW\S` 9ZOaaS OZa] SW\S 7\abO\h US[SW\b) W\ [O\QVS\ HcaO[[S\VÉ\US\ eW`R RS` 0SU`WTT OPS` OcQV OZa Ag\]\g[ Tº` SW\S 9ZOaaS PS\cbhb 2SaeSUS\ Wab Sa PSaaS` S\beSRS` RS\ 0SU`WTT 9ZOaaS hc PS\cbhS\ eS\\ RWS OZZUS[SW\S 0SaQV`SWPc\U SW\S` 5`c^^S d]\ DO`WOPZS\ c\R RWS RO[Wb dS`Pc\RS\S\ ;SbV]RS\ US[SW\b Wab ]RS` RS\ 0SU`WTT 7\abO\h hc dS`eS\RS\ eS\\ RO[Wb SW\ Y]\Y`SbS` 3W\hSZTOZZ US[SW\b Wab RS` W[ /`PSWbaa^SWQVS` hc` :OcThSWb SW\Sa >`]U`O[[a [Wb ]Tf S`hScUb e]`RS\ Wab 3W\S 7\abO\h PSZSUb A^SWQVS`^ZObh RS` [Wb RS\ W\RWdWRcSZZS\ ES`bS\ RWSaSa 3fS[^ZO`a US TºZZb Wab 7\abO\hS\ eS`RS\ hc` :OcThSWb SW\Sa >`]U`O[[a S`hScUb Rc`QV(
Klassenname instanzname; instanzname = new Klassenname();
0SWa^WSZ Tº` ROa 3`hScUS\ SW\S` 7\abO\h d]\ RS` 9ZOaaS ?Pac]Ta(
Partner01 g1 = new Partner01();
2WS a] S`hScUbS 7\abO\h U YO\\ PS\cbhb eS`RS\ c[ [Wb RS\ /bb`WPcbS\ c\R RS\ ;SbV]RS\ RS` 9ZOaaS hc O`PSWbS\ 2S` /cT`cT d]\ ;SbV]RS\ USaQVWSVb Rc`QV ROa AS\RS\ d]\
instanzname.methodenname(parameter);
0SWa^WSZ Tº` ROa AS\RS\ SW\S`
g1.ausgeben();
2WS \OQVT]ZUS\RS 9ZOaaS S\bVÉZb SW\ OcaTºV`PO`Sa >`]U`O[[ AWS PS\cbhb RWS 9ZOaaS ?Pac]Ta OZa AQVOPZ]\S hc[ 3`hScUS\ SW\Sa Y]\Y`SbS\ =PXSYba c[ O\aQVZWSzS\R RO[Wb hc O`PSWbS\ ##
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
?a^VaP\\ ?Pac]TaCTbc ) 4X]T 8]bcP]i TaiTdVT] d]S =PRWaXRWcT] bRWXRZT] class PartnerTest01 { public static void main(String[] args) { Partner01 g1 = new Partner01(); g1.neu(4700, "Meyer"); g1.ausgeben(); } } ÎQd]V id\ ?a^VaP\\ ?Pac]TaCTbc ÍPS`^`ºTS\ AWS eSZQVS 4SVZS`[SZRc\U PSW RS` C[eO\RZc\U OcaUSUSPS\ eW`R eS\\ RWS >O`O[SbS` "% ;SgS` W\ c[USYSV`bS` @SWVS\T]ZUS ºPS`USPS\ eS`RS\
?PZTc) >O`b\S`BSabQZOaa
2[XT]c BTaeXRT]TW\Ta
PS\cbhb
>O`b\S`QZOaa
BTaeXRT_a^eXSTa
/PP !( 0ShWSVc\U heWaQVS\ RS\ PSWRS\ 9ZOaaS\ 9ZOaaS\ aW\R ROa Tc\RO[S\bOZS Ab`cYbc`SZS[S\b W\ 8OdO /ZZS ;SbV]RS\ c\R 2ObS\RS TW\WbW]\S\ abSVS\ W\ 9ZOaaS\ AWS aW\R RWS YZSW\abS 3W\VSWb RWS c[USeO\RSZb eS`RS\ YO\\ /PS` RWS 9ZOaaS\ eS`RS\ ]`UO\WaWS`b W\ >OYSbS\ aWSVS 9O^WbSZ $ 0SWRS 9ZOa aS\RObSWS\ c\aS`Sa 0SWa^WSZa USVr`S\ hc SW\S[ ?PRZPVT c\R PSWRS [ºaaS\ W[ aSZ PS\ DS`hSWQV\Wa abSVS\ =Pe]VZ YSW\S >OYSbhcUSVr`WUYSWb Sf^ZWhWb O\USUSPS\ ec` RS USVr`S\ aWS hc TX]T\ \O[S\Z]aS\ 2STOcZb>OYSb 7\\S`VOZP SW\Sa >OYSba Wab XS RS ;SbV]RS PS`SQVbWUb OcT XSRS O\RS`S ;SbV]RS ]RS` OcT XSRSa O\RS`S 2ObS\TSZR SW\S` 9ZOaaS hchcU`SWTS\ 2Oa T]ZUS\RS 0SWa^WSZ^`]U`O[[ ?Pac]Ta!YPeP `SOZWaWS`b RWSaSZPS /cTUOPS\abSZZc\U eWS RWS >`]U`O[[S ?Pac]Ta c\R ?Pac]TaCTbc \c` ROaa XSbhb RWS PSWRS\ >`] U`O[[S hcaO[[S\ USTOaab aW\R W\ SW\S` ?cSZZbSfbRObSW + SW\S C[eO\RZc\UaSW\ VSWb 2Oa >`]U`O[[ ?Pac]Ta! S\bVÉZb OZa] \WQVb \c` RWS 0SaQV`SWPc\U RS` 9ZOaaS RWS AQVOPZ]\S a]\RS`\ Sa Wab OcQV UZSWQVhSWbWU SW\ OcaTºV`PO`Sa >`]U`O[[ ROa RWSaS AQVOPZ]\S PS\cbhb RS\\ Sa S\bVÉZb RWS ;SbV]RS \PX] 7\ RWSaS` \PX] ;SbV]RS eW`R [Wb ]Tf SW\S 7\abO\h S`abSZZb d]\ RS` SWUS\S\ 9ZOaaS 2WS 7\abO\h VOb RS\ 0ShSWQV\S` V c\R [Wb 6WZTS RWSaSa 0ShSWQV\S`a YO\\ ROa =PXSYb PSO`PSWbSb eS`RS\ #$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" <XcVT[XTUTacT :[PbbT QT]dciT]
?a^VaP\\ ?Pac]Ta!) :[PbbT \Xc 4[T\T]cT] d]S TX]Ta \PX]
public class Partner02 { public static void main(String[] args) { Partner02 g1 = new Partner02(); g1.neu(4700, "Meyer"); g1.ausgeben(); } private int nr; private String name; void neu(int nr1, String name1) { nr = nr1; name = name1; } void ausgeben() { System.out.println(nr + " " + name); } void setName(String name1) { name = name1; } } ÎQd]V id\ ?a^VaP\\ ?Pac]Ta! 3`UÉ\hS\ AWS ROa >`]U`O[[ ?Pac]Ta! a] ROaa SW\S heSWbS 7\abO\h S`hScUb eW`R 2S` 7\abO\h\O[S a]ZZ aSW\( U 2WS ES`bS aW\R " Tº` RWS 9c\RS\\c[[S` c\R AQVcZh Tº` RS\
3OZMKROKLKXZK1RGYYKHKT[Z`KT
2Oa 829 d]\ Ac\ 8OdO AbO\RO`R 3RWbW]\ S\bVÉZb SW\S 4ºZZS d]\ SW\USPOcbS\ 9ZOa aS\ 2WSaS aW\R OcaTºV`ZWQV R]Yc[S\bWS`b W\ RS` [WbUSZWSTS`bS\ />72]Yc[S\bObW]\ 0aQTXcT] \Xc 9>4( /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 OZZS 9ZOaaS\ W\ RWSaS[ >OYSb O\ hSWUS\ ]RS` [O\ PSY][[b OZZS >OQYOUSa [Wb OZZS\ 9ZOaaS\ OZ^VOPSbWaQV a]`bWS`b O\ UShSWUb 2WS AbO\RO`R 3RWbW]\ # S\bVÉZb SbeO # dS`aQVWSRS\S 9ZOaaS\ XSRS SW\ hSZ\S 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 EW` eS`RS\ W\ RS\ T]ZUS\RS\ /PaQV\WbbS\ R`SW RWSaS` [WbUSZWSTS`bS\ 9ZOaaS\ PS\cbhS\ c\R ROPSW OcQV OcT RWS 2]Yc[S\bObW]\ hc`ºQYU`SWTS\
#%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
(KOYVOKR 'XHKOZKTSOZJKX1RGYYK-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]
Returns the value of the given calendar field. /PP"( />72]Yc[S\bObW]\ RS` 9ZOaaS 6aTV^aXP]2P[T]SPa 2WS 3ZS[S\bS RS` 9ZOaaS eS`RS\ W\ R`SW /PaQV\WbbS\ S`ZÉcbS`b( 5XT[S Bd\\Pah R]Yc[S\bWS`b RWS 2SYZO`ObW]\ RS` 7\abO\h c\R 9ZOaaS\dO`WOPZS\ h0 X]c 03 ]RS` 12 2WS 0SRScbc\U RS` 3ZS[S\bS YO\\ [O\ Oca RS[ 9c`hbSfb S`TOV`S\ ]RS` SbeOa OcaTºV`ZWQVS` W\RS[ [O\ OcT RS\ O`O[SbS`\O[S\ c\R RS\ 2ObS\bg^ RSa @ºQYUOPSeS`bSa 0SWa^WSZ(
void add(int field, int amount)
2S` O`O[SbS` d][ 2ObS\bg^ X]c 2WS ES`bS ROTº` abSVS\ W\\S`VOZP RS` ;SbV]RS c\bS` RS\ 0ShSWQV\S`\ UXT[S c\R P \^d]c hc` DS`TºUc\U 2S` /cT`cTS` RWSaS` ;SbV]RS PSY][[b YSW\ 3`USP\Wa hc`ºQY USZWSTS`b 2c`QV /\YZWQYS\ RSa ;SbV]RS\\O[S\a PSY][[b [O\ 2SbOWZa hc` ;SbV]RS PSaQV`WSPS\ ?a^VaP\\ 6aTV^aXP] ) 0]fT]Sd]VbQTXb_XT[ 2[XT]c U¶a SXT :[PbbT 6aTV^ aXP]2P[T]SPa
import java.util.*; public class Gregorian01 { public static void main(String[] args) { GregorianCalendar heute = new GregorianCalendar(); System.out.println(heute.get(Calendar.DAY_OF_MONTH)); System.out.println(heute.get(Calendar.MONTH)); System.out.println(heute.get(Calendar.YEAR)); } }
#'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
ÎQd]V id\ ?a^VaP\\ 6aTV^aXP] Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa OcQV RWS CV`hSWb OcaUSUSPS\ eW`R 2Ohc [caa SPS\TOZZa RWS ;SbV]RS VTc OcTUS`cTS\ eS`RS\ \c\ [Wb RS\ T]ZUS\RS\ SW\USPOcbS\ 9]\abO\bS\ OZa >O`O[SbS`( 1OZS\RO`6=C@ 1OZS\RO`;7
(KOYVOKR 1RGYYK6UOTZ
2WS AbO\RO`R9ZOaaS ?^X]c Wab BSWZ RSa [WbUSZWSTS`bS\ >OYSba YPePPfc AWS S\bVÉZb RWS PSWRS\ 4SZRS` f c\R g PSWRS d][ 2ObS\bg^ X]c /Za ;SbV]RS\ eS`RS\ d]\ WV` cO hc` DS`TºUc\U USabSZZb( T`dP[b c\R c^BcaX]V ?a^VaP\\ ?d]Zc )
0]fT]Sd]VbQTXb_XT[ U¶a SXT :[PbbT YPePPfc?^X]c
import java.awt.*; public class Punkt01 { public static void main(String[] args) Point p = new Point(5,3); System.out.println(p); } }
{
2WS /caUOPS aWSVb eWS T]ZUb Oca( java.awt.Point[x=5,y=3] Hc\ÉQVab eW`R RS` d]ZZS 72]Yc[S\bObW]\ RWS 0SaQV`SWPc\U RS` 9ZOaaS ?^X]c c\R R]`b W\aPSa]\RS`S RWS ;SbV]RS\ T`dP[b c\R c^BcaX]V ÎQd]V !) ;]RWTWhWS`S\ AWS ROa >`]U`O[[ a] ROaa SW\S heSWbS 7\abO\h d]\ ?^X]c S` abSZZb eW`R c\R ROaa Rc`QV /cT`cT SW\S` USSWU\SbS\ ;SbV]RS TSabUSabSZZb eW`R ]P RWS PSWRS\ >c\YbS UZSWQV aW\R ]RS` \WQVb ;»bd]Vbe^abRW[PV
import java.awt.*; public class Punkt02 { public static void main(String[] args) Point p1 = new Point(5,3); Point p2 = new Point(4,5); System.out.println(p1.equals(p2)); } }
{
$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
" <XcVT[XTUTacT :[PbbT QT]dciT]
ÎQd]V id\ ?a^VaP\\ ?d]Zc! ÎQd]V ( DS`aQVWSPS\ AWS RS\ >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\\ 7P[[^ EO\RSZ\ AWS ROa >`]U`O[[ c[ 2WSa [caa TSVZS`T`SW [rUZWQV aSW\ DS`acQVS\ AWS RO\OQV ROa >`]U`O[[ hc abO`bS\ 3a Y][[b RWS ;SZRc\U <]AcQV;SbV]R3``]`( [OW\ C[ RS\ AS`dWQS RS` 9ZOaaS 7P[[^ \cbhS\ hc Yr\\S\ PS\rbWUS\ eW` SW\ OcaTºV`PO `Sa >`]U`O[[ ROa SW\S 7\abO\h S`hScUb c\R SW\S `]U`O[[ c[ 3W\S [rUZWQVS 4SVZS`_cSZZS Wab ROaa PSW RS` C[eO\RZc\U RWS 9ZOaaS\PSaQV`SWPc\U d]\ 7P[[^ \WQVb W[ HcU`WTT Wab AbSZ $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# 4XVT]T :[PbbT] TabcT[[T]
ZS\ AWS RSaVOZP aWQVS` ROaa aWQV PSWRS >`]U`O[[S W\ RS[aSZPS\ DS`hSWQV\Wa PSTW\ RS\ 6W\eSWa Tº` 4]`bUSaQV`WbbS\S( AbSVS\ RWS 2ObSWS\ W\ c\bS`aQVWSRZWQVS\ =`R\S`\ a] [caa ºPS` RWS 2[Pbb_PcWDO`WOPZS RS` AcQV^TOR S\ba^`SQVS\R S`UÉ\hb eS`RS\ ÎQd]V !( ;OQVS\ AWS T]ZUS\RS\ DS`acQV( :raQVS\ AWS RWS 1ZOaa2ObSW 7P[ [^ R[Pbb \WQVb RWS ?cSZZRObSW YPeP c\R eO\RSZ\ AWS ROa >`]U`O[[ 7P[[^ 2[XT]c YPeP S`\Scb c[ 0SO\be]`bS\ AWS T]ZUS\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(KOYVOKR`[S6XLKTKOTKX-GT``GNRG[LMKXGJK[TMKXGJK
2WS /cTUOPS Tº` ROa T]ZUS\RS >`]U`O[[ ZOcbSb( 0WbbS S`abSZZS\ AWS SW\S 9ZOaaS ?adT UT] YPeP 2WSaS a]ZZ RWS 4ÉVWUYSWb VOPS\ SW\S\ 7\bSUS`ES`b hc a^SWQVS`\ c\R aWS a]ZZ RWS ;SbV]RS _adTU8]c S\bVOZbS\ W\ RS` US^`ºTb eW`R ]P RWSaS` 7\bSUS`eS`b SW\S US`ORS ]RS` SW\S c\US`ORS HOVZ Wab 2WS ;SbV]RS ZWSTS`b cadT ]RS` UP[bT O\ RS\ /cT `cTS` hc`ºQY 2S` ES`b RS` X]cDO`WOPZS\ eW`R OZa 7\WbWOZeS`b PSW[ 3`hScUS\ RS` 7\abO\h dS`USPS\ $!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
?a^VaP\\ ?adTUT] ) :[PbbT SXT TX]T] 8]cTVTafTac b_TXRWTac d]S ¶QTa_a¶Uc class Pruefen01 { private int zahl = 5; boolean pruefInt() { if ((zahl % 2) == 0) return true; else return false; } } ÎQd]V id\ ?a^VaP\\ ?adTUT] 3`abSZZS\ AWS SW\ OcaTºV`PO`Sa >`]U`O[[ ROa SW\S 7\abO\h d]\ ?adTUT] S`abSZZb c\R O\ RWSaS 7\abO\h SW\S
public class PruefenClient01 { public static void main(String[] args) { Pruefen01 p = new Pruefen01(); if (p.pruefInt()) System.out.println("Die Zahl ist gerade"); else System.out.println("Die Zahl ist ungerade"); } } ÎQd]V id\ ?a^VaP\\ ?adTUT] Ò\RS`\ AWS RWS 9ZOaaS ?adTUT] YPeP a] OP ROaa ROa 4SZR iPW[ \WQVb Sf^ZWhWb W\WbWOZW aWS`b eW`R EOa ZWSTS`b XSbhb RWS ;SbV]RS _adTU8]c- 2WS 3`YS\\b\Wa eW`R aSW\ ROaa ;S[PS`dO`WOPZS\ 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\S eSWbS`S Y][^ZSbb \ScS 9ZOaaS RWS 9ZOaaS 3Pcd\ AWS S\bVÉZb RWS 4SZRS` cPV \^]Pc c\R YPWa /czS`RS[ VOb RWSaS 9ZOaaS OZa eSWbS`S 3ZS[S\bS SW\WUS ;SbV]RS\ c[ [Wb RWSaS\ /bb`WPcbS\ hc O`PSWbS\ ?a^VaP\\ 3Pcd\ ) 3Pcd\ b_TXRWTa] d]S eTaPaQTXcT] import java.util.*; public class Datum01
{
private int tag; private int monat; private int jahr; void erstellen() { Calendar cal = new GregorianCalendar(); tag = cal.get(Calendar.DATE); monat = (cal.get(Calendar.MONTH) + 1); jahr = cal.get(Calendar.YEAR); } void ausgeben() { char c = '.'; System.out.printf("%s%s%s%s%s", tag, c, monat, c, jahr); } } 4a[ÊdcTad]VT] ida :[PbbT 3Pcd\ 2WS 9ZOaaS YO\\ 2Obc[aO\UOPS\ a^SWQVS`\ c\R aWS S\bVÉZb ;SbV]RS\ c[ RO[Wb hc O`PSWbS\ Hc[ 3`abSZZS\ RSa OYbcSZZS\ BOUSaRObc[ U`SWTb aWS hc`ºQY OcT 2WS\abZSWa bc\US\ RS` AbO\RO`RYZOaaS\ 2P[T]SPa c\R 6aTV^aXP]2P[T]SPa W\RS[ aWS SW\S 7\ abO\h RS` 9ZOaaS 6aTV^aXP]2P[T]SPa S`hScUb c\R RO\\ O\ RWSaS 7\abO\h RWS O`O[SbS` PS\cbhb RWS VTc;SbV]RS bcPcXR4SZRS` RWS ZSRWUZWQV a^`SQVS\RS
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
2WS @SWVS\T]ZUS RS` 3ZS[S\bRSTW\WbW]\ W\ SW\S` 9ZOaaS Wab ]V\S 0SRScbc\U 2WS 9ZOa aS eW`R SW\USZSaS\ OYbWdWS`b RO\\ abSVS\ OZZS bcPcXR4SZRS` hc` DS`TºUc\U SUOZ O\ eSZQVS` AbSZZS W[ ?cSZZbSfb aWS RSTW\WS`b aW\R /ZZS O\RS`S\ 4SZRS` abSVS\ hc` DS`Tº Uc\U \OQV RS` 7\abO\hS`hScUc\U C\R ;SbV]RS\ eS`RS\ \c` OcaUSTºV`b eS\\ aWS Sf^ZWhWb OcTUS`cTS\ eS`RS\ 3XT :[PbbT 3Pcd\ QT]dciT]
9ZOaaS\ abSZZS\ AS`dWQSa hc` DS`TºUc\U RWS d]\ OcaTºV`PO`S\ >`]U`O[[S\ ]RS` d]\ O\RS`S\ 9ZOaaS\ US\cbhb eS`RS\ Yr\\S\ <]QV TSVZb RWSaSa OcaTºV`PO`S >`]U`O[[ 2Oa \OQVT]ZUS\RS >`]U`O[[ 3Pcd\2[XT]c YPeP a]ZZ RWS \Sc S`abSZZbS 9ZOaaS 3P cd\ PS\cbhS\ c[ ROa OYbcSZZS BOUSaRObc[ d]\ VScbS hc S`hScUS\ c\R W\ SW\S[ 1]\a]ZSTS\abS` OcahcUSPS\ 3`abSZZS\ AWS PWbbS SW\S \ScS C[eO\RZc\UaSW\VSWb ?a^VaP\\ 3Pcd\2[XT]c ) 2[XT]c?a^VaP\\ U¶a SXT 3Pcd\:[PbbT public class DatumClient01 { public static void main(String[] args) Datum01 heute = new Datum01(); heute.erstellen(); heute.ausgeben(); } }
{
(KOYVOKR`[S'XHKOZKTSOZ@KOZGTMGHKT
2Oa \ÉQVabS 0SWa^WSZ PSaQV`SWPb SW\S 9ZOaaS RWS T]ZUS\RS 2WS\abZSWabc\US\ S`P`W\Ub( •
aWS a^SWQVS`b RWS Abc\RS\ ;W\cbS\ c\R ASYc\RS\ SW\S` PSabW[[bS\ CV`hSWb
•
aWS YO\\ SW\S PSZWSPWUS Abc\RS\hOVZ ORRWS`S\ c\R
•
aWS YO\\ RWS USa^SWQVS`bS HSWb OZa BcaX]V OcTPS`SWbS\ c\R RWSaS HSWQVS\YSbbS RO\\ RS[ /cT`cTS` RS` S\ba^`SQVS\RS\ ;SbV]RS hc` DS`TºUc\U abSZZS\
?a^VaP\\ ITXc) ITXcP]VPQT] b_TXRWTa] d]S eTaPaQTXcT] public class Zeit { private int stunde; private int minute; private int sekunde; Zeit(int stunde, int minute) { this.stunde = stunde; this.minute = minute; this.sekunde = 0; } Zeit(int stunde, int minute, int sekunde) { $$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# 4XVT]T :[PbbT] TabcT[[T]
this.stunde = stunde; this.minute = minute; this.sekunde = sekunde; } void addStunde(int st) { stunde = stunde + st; if (stunde > 24) stunde = stunde - 24; } public String toString() { String s1 = "Stunde: " + stunde + "\n"; String s2 = "Minute: " + minute + "\n"; String s3 = "Sekunde: " + sekunde + "\n"; return s1 + s2 + s3; } } 2WS 9ZOaaS S\bVÉZb SW\WUS A^`OQV[WbbSZ RWS eW` PWaVS` \c` O[ @O\RS S`ZÉcbS`b VOPS\ 3a VO\RSZb aWQV c[ T]ZUS\RS BVS[S\( •
9]\ab`cYb]`S\
•
=dS`Z]ORW\U d]\ ;SbV]RS\ c\R 9]\ab`cYb]`S\
•
=dS``WRS d]\ ;SbV]RS\
•
/`PSWbS\ [Wb RS[ AQVZºaaSZe]`b cWXb
:^]bcadZc^aT] 2WS S`abS\ PSWRS\ ;SbV]RS\ RWSaS` 9ZOaaS eS`RS\ OcQV 9]\ab`cYb]`S\ US\O\\b 9]\ab`cYb]`S\ eS`RS\ Ocb][ObWaQV OcTUS`cTS\ eS\\ SW\S \ScS 7\abO\h RS` 9ZOaaS S`hScUb eW`R AWS S\bVOZbS\ AbObS[S\ba hc[ 7\WbWOZWaWS`S\ RS` 4SZRS` 4]`[OZ c\bS` aQVSWRS\ aWQV RWSaS 9]\ab`cYb]`S\ d]\ \]`[OZS\ ;SbV]RS\ eWS T]ZUb( aWS [ºaaS\ RS\aSZPS\ O`O[SbS` S[^TÉ\Ub c\R SW\S\ eSWbS`S\ 9]\ab`cYb]` RS` R`SW >O`O[SbS` S`eO`bSb ;O\ PShSWQV\Sb RWSaS BSQV\WY OZa ÍPS`ZO RS\ d]\ 9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VO\Wa[ca \cbhb RWS 9ZOaaS ITXc AWS S\bVÉZb \É[ZWQV aSZPab SW\S ;SbV]RS c^BcaX]V c\R RO[Wb eW`R RWS UZSWQV\O[WUS ;SbV]RS W\ RS` Ac^S`YZOaaS ºPS`aQV`WS PS\ 2WS aSZPab USaQV`WSPS\S ;SbV]RS c^BcaX]V PS`SWbSb RWS SW\hSZ\S\ 4SZRS` RS` 9ZOaaS OZa BSfb OcT c\R ZWSTS`b RWSaS\ Ab`W\U OZa 3`USP\Wa O\ RS\ /cT`cTS` hc`ºQY ;S`YaObh( 2WS 8D; acQVb RWS ^OaaS\RS ;SbV]RS W\ T]ZUS\RS` @SWVS\T]ZUS( Hc\ÉQVab eW`R SW\S ;SbV]RS [Wb RS` UZSWQVS\ AWU\Obc` W\ STa 9ZOaaS RSa =PXSYba USacQVb OZa] W\ RS` SWUS\S\ 9ZOaaS ES\\ aWS R]`b \WQVb Tº\RWU eW`R USVb RWS AcQVS W\ RS` ºPS` US]`R\SbS\ 9ZOaaS eSWbS` PWa V]QV hc` 9ZOaaS >QYTRc OZa] PWa RWS USaO[bS 6WS`O` QVWS Rc`QVacQVb e]`RS\ Wab
$&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ :^]bcadZc^aT]
cWXbBRW[¶bbT[f^ac 7\\S`VOZP SW\S` ;SbV]RS YO\\ [O\ RW`SYb OcT RWS ;S[PS`dO`WOPZS\ RS` SWUS\S\ 9ZOaaS hcU`SWTS\ /R`SaaWS`b eS`RS\ aWS ºPS` RS\ SW\TOQVS\ O`O[SbS` eWS W[ >`]U`O[[ ITXc Y][[b Sa hc QYTRc ROa HcU`WTTa`SQVb _dQ[XR VOb [caa aWS W\ RS\ ROd]\ OPUSZSWbSbS\ 9ZOaaS\ OcQV _dQ[XR aSW\ ?a^VaP\\ ITXcCTbc) 0aQTXcT] \Xc STa ]Td TabcT[[cT] :[PbbT ITXc import java.util.*; public class ZeitTest { public static void main(String[] args) { // selbst erstellte Klasse benutzen Zeit z = new Zeit(7, 25); z.addStunde(2); System.out.println(z.toString()); // mitgelieferte Klasse benutzen GregorianCalendar heute = new GregorianCalendar(); int st = heute.get(Calendar.HOUR); int m = heute.get(Calendar.MINUTE); int se = heute.get(Calendar.SECOND); Zeit z2 = new Zeit(st, m, se); System.out.println(z2.toString()); } }
1UTYZX[QZUXKT
7\abO\hS\ eS`RS\ [Wb 6WZTS RSa AQVZºaaSZe]`bSa ]Tf S`hScUb 2c`QV ]Tf eW`R OcQV SW\S a] US\O\\bS 9]\ab`cYb]`[SbV]RS Ocb][ObWaQV OcTUS`cTS\ 2Oa Wab SW\S ;SbV] RS eSZQVS RS\aSZPS\
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
ab`cYb]`[SbV]RS Wab Sa SW\[OZWUS /`PSWbS\ Rc`QVhcTºV`S\ RWS PSW[ 3`abSZZS\ SW\Sa =PXSYba aW\\d]ZZ Phe \]beS\RWU aW\R 7V`S eWQVbWUabS /cTUOPS Wab Sa RWS 4SZRS` RS` 9ZOaaS [Wb W\RWdWRcSZZS\ /\TO\UaeS`bS\ hc dS`aSVS\
9ZGTJGXJQUTYZX[QZUXKT YKRHYZIUJOKXKT% ES\\ RS` >`]U`O[[WS`S` YSW\S\ 9]\ab`cYb]` aSZPab Q]RWS`b a] eW`R SW\ SW\USPOcbS` AbO\RO`R9]\ab`cYb]` OcaUSTºV`b 2S` AbO\RO`RY]\ab`cYb]` 2STOcZb9]\ab`cYb]` Wab RORc`QV USYS\\hSWQV\Sb ROaa S` YSW\S >O`O[SbS` S[^TÉ\Ub ?a^VaP\\ 8]Xc ) 0aQTXcT] \Xc ST\ 3TUPd[c:^]bcadZc^a
public class Init01 { int zahl1; char c; float zahl2; public static void main(String[] args) { Init01 instanz1 = new Init01(); System.out.println(instanz1.zahl1); System.out.println(instanz1.zahl2); } } 0SW RS` /caTºV`c\U RWSaSa >`]U`O[[a eW`R RS` c\aWQVbPO`S AbO\RO`RY]\ab`cYb]` OcaUSTºV`b 7[ \ÉQVabS\ 0SWa^WSZ Wab SW\ 9]\ab`cYb]` OcaR`ºQYZWQV ^`]U`O[[WS`b ?a^VaP\\ 8]Xc!) 0aQTXcT] \Xc TX]T\ bT[Qbc R^SXTacT] :^]bcadZc^a
public class Init02 int zahl1; char c; float zahl2;
{
Init02(int z1, char c, int z2) { zahl1 = z1; this.c = c; zahl2 = z2; } public static void main(String[] args) { Init02 instanz1 = new Init02(15, 'a', 27); System.out.println(instanz1.zahl1); System.out.println(instanz1.c); System.out.println(instanz1.zahl2); } } %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ :^]bcadZc^aT]
2S` 9]\ab`cYb]` [caa RS\ O `O[SbS` S[^TO\US\ W\ RWSaS[ 0SWa^WSZ eS`RS\ /`Uc[S\bS Tº` RWS R`SW 4SZRS` RS` 9ZOaaS S\bUSUS\ US\][[S\ ]aWbW]\a^O`O[SbS`( PSW[ /cT`cT RSa 9]\ab`cY b]`a [caa [O\ eWaaS\ O\ eSZQVS` >]aWbW]\ eSZQVS` ES`b S`eO`bSb eW`R 2WS O`O[SbS`O\UOPS\ W[ 9]^T RSa 9]\ab`cYb]`a eW` YS\ eWS RWS 2STW\WbW]\ d]\ Z]YOZS\ >O`O[SbS`\ ÎQd]V id\ ?a^VaP\\ 8]Xc! DS`acQVS\ AWS W\ RS` \PX];SbV]RS SW\S eSWbS`S 7\abO\h hc S`hScUS\ RWSa[OZ OZ ZS`RW\Ua ]V\S >O`O[SbS`ºPS`UOPS 2ORc`QV eW`R RS` 2STOcZb9]\ab`cYb]` OcTUS`cTS\ /PS` RWS C[eO\RZc\U S`hScUb T]ZUS\RS\ 4SVZS`(
"... cannot find symbol ... constructor Init02() ...
"
2S` 5`c\R ROTº` Wab( ES\\ d][ >`]U`O[[WS`S` SW\ 9]\ab`cYb]` ^`]U`O[[WS`b eW`R RO\\ eW`R RS` 2STOcZb9]\ab`cYb]` \WQVb [SV` Ocb][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bS\ :SWabc\Uaa^SYb`c[a RS` hcRS[ \]QV OcT c\aS`S W\RWdWRcSZZS\ 0SRº`T\WaaS O\US^Oaab eS`RS\ a]ZZ 2SaeSUS\ VObbS\ eW` SW\S \ScS 9ZOaaS 3Pcd\ SW\USTºV`b 2WSaS a]ZZ \OQVT]ZUS\R []RWTWhWS`b c\R c[ 9]\ ab`cYb]`S\ S`UÉ\hb eS`RS\ %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
?a^VaP\\ 3Pcd\) IfTX :^]bcadZc^aT] X] TX]Ta :[PbbT
import java.util.*; public class Datum { int tag; int monat; int jahr; Datum() { Calendar cal = new GregorianCalendar(); tag = cal.get(Calendar.DATE); monat = (cal.get(Calendar.MONTH) + 1); jahr = cal.get(Calendar.YEAR); } Datum(int t, int m, int j) { tag = t; monat = m; jahr = j; } void ausgeben(char zeichen) { char c = zeichen; System.out.printf("%s %s %s %s %s", tag, c, monat, c, jahr); } } 2WSaS 9ZOaaS VOb heSW 9]\ab`cYb]`S\ RS` S`abS 9]\ab`cYb]` Wab SW\ AbO\RO`RY]\ab`cY b]` RV S` S`eO`bSb YSW\S /`Uc[S\bS 4º` RS\ /cT`cT RSa heSWbS\ 9]\ab`cYb]`a aW\R R`SW X]c>O`O[SbS` \]beS\RWU 8OdO eÉVZb hc` /caTºV`c\UahSWb RS\ 9]\ab`cYb]` Oca RS` ^OaaS\R Wab C\R ^OaaS\R Wab RS` 9]\ab`cYb]` RO\\ eS\\ /\hOVZ c\R Bg^ RS` ºPS`USPS\S\ /`Uc[S\bS ºPS`SW\abW[[b [Wb RS` RSYZO`WS`bS\ /\hOVZ c\R RS[ Bg^ ;O\ aOUb 8OdO \W[[b RS\ 9]\ab`cYb]` RS` RWS S`eO`bSbS AWU\Obc` VOb ?a^VaP\\ 3Pcd\CTbc ) 8]bcP]iXXTaT] d]S 0dUadUT] STb aXRWcXVT] :^] bcadZc^ab
public class DatumTest01 { public static void main(String[] args) Datum d1 = new Datum(24, 12, 2005); d1.ausgeben('|'); } }
{
0SW[ 3`hScUS\ RS` 7\abO\h [Wb RS[ AQVZºaaSZe]`b ]Tf eS`RS\ R`SW :WbS`OZS OZa /` Uc[S\bS O\ RS\ 9]\ab`cYb]` ºPS`USPS\ %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ :^]bcadZc^aT]
ÎQd]V id\ ?a^VaP\\ 3Pcd\CTbc 3`abSZZS\ AWS SW\S heSWbS 7\abO\h 2WSa[OZ OPS` ]V\S >O`O[SbS`ºPS`UOPS O\ RS\ 9]\ab`cYb]` 9ZÉ`S\ AWS eSZQVS` 9]\ab`cYb]` OcaUSTºV`b eW`R ÍPS`^`ºTS\ AWS ROa 3`USP\Wa RWSaSa 9]\ab`cYb]`OcT`cTa
(KOYVOKR 1RGYYK8KINZKIQ
2Oa >`]U`O[[ ATRWcTRZYPeP S\bVÉZb SW\S 9ZOaaS\PSaQV`SWPc\U Tº` SW\ @SQVbSQY 2WS ROTº` \]beS\RWUS\ 2ObS\ aW\R heSW >]aWbW]\aO\UOPS\( ZW\Ya ]PS\ c\R `SQVba c\bS\ XSeSWZa O\USUSPS\ OZa f c\R gES`b /czS`RS[ S\bVÉZb RWS 9ZOaaS heSW 9]\ab`cYb] `S\ c\R aWS ºPS`aQV`SWPb RWS ;SbV]RS c^BcaX]V RS` 9ZOaaS >QYTRc ?a^VaP\\ ATRWcTRZ) >eTaaXST e^] eTa[^PS STb :^]bcadZc^ab import java.awt.*; import java.util.*; class Rechteck { private int x1, y1; private int x2, y2; Rechteck(int x1, int y1, int x2, int y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } Rechteck(Point linksoben, Point rechtsunten) { x1 = linksoben.x; y1 = linksoben.y; x2 = rechtsunten.x; y2 = rechtsunten.y; } public String toString() { return String.format("%d / %d / %d / %d", x1 , y1, x2, y2); } public static void main(String[] args) { Rechteck r1 = new Rechteck(5, 10, 20, 10); System.out.println(r1); } } <]QV SW\[OZ RS` 6W\eSWa OcT RWS ;SbV]RS c^BcaX]V) AWS Wab heO` Tº` XSRS 9ZOaaS dS` TºUPO` eSWZ aWS BSWZ RS` 9ZOaaS >QYTRc Wab eW`R OPS` W\ RWSaS[ >`]U`O[[ ºPS` aQV`WSPS\ c[ SW\S W\RWdWRcSZZS :rac\U hc PSY][[S\ %!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
ÎQd]V id\ ?a^VaP\\ ATRWcTRZ 3`abSZZS\ AWS SW\ heSWbSa =PXSYb a! ROPSW a]ZZ XSR]QV RS` heSWbS 9]\ab`cYb]` OcTUS `cTS\ eS`RS\ ;»bd]VbWX]fTXb( 2Ohc aW\R heSW 7\abO\hS\ RS` 9ZOaaS ?^X]c hc S`abSZZS\ 2WSaS [ºaaS\ RO\\ PSW RS` 7\abO\hWWS`c\U d]\ a! OZa >O`O[SbS` [WbUSUSPS\ eS`RS\ 7[ >OYSb YPePPfc UWPb Sa RWdS`aS 9ZOaaS\ c[ SW\S U`OTWaQVS 0S\cbhS`]PS`TZÉQVS hc W[^ZS[S\bWS`S\ 2Ohc USVr`S\ OcQV RWS 9ZOaaS\ ?^X]c 3X\T]bX^] c\R ATRcP]V[T 2WS 9ZOaaS ATRcP]V[T PWSbSb % dS`aQVWSRS\S 9]\ab`cYb]`S\ O\ ?a^VaP\\ ATRWcTRZ!) :[PbbT] QT]dciT] bXRW VTVT]bTXcXV import java.awt.*; public class Rechteck02 { public static void main(String[] args) { Point p1 = new Point(10,100); Dimension d1 = new Dimension(20,30); Rectangle r1 = new Rectangle(p1, d1); System.out.println(r1); } }
2WS eWQVbWUabS\ ;]bWdS Tº` ROa /`PSWbS\ [Wb 9ZOaaS\ aW\R •
RWS 9O^aSZc\U d]\ 2ObS\ RO[Wb SW\S aWQVS`S c\R PSeSWaPO`S DS`eS\Rc\U S` T]ZUb
•
RWS ;rUZWQVYSWb RS` EWS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ZOaaS\VWS`O`QVWS( 0OaWaYZOaaS
Ac^S`YZOaaS 3ZbS`\YZOaaS
S`PbdS`S`Pb /PUSZSWbSbS 9ZOaaS
AcPYZOaaS 9W\RYZOaaS
/PP 4( DS`S`Pc\UaVWS`O`QVWS Ac^S` c\R AcPYZOaaS 2OPSW Wab Sa [rUZWQV ROaa RWS AcPYZOaaS 2ObS\ c\R ;SbV]RS\ RS` Ac^S`YZOaaS OP É\RS`b ZraQVb ]RS` OcQV \ScS VW\hcTºUb 2WS 9ZOaaS\VWS`O`QVWS YO\\ bVS]`SbWaQV PS ZWSPWU bWST USaQVOQVbSZb eS`RS\ ^`OYbWaQV PSabSVb RO\\ RWS 5STOV` RS` ÍPS`T`OQV bc\U eSWZ RWS =PXSYbS aWQV Oca RS\ 0SaQV`SWPc\US\ OZZS` ºPS`US]`R\SbS\ 9ZOaaS\ hcaO[[S\aSbhS\
(KOYVOKR 1[TJKT[TJ2OKLKXGTZGRY9[HQRGYYKTJKX6GXZTKX1RGYYK
4º` RWS 0SWa^WSZS hc` DS`S`Pc\UabSQV\WY U`SWTS\ eW` OcT SW\ PS`SWba PSYO\\bSa >`] 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`
class Kunde extends Partner { private double umsatz; void ausgeben() { super.ausgeben(); System.out.println("Umsatz: " + umsatz); } void setUmsatz(double umsatz) { this.umsatz = umsatz; } } ÎQd]V id\ ?a^VaP\\ :d]ST 3`UÉ\hS\ AWS RWS PSabSVS\RS ?cSZZbSfbRObSW c[ RWS 9ZOaaS :d]ST DS`acQVS\ AWS SW \S C[eO\RZc\U 2OPSW eW`R T]ZUS\RS 4SVZS`[SZRc\U OcaUSUSPS\( QO\\]b TW\R ag[P]Z Q]\ab`cQb]` >O`b\S` %$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% ETaTaQd]V X]WTaXcP]RT
2WSaS 4SVZS`[SZRc\U Wab dS`eW``S\R c\R YSW\SaeSUa aSZPabS`YZÉ`S\R 2S` 6W\bS` U`c\R Wab( 7\ RS` \ScS\ 9ZOaaS :d]ST Wab YSW\ 9]\ab`cYb]` RSTW\WS`b OZa] eW`R SW\ 2STOcZb9]\ab`cYb]` SW\USTºUb 8SRS` 9]\ab`cYb]` `cTb c\aWQVbPO` OZa S`abS\ 0STSVZ RS\ 9]\ab`cYb]` aSW\S` Ac^S`YZOaaS OcT W\ RWSaS[ 4OZZ OZa] RS\ 9]\ab`cYb]` ?Pac ]Ta ESWZ XSR]QV W\ RS` >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;:<]bObW]\ aWSVS 9O^WbSZ 1ZOaa >O`b\S`O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;XTUTaP]c 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; } %'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
} class Lieferant extends Partner01a { private float rabatt; Lieferant(int nr1, String name1) { // neu super(nr1, name1); } void ausgeben() { super.ausgeben(); System.out.println("Rabatt: " + rabatt); } void setRabatt(float rabatt) { this.rabatt = rabatt; } } class Kunde extends Partner01a { private double umsatz; Kunde(int nr1, String name1) { // neu super(nr1, name1); } void ausgeben() { super.ausgeben(); System.out.println("Umsatz: " + umsatz); } void setUmsatz(double umsatz) { this.umsatz = umsatz; } } ?a^VaP\\ ?Pac]TaCTbc!) 1T]dciT] STa :[PbbT]
public class PartnerTest02 { public static void main (String[] args) { Partner01a p = new Partner01a(15, "Merker"); p.ausgeben(); Kunde k = new Kunde(12, "Schulz"); k.setUmsatz(50000); k.ausgeben(); Lieferant l = new Lieferant(21, "Meyer"); l.setRabatt(15.0f); l.ausgeben(); } } &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% ETaTaQd]V X]WTaXcP]RT
3W\S 7\abO\h RS` C\bS`YZOaaS :d]ST ]RS` ;XTUTaP]c S\bVÉZb \SPS\ RS\ SWUS\S\ /bb`W PcbS\ OcQV RWS /bb`WPcbS RWS d]\ RS` =PS`YZOaaS USS`Pb eS`RS\ c\R aWS YO\\ OcQV OcT RWS ;SbV]RS\ c\R 2ObS\ RS` =PS`YZOaaS hcU`SWTS\ 5`OTWaQV YO\\ RWSa a] RO`US abSZZb eS`RS\(
/bb`WPcb( d\bPci ES`b( $
Y
^Zca ;SbV]RS\ RS` 9ZOaa :d]ST @STS`S\h /bb`WPcb( ]a ES`b( ! /bb`WPcb( ]P\T ES`b( BRWd[i ^Zca ;SbV]RS\ RS` 9ZOaaS ?Pac]Ta
/PP %( 3W\S 7\abO\h RS` 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aS 0_UT[ c\R 1Xa]T XSeSWZa OPUSZSWbSb d]\ RS` 9ZOaaS >Qbc ?a^VaP\\ >Qbc) Bd_TaZ[PbbT U¶a fTXcTaT B_TiXP[XbXTad]VT] class Obst { private String name; private float gewicht; &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
Obst(String n, float g) { name = n; gewicht = g; } void print() { System.out.println("Bezeichnung: " + name); System.out.println("Gewicht: " + gewicht); } } 2WS 9ZOaaS /_UTZ a]ZZ OPUSZSWbSb aSW\ d]\ RS` 9ZOaaS >Qbc aWS S`Pb OZa] RWS ;S`Y[OZS ]P\T c\R VTfXRWc a]eWS RWS 4ÉVWUYSWb _aX]c hc[ /\hSWUS\ RS` 2ObS\ \WQVb USS`Pb eW`R RS` 9]\ab`cYb]` /czS`RS[ a]ZZ aWS aSZPab SW\ hcaÉbhZWQVSa /bb`WPcb dS`eOZbS\ \É[ZWQV ROa /\POcUSPWSb ?a^VaP\\ 0_UT[) D]cTaZ[PbbT e^] >Qbc class Apfel extends Obst { private String anbaugebiet; Apfel(String a, String n, float g) { super(n, g); anbaugebiet = a; } void print() { super.print(); System.out.println("Anbaugebiet: " + anbaugebiet); } } ÎQd]V
3`abSZZS\ AWS RWS hcaÉbhZWQVS 9ZOaaS 1Xa]T 2WSaS a]ZZ RWS 9ZOaaS >Qbc S`eSWbS`\ /Za hcaÉbhZWQVSa /bb`WPcb S\bVÉZb aWS RWS UPaQT /ZZS /bb`WPcbS RWS SWUS\S\ c\R RWS USS`P bS\ a]ZZS\ OcaUSUSPS\ eS`RS\ eS\\ Tº` SW\S 0W`\S\7\abO\h RWS ;SbV]RS _aX]c OcTUS`cTS\ eW`R ;»bd]Vbe^abRW[PV class Birne extends Obst { private String farbe; Birne(String f, String n, float g) { super(n, g); farbe = f; } void print() { &
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% ETaTaQd]V X]WTaXcP]RT
super.print(); System.out.println("Farbe
: " + farbe);
} } /PaQVZWSzS\R PS\rbWUS\ eW` \]QV SW\S 8OdO/^^ZWYObW]\ RWS RWS 9ZOaaS\PSaQV`SW Pc\US\ PS\cbhb 2Oa >`]U`O[[ >QbcCTbc YPeP a]ZZ T]ZUS\RS /cTUOPS\abSZZc\U Zr aS\( •
3a a]ZZ SW\S 7\abO\h RS` 9ZOaaS 0_UT[ [Wb RS\ Y]\Y`SbS\ ES`bS\ 1^bZ^_ ! 0[ cTb ;P]S S`abSZZb eS`RS\
•
3a a]ZZ SW\S 7\abO\h RS` 9ZOaaS 1Xa]T S`abSZZb eS`RS\( FX[[XP\b 2WaXbcQXa]T # 1^ST]bTT
•
2WS 2ObS\ RS` PSWRS\ 7\abO\hS\ a]ZZS\ OcT RS[ 9]\a]ZPWZRaQVW`[ OcaUSUSPS\ eS`RS\
;»bd]Vbe^abRW[PV
public class ObstTest01 { public static void main(String[] args) { Apfel a1 = new Apfel("Boskop", "Altes Land",120); Birne b1 = new Birne("Williams Christ", "Bodensee",140); a1.print(); b1.print(); } }
1UTYZX[QZUXKT[TJ
4OhWb( 2WS eWQVbWUabS\ @SUSZ\ Tº` ROa /`PSWbS\ [Wb 9]\ab`cYb]`S\ W[ HcaO[[S\VO\U [Wb RS` DS`S`Pc\U aW\R( 9]\ab`cYb]`S\ eS`RS\ \WQVb dS`S`Pb AWS Yr\\S\ W\\S`VOZP SW\S` 9ZOaaS ºPS`ZORS\ eS`RS\ SW\ ÍPS`aQV`SWPS\ Wab OPS` \WQVb [rUZWQV /PS`( 3W\ USUS\aSWbWUSa /cT`cTS\ RS` 9]\ab`cYb]`S\ Oca O\RS`S\ 9ZOaaS\ Wab [rUZWQV A] YO\\ SW\S C\bS`YZOaaS Sf^ZWhWb RS\ 9]\ab`cYb]` RS` Ac^S`YZOaaS OcT`cTS\ 2O\\ \dbb RWSaS` /cT`cT X] STa TabcT] ITX[T W[ 9]\ab`cYb]` RS` AcPYZOaaS abSVS\ 7[^ZW hWb W[ ?cSZZbSfb c\aWQVbPO` eW`R W[[S` hcS`ab RS` 2STOcZbY]\ab`cYb]` RS` Ac^S` YZOaaS OcTUS`cTS\ ?a^VaP\\ :^]bcadZc^a ) ATXWT]U^[VT STa :^]bcadZc^aPdUadUT public class Konstruktor01 { public static void main(String[] args) { ClassB b = new ClassB(); } } class ClassA { &!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
ClassA () { System.out.println("Hier ist Konstruktor A"); } } class ClassB extends ClassA { ClassB() { System.out.println("Hier ist Konstruktor B"); } }
9ZGZOYINK+RKSKTZKKOTKX1RGYYK
2WS W\ SW\S` 9ZOaaS RSYZO`WS`bS\ 4SZRS` eS`RS\ abO\RO`R[ÉzWU ^`] 7\abO\h W[ /` PSWbaa^SWQVS` O\USZSUb c\R [Wb W\RWdWRcSZZS\ ES`bS\ USTºZZb RV Sa UWPb YSW\S US [SW\aO[S\ 2ObS\PS`SWQVS Tº` RWS 7\abO\hS\ /\US\][[S\ OPS` eW` PS\rbWUS\ PSW RS` DS`O`PSWbc\U SW\S` 9ZOaaS SW\ 4SZR ROa Tº` P[[T =PXSYbS hc` DS`TºUc\U abSVS\ a]ZZ eSWZ Sa c\OPVÉ\UWU d]\ SW\hSZ\S\ 7\abO\hS\ OZZUS[SW\S 7\T]`[ObW]\S\ OcT \SV[S\ a]ZZ 2Oa Yr\\bS h0 SW\ Ac[[S\TSZR ]RS` SW\ HÉVZS` Tº` RWS /\hOVZ RS` 7\abO\hS\ aSW\ 2WS :rac\U Wab ROaa RWSaSa 3ZS[S\b [Wb RS[ AQVZºaaSZe]`b bcPcXR US YS\\hSWQV\Sb eW`R ?a^VaP\\ BcPcXR ) bcPcXREPaXPQ[T d]PQWÊ]VXV e^] 8]bcP]iT]
public class Static01 { static int zaehler = 0; Static01() { zaehler++; } public static void main(String[] args) Static01 z1 = new Static01(); Static01 z2 = new Static01(); System.out.println(zaehler); } }
{
2WS DO`WOPZS iPTW[Ta eW`R O\USZSUb eS\\ RWS 9ZOaaS W\ RS\ /`PSWbaa^SWQVS` USZORS\ eW`R AWS abSVb RO\\ a]T]`b Tº` RWS `]U`O[[ a] ROaa RWS DO`WOPZS iPTW[Ta SW\S UO\h \]`[OZS ;S[ PS`dO`WOPZS eW`R 2O[Wb RO\OQV RWS C[eO\RZc\U TSVZS`T`SW Rc`QVUSTºV`b eW`R [caa
&"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& BcPcXbRWT 4[T\T]cT TX]Ta :[PbbT
OcQV RWS `ºTS\ AWS RO\\ eWS aWQV RWS /caUOPS RSa >`]U`O[[a dS`É\RS`b ;»bd]Vbe^abRW[PV
public class Static02 { int zaehler = 0; Static02() { zaehler++; } public static void main(String[] args) Static02 z1 = new Static02(); Static02 z2 = new Static02(); System.out.println(z1.zaehler); System.out.println(z2.zaehler); } k
{
2ORc`QV ROaa RWS DO`WOPZS iPTW[Ta hc SW\S` UO\h \]`[OZS\ 7\abO\hdO`WOPZS\ US [OQVb ec`RS eW`R aWS OcQV ^`] 7\abO\h W[ /`PSWbaa^SWQVS` O\USZSUb 2Oa AQVZºaaSZe]`b bcPcXR YO\\ OcQV Tº` RWS 2STW\WbW]\ d]\ ;SbV]RS\ O\USUSPS\ eS`RS\ 2O\\ aW\R RWSa ;SbV]RS\ RWS OZa a] US\O\\bS 9ZOaaS\[SbV]RS\ c\OPVÉ\ UWU d]\ RS` 3fWabS\h SW\Sa =PXSYba OcTUS`cTS\ eS`RS\ Yr\\S\ 2WS /R`SaaWS`c\U d]\ bcPcXR3ZS[S\bS\ S`T]ZUb W\\S`VOZP RS`aSZPS\ 9ZOaaS ºPS` RS\
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
8]bcP]i4[T\T]cT
:[PbbT]4[T\T]cT
ÉczS`ZWQV S`YS\\PO`
2STOcZb YSW\S AQVZºaaSZe]`b
AQVZºaaSZe]`b bcPcXR
e]Tº` SW\USaSbhb
W\RWdWRcSZZS 3WUS\aQVO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\]QV YSW\S 7[^ZS[S\bWS`c\U OZa] YSW\S\ @c[^T Ag\bOYbWaQV S`YS\\b [O\ 7\bS`TOQSa RO`O\ ROaa O\abSZZS RSa AQVZºaaSZe]`ba R[Pbb ROa AQVZºaaSZe]`b X]cTaUPRT PS\cbhb eW`R ?a^VaP\\ 8]cTaUPRT ) BRW]XccbcT[[T]QTbRWaTXQd]V U¶a ifTX
' FTXcTaT B_aPRW\XccT[ U¶a ATUTaT]ich_T] X]cTaUPRT T]d\
2WSaS 7\bS`TOQS0SaQV`SWPc\U RSYZO`WS`b RWS PSWRS\ ;SbV]RS\( bTcIPW[ c\R VTc IPW[ 5S\Oc eWS 9ZOaaS\ OcQV Yr\\S\ 7\bS`TOQSa US\cbhb eS`RS\ hc[ DS`SW\PO `S\ d]\ @STS`S\hdO`WOPZS\ ?a^VaP\\ 8]cTaUPRTCTbc ) 8]cTaUPRT P[b 3PcT]ch_ QTX STa 3TZ[PaPcX^]
class InterfaceTest01 { public static void main(String[] args) Interface01 schnittstelle01; } }
{
/PS` \WQVb [rUZWQV Wab ROa 3`hScUS\ SW\Sa =PXSYba RV ROa /\ZSUS\ d]\ A^SWQVS` ^ZObh Tº` SW\ 7\bS`TOQS RS\\ Sa TSVZb \]QV RWS 7[^ZS[S\bWS`c\U 7[^ZS[S\bWS`b eW`R ROa 7\bS`TOQS Rc`QV SW\S 9ZOaaS\PSaQV`SWPc\U RWS aWQV OcT RWSaSa 7\bS`TOQS PShWSVb 2Ohc RWS\b ROa AQVZºaaSZe]`b W[^ZS[S\ba ?a^VaP\\ 8]cTaUPRTCTbc!) 8\_[T\T]cXTad]V TX]Tb 8]cTaUPRTb
public class InterfaceTest02 implements Interface01 { int zahl1; public void setZahl1(int z) { zahl1 = z; } public int getZahl1() { return zahl1; } public static void main(String[] args) { Interface01 schnittstelle01; schnittstelle01 = new InterfaceTest02(); schnittstelle01.setZahl1(5); System.out.println(schnittstelle01.getZahl1()); } } 2c`QV ROa AQVZºaaSZe]`b X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[T\T]cXTad]V STb 8]cTaUPRT d]S 3aXeTa ?a^VaP\\ P[[TaSX]Vb ]^RW UTW[TaWPUc public class InterfaceTest03 { public static void main(String[] args) { A a = new B(); System.out.println(a.potenzieren(5)); } } class B implements A { int z = 5; int potenzieren() { return z * z; } } ÎQd]VT] id\ ?a^VaP\\ 8]cTaUPRTCTbc" ÎQd]V ( 2WS C[eO\RZc\U eW`R [Wb T]ZUS\RS` 4SVZS`[SZRc\U OPUSP`]QVS\( 0 Wa \]b OPab`OQb O\R R]Sa \]b ]dS``WRS OPab`OQb [SbV]R ^]bS\hWS`S\W\b W\ / 9ZÉ`S\ AWS RWS C`aOQVS RWSaSa 4SVZS`a 6W\eSWa( 2WS AWU\Obc`S\ W\ 7\bS`TOQS c\R 9ZOaaS [ºaaS\ SfOYb ºPS`SW\abW[[S\ ÎQd]V !(
&&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' FTXcTaT B_aPRW\XccT[ U¶a ATUTaT]ich_T] X]cTaUPRT T]d\
F^id QaPdRWc \P] 8]cTaUPRTb.
/>7A^ShWTWYObW]\S\ PSabSVS\ hc[ 5`]zbSWZ Oca 7\bS`TOQS0SaQV`SWPc\US\ AWS ZSUS\ ROa >`]b]Y]ZZ Tº` RS\ /cT`cT d]\ 2WS\abZSWabc\US\ TSab W\RS[ RWS ;SbV]RS\ AWU\Obc`S\ SfOYb PSaQV`WSPS\ a]eWS RS` @ºQYUOPSbg^ c\R hcaÉbhZWQVS ;]RWTWS` TSab USZSUb eS`RS\ 2O[Wb Yr\\S\ c\bS`aQVWSRZWQVS HWSZS S``SWQVb eS`RS\( •
4º` RS\ /cT`cTS` RS` ;SbV]RS\ `SWQVS\ RWS 7\T]`[ObW]\S\ ºPS` RWS AQV\WbbabSZZS c[ RWS 2WS\abZSWabc\U \cbhS\ hc Yr\\S\ 2WS SWUS\bZWQVS 7[^ZS[S\bWS`c\U YO\\ WV[ dS`P]`US\ PZSWPS\ h0 Oca AWQVS`VSWba ]RS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O\\ DO`W OPZS\ RSYZO`WS`S\ c\R ROPSW OZa Bg^ SW\S T]d\0SaQV`SWPc\U dS`eS\RS\ 2ORc`QV eW`R SW\ bg^aWQVS`Sa /`PSWbS\ [Wb RS\ 9]\abO\bS\ RS` T]d\ S`[rUZWQVb 7\bS`\ eW`R RWS /cThÉVZc\U RS` 9]\abO\bS\ [Wb SW\S` 5O\hhOVZ dS`Y\º^Tb ?a^VaP\\ 4]d\ ) T]d\ P[b bT_PaPcT 4X]WTXc d]PQWÊ]VXV e^] TX]Ta :[PbbT enum Farbe { rot, gruen, blau; } public class Enum01 { public static void main(String[] args) { for (Farbe f : Farbe.values()) System.out.println(f); } } &'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
:[PbbT] QTbRWaTXQT] d]S QT]dciT]
7\ RWSaS[ 0SWa^WSZ abSVb T]d\ PdU V[TXRWTa 4QT]T eWS RWS 9ZOaaS c\R Yr\\bS OcQV SW\S SWUS\S C[eO\RZc\UaSW\VSWb aSW\ Ag\bOYbWaQV S`YS\\b [O\ 3\c[a RO`O\ ROaa O\abSZZS RSa AQVZºaaSZe]`ba R[Pbb ROa AQVZºaaSZe]`b T]d\ PS\cbhb eW`R 3\c[a Yr\\S\ OcQV X]]TaWP[Q TX]Ta :[PbbT UZSWQV`O\UWU [Wb ;SbV]RS\ OPS` \WQVb W\\S`VOZP d]\ ;SbV]RS\ PS\cbhb eS`RS\ ?a^VaP\\ 4]d\!) T]d\ X]]TaWP[Q TX]Ta :[PbbT
public class Enum02 { enum Wochentage { sonntag,montag,dienstag,mittwoch, donnerstag,freitag,samstag; } public static void main(String[] args) { for (Wochentage w : Wochentage.values()) System.out.println(w); } } 3\c[0SaQV`SWPc\US\ Yr\\S\ eWS \]`[OZS 9ZOaaS\ USaSVS\ eS`RS\ AWS S`PS\ ;S bV]RS\ d]\ WV`S` 0OaWaYZOaaS 4]d\ c\R aWS Yr\\S\ SWUS\S ;SbV]RS\ S\bVOZbS\ 2Oa T]ZUS\RS 0SWa^WSZ PSabSVb Oca SW\S` C[eO\RZc\UaSW\VSWb RWS a]e]VZ RWS T]d\ 0SaQV`SWPc\U OZa OcQV WV`S 0S\cbhc\U S\bVÉZb 3a RS[]\ab`WS`b T]ZUS\RS DS`O`PSW bc\Ua[rUZWQVYSWbS\( •
T]d\0SaQV`SWPc\US\ Yr\\S\ OZa Bg^ SW\S` DO`WOPZS\ US\cbhb eS`RS\
•
[Wb RS[ XUAbObS[S\b eW`R RS` OYbcSZZS ES`b dS`UZWQVS\ [Wb SW\S[ Y]\abO\bS\ ES`b Oca RS` S\c[0SaQV`SWPc\U
•
[Wb RS[ bfXcRWAbObS[S\b eW`R SW\S SZSUO\bS ;SV`TOQV/PT`OUS `SOZWaWS`b
•
[Wb RS` U^aAQVZSWTS eW`R RS` Y][^ZSbbS ES`bSPS`SWQV RSa T]d\Bg^a dS`O`PSWbSb
•
/cT`cT SW\S` ;SbV]RS Oca RS` T]d\0SaQV`SWPc\U
?a^VaP\\ 4]d\") T]d\1TbRWaTXQd]V U¶a ch_bXRWTaT 0dUiÊW[d]VT]
Snum Tageszeit { morgens, mittag, abends; void anzeigen() { System.out.println(this); } } public class Enum03 { public static void main(String[] args) { Tageszeit t1; // Variable definieren
'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' FTXcTaT B_aPRW\XccT[ U¶a ATUTaT]ich_T] X]cTaUPRT T]d\
t1 = Tageszeit.mittag; // Wertezuweisung if (t1 == Tageszeit.mittag) // Variable abfragen System.out.println("Guten Tag"); switch(t1) { case morgens: System.out.println("Guten Morgen"); break; case mittag: System.out.println("Guten Tag"); break; case abends: System.out.println("Guten Abend"); break; } for (Tageszeit t2 : Tageszeit.values()) System.out.println(t2); t1.anzeigen(); // Aufruf einer Methode } }
E] ZWSUb RS` D]`bSWZ SW\S` T]d\0SaQV`SWPc\U W[ DS`UZSWQV hc bcPcXR UX]P[DO`WOPZS\- 2WS /\be]`b UWPb ROa \OQVT]ZUS\RS >`]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\ eSWbS`S ;SbV] RS\ eWS T`dP[b eP[dTb ]RS` c^BcaX]V hc` DS`TºUc\U eSWZ aWS d]\ RWSaS` 9ZOaaS USS`Pb eS`RS\ 2Oa S`VrVb RWS DWSZaSWbWUYSWb c\R :SWabc\UaTÉVWUYSWb
@[YGSSKTLGYY[TM
3W\S 9ZOaaS Wab SW\S AQVOPZ]\S bS[^ZObS PZcS^`W\b 0Oc^ZO\ =PXSYb[cabS` RWS DO `WOPZS\ c\R ;SbV]RS\ Tº` SW\S 5`c^^S d]\ =PXSYbS\ RSTW\WS`b 2c`QV RWS 2STW\WbW]\ SW\S` \ScS\ 9ZOaaS S`eSWbS`b RS` >`]U`O[[WS`S` RWS A^`OQVS c[ SW\S\ \ScS\ 2ObS\ bg^ 3XT fXRWcXVbcT] 4[T\T]cT TX]Ta :[PbbT
class A { int z; A() { ... } void verarbeiten(int a) { ... } }
/bb`WPcb4SZRDO`WOPZS 9]\ab`cYb]` ;SbV]RS
7[ 9]^T RS` 9ZOaaS c\[WbbSZPO` d]` RS[ AQVZºaaSZe]`b R[Pbb Yr\\S\ RWS ;]RWTWS` _dQ[XR ]RS` _aXePcT O\USUSPS\ eS`RS\ c[ RWS HcU`WTTa`SQVbS OcT RWSaS 9ZOaaS TSab hcZSUS\ TOZZa aWS d]\ RS` AbO\RO`RO\\OV[S OPeSWQVS\ aWSVS VWS`hc 9O^WbSZ $ 6W\bS` RS[ AQVZºaaSZe]`b R[Pbb eW`R RS`
7\abO\hdO`WOPZS\ c\R 7\abO\h[SbV]RS\( RWSaS aW\R XSeSWZa USPc\RS\ O\ SW\S UO\h PSabW[[bS 7\abO\h RV aWS SfWabWS`S\ S`ab eS\\ SW\S 7\abO\h S`hScUb e]` RS\ Wab c\R Yr\\S\ OcQV S`ab RO\\ US\cbhb eS`RS\
•
9ZOaaS\dO`WOPZS\ c\R 9ZOaaS\[SbV]RS\ RWSaS aW\R [Wb RS[ AQVZºaaSZe]`b bcPcXR USYS\\hSWQV\Sb c\R Yr\\S\ US\cbhb eS`RS\ ]V\S ROaa SW\S 7\abO\h S`hScUb e]`RS\ Wab) aWS SfWabWS`S\ a]POZR RWS 9ZOaaS W\ RS\ /`PSWbaa^SWQVS` USZORS\ eW`R
/czS`RS[ S\bVÉZb RS` 9ZOaaS\P]Rg RW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DS`S`Pc\U PS`cVS\ /aa]hWObW] \S\ /Za /aa]hWObW]\ eW`R hc\ÉQVab SW\[OZ XSRS 4]`[ SW\S` 0ShWSVc\U heW aQVS\ heSW 9ZOaaS\ PShSWQV\Sb RWS \WQVb OcT DS`S`Pc\U PS`cVb <ÉVS`S /\UO PS\ h0 ºPS` RWS /`b RS` @SOZWaWS`c\U eS`RS\ ROPSW \WQVb US[OQVb 3`USP\Wa RSa ==2 W\ C;: R]Yc[S\bWS`S\
2WS A^ShWTWYObW]\S\ RS` ==2 [ºaaS\ R]Yc[S\bWS`b eS`RS\ 6WS` VSZTS\ RWS dS`aQVWSRS\S\ 2WOU`O[[S RS` C\WTWSR ;]RSZW\U :O\UcOUS C;: 7\aPSa]\RS `S aW\R 9ZOaaS\RWOU`O[[S VWZT`SWQV 2SbOWZa aWSVS \ÉQVabS\ /PaQV\Wbb
3a UWPb heSW Tc\RO[S\bOZS /`bS\ d]\ DS`PW\Rc\US\ 0ShWSVc\US\ @SZObW]\S\ /a a]hWObW]\S\ heWaQVS\ 9ZOaaS\( RWS XbP0ShWSVc\U DS`S`Pc\U h0 9ZOaaS 0 Wab SW\ a^ShWSZZS` Bg^ RS` 9ZOaaS / RWS WPbP0ShSWQVc\U /aa]hWObW]\ h0 9ZOaaS / VOb SW\ =PXSYb RS` 9ZOaaS 0
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!" >QYTZc^aXT]cXTacT BhbcT\T]cfXRZ[d]V
/YG(K`OKN[TM
class Unterklasse extends Oberklasse { ...
}
D]`OcaaSbhc\U Tº` ROa 0WZRS\ SW\S` a]ZQVS\ 9ZOaaS\VWS`O`QVWS Wab SW\S 0ShWSVc\U RWS PSaQV`WSPS\ eS`RS\ YO\\ OZa 5S\S`OZWaWS`c\U DS`OZZUS[SW\S`c\U RS` C\bS`YZOaaS Phe A^ShWOZWaWS`c\U DS`TSW\S`c\U RS` =PS`YZOaaS HWSZ Wab RWS EWSRS`dS`eS\Rc\U d]\ d]`VO\RS\S[ 1]RS 2WS C\bS`YZOaaS S`Pb OZZS 4ÉVWUYSWbS\ RS` =PS`YZOaaS 2OPSW YO\\ aWS RWS Ab`cYbc` ]RS` ROa DS`VOZbS\ É\RS`\ ]V\S ROaa RWS =PS`YZOaaS ROd]\ PS`ºV`b Wab 3W\ eSWbS`S` D]`bSWZ RS` DS`S`Pc\UabSQV\WY S`UWPb aWQV RO`Oca ROaa ºPS`OZZ RO e] SW\ =PXSYb RS` US\S`SZZS\ 9ZOaaS [rUZWQV Wab OcQV SW\ =PXSYb RS` a^ShWSZZS\ 9ZOaaS abSVS\ YO\\ 0SWa^WSZ( ?a^VaP\\ ETaTaQd]V ) IdfTXbd]VbZ^\_PcXQX[XcÊc d]S ETaTaQd]VbWXTaPa RWXT public class Vererbung01 { public static void main(String[] args) A a = new A(); B b = new B(); System.out.println(b.str); a = b; System.out.println(a.str); } }
{
class A { String str = "KlasseA"; } class B extends A { } 2WS ES`bShceSWac\U a = b Wab S`ZOcPb eSWZ 0 SW\S AcPYZOaaS d]\ / Wab 0SW[ 3`hScUS\ SW\S` 7\abO\h RS` AcPYZOaaS eS`RS\ X\\Ta P[[T 3ZS[S\bS RS` Ac ^S`YZOaaS Ocb][ObWaQV SW\USPSbbSb W\ ROa \Sc S`hScUbS =PXSYb 2WSaS S\US 0W\Rc\U VOb XSR]QV \WQVb \c` D]`bSWZS Sa PSabSVb aSV` ZSWQVb RWS 5STOV` RS` ÍPS`T`OQVbc\U d]\ 9ZOaaS\ 2WS DS`S`Pc\U eW`R W\ C;: Rc`QV SW\S\ ]TTS\S\ >TSWZ OcaUSVS\R d]\ RS` AcPYZOaaS W\ @WQVbc\U Ac^S`YZOaaS RO`USabSZZb
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!
<^Sd[T T]cfTaUT] ZP_bT[] d]S S^Zd\T]cXTaT]
NGYG(K`OKN[TMKT'YYU`OGZOUT 0ShWSVc\US\ RWS \WQVb OcT DS`S`Pc\U PS`cVS\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 ROa =PXSYb 0 W\ SW\S` ;SbV]RS [Wb ]Tf S`hScUb e]`RS\ aSW\( ?a^VaP\\ 2[Pbb0) 8]bcP]i TaiTdVT] d]S QT]dciT]
public class ClassA { public static void main(String[] args) { new ClassB("Von wem wird dies ausgegeben?"); } } class ClassB { ClassB(String text) { // Konstruktor System.out.println(text); } } 2WSaS /`b RS` DS`PW\Rc\U heWaQVS\ 9ZOaaS\ Wab W[[S` RO\\ aW\\d]ZZ eS\\ AS`dWQS W\ a^ShWSZZS ;]RcZS OcaUSZOUS`b eW`R 2Oa >`]U`O[[ 2[Pbb0 VOb c\OPVÉ\UWU d][ BVS[O /aa]hWObW]\ SW\S hcaÉbhZWQVS 0S a]\RS`VSWb( Sa S`hScUb [Wb ]Tf SW\ P]^]h\Tb >QYTZc d]\ RS` 9ZOaaS 0 2Oa Wab W[ [S` RO\\ aW\\d]ZZ eS\\ ZSRWUZWQV RWS 7\abO\hWWS`c\U OZa] ROa 2c`QVZOcTS\ RSa 9]\ab`cYb]`a OcaUSTºV`b eS`RS\ a]ZZ RWS Z]YOZS DO`WOPZS Tº` RWSaSa =PXSYb RO\OQV OPS` \WQVb [SV` PS\rbWUb eW`R !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!" >QYTZc^aXT]cXTacT BhbcT\T]cfXRZ[d]V
3W\S O\RS`S DO`WO\bS RS` /aa]hWObW]\ RS[]\ab`WS`b ROa T]ZUS\RS >`]U`O[[ 6WS` S[^TÉ\Ub SW\S ;SbV]RS SW\ =PXSYb d]\ 0 OZa >O`O[SbS` ?a^VaP\\ 2[Pbb0) ÎQTaVPQT TX]Ta ATUTaT]i e^] 0 ]PRW 1
public class ClassA { String str = "Von wem wird dies ausgegeben?"; public static void main(String[] args) { ClassA a = new ClassA(); ClassB b = new ClassB(a); // Hier ist meine Adresse } } class ClassB { ClassB(ClassA a) { System.out.println(a.str); } } 2WSaS /`b RS` DS`PW\Rc\U heWaQVS\ RS\ 9ZOaaS\ eW`R ^`O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QVb [SV` dS`TºUPO` 0SWa^WSZ( 3a UWPb RWS 9ZOaaS 0dc^ RWS aWQV cO hcaO[[S\aSbhb Oca =PXSYbS\ RS` 9ZOa aS\ APS c\R BXci <^c^a dbf 0SW RS` 9][^]aWbW]\ RS` 9ZOaaS 0dc^ Wab ROa APS OZ a] d]ZZabÉ\RWU S\bVOZbS\ A]POZR SW\S 7\abO\h d]\ 0dc^ S`hScUb eW`R eW`R OcQV ROa 2ObS\[S[PS` d][ Bg^ APS S`hScUb 2WS 9][^]aWbW]\ eW`R W\ C;: Rc`QV SW\S Oca USTºZZbS @OcbS RO`USabSZZb !!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!
<^Sd[T T]cfTaUT] ZP_bT[] d]S S^Zd\T]cXTaT]
2Oa T]ZUS\RS >`]U`O[[ RS[]\ab`WS`b RWSaS S\US 0ShWSVc\U heWaQVS\ RS\ 9ZOaaS\ / c\R 0 6WS` aW\R =PXSYbS d]\ / T]cWP[cT] X] 9ZOaaS 0 aWS aW\R SW\ /bb`WPcb RS` 9ZOaaS 0 c\R ROa PSRScbSb eS\\ SW\S 7\abO\h d]\ 0 S`hScUb eW`R eW`R OcQV SW\ =PXSYb d]\ / PS\rbWUb ?a^VaP\\ 2[PbbCTbc) 3XT :[PbbT 1 T]cWÊ[c P[b QYTZc STa :[PbbT 0
public class ClassTest { public static void main(String[] args) { ClassA a = new ClassA("Von wem wird dies ausgegeben?"); ClassB b = new ClassB(a); b.ausgeben(); } } class ClassA { String str; ClassA(String s) { str = s; } } class ClassB { private ClassA a; ClassB(ClassA a) { this.a = a; } void ausgeben() { System.out.println(a.str); } } 1TfTacd]V STa d]cTabRWXTS[XRWT] :[PbbT]QTiXTWd]V QTX\ 1X[ST] e^] ]TdT] :[PbbT] 2WS 9ZOaaS\ aW\R ROa eWQVbWUabS ;WbbSZ Tº` 1]RS`ScaS W\ ]PXSYb]`WS\bWS`bS\ AgabS [S\ 8OdO S`ZOcPb Sa RS[ >`]U`O[[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SWZ abSZZb SW\S DS`OZZUS[SW\S`c\U Phe A^ShWOZWaWS`c\U d]\ 3WUS\aQVOTbS\ RO` aWS eW`R OcQV OZa WabSW\0ShWSVc\U PS hSWQV\Sb
!%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!
<^Sd[T T]cfTaUT] ZP_bT[] d]S S^Zd\T]cXTaT]
6WS` SW\S ÍPS`aWQVb ºPS` RWS eWQVbWUabS\ 3ZS[S\bS SW\Sa 9ZOaaS\RWOU`O[[a(
Name Attribute
Klasse
Operationen
Objekt
Assoziation
Aggregation
Komposition
Vererbung /PP ( 3ZS[S\bS SW\Sa C;:9ZOaaS\RWOU`O[[a 3W\S ab`S\US dWacSZZS C\bS`aQVSWRc\U heWaQVS\ =PXSYb c\R 9ZOaaS Wab W\ C;: \WQVb d]`USaSVS\ PSWRS eS`RS\ Rc`QV @SQVbSQYS `S^`ÉaS\bWS`b 2WS 0SaQV`WTbc\U RS` 9Éab QVS\ Wab eSWbUSVS\R eOVZT`SW <SPS\ RWSaS\ 9ZOaaS\RWOU`O[[S\ aW\R W\ C;: OcQV /YbWdWbÉbaRWOU`O[[S [rUZWQV 2WSaS hSWUS\ UO\h OZZUS[SW\S /PZÉcTS c\R Yr\\S\ OcQV PS\cbhb eS`RS\ c[ /ZU]`WbV[S\ U`OTWaQV RO`hcabSZZS\ ÒV\ZWQV eWS W\ SW\S[ >/> eW`R Rc`QV /YbWdWbÉbaRWOU`O[[S RS` 9]\b`]ZZTZcaa U`OTWaQV RO`USabSZZb E^acTX[ STa D<;=^cPcX^] W[ DS`UZSWQV hc >/> ]RS`
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!$ ?PccTa] d]S 5aP\Tf^aZb
6GZZKXT[TJ,XGSK]UXQY *KYOMT6GZZKXT+TZ][XLYS[YZKX
=PXSYb]`WS\bWS`bS >`]U`O[[WS`c\U c\bS`aQVSWRSb aWQV d]\ ab`cYbc`WS`bS` >`]U`O[[WS `c\U \WQVb \c` RORc`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O`WOPZS\ PS\cbhb ]RS` RS` >`]U`O[[WS`S` PS\cbhb ROa 8cTaPc^a ?PccTa] ]RS` Sa eW`R RWS TafTXcTacT U^aBRW[TXUT Q]RWS`b ?a^VaP\\ 0aaPh;Xbc ) ;»bd]Vbe^abRW[PV 8cTaPc^a?PccTa]
import java.util.*; public class ArrayList01 { public static void main(String[] args) { ArrayList sammlung = new ArrayList(); sammlung.add("Erstes Objekt"); sammlung.add("Zweites Objekt"); sammlung.add("Drittes Objekt"); sammlung.add("Viertes Objekt"); // Ausgeben mit Iterator Iterator it = sammlung.iterator(); while (it.hasNext()) { System.out.println(it.next()); } } } 2WSaS :rac\U hSWUb eWS SW\ =PXSYb RS` 7bS`Ob]`YZOaaS SW\USaSbhb eS`RS\ YO\\ c[ SW\S AO[[Zc\U d]\ =PXSYbS\ RWS W[ /`PSWbaa^SWQVS` abSVS\ aS_cS\bWSZZ hc dS`O`PSW bS\ AWS Wab c\OPVÉ\UWU d]\ RS` Y]\Y`SbS\ 7[^ZS[S\bWS`c\U RS` =PXSYbaO[[Zc\U SUOZ ]P RWSa SW\S :WabS ]RS` SW\ AbOQY ]RS` SW\S ?cScS Wab ROa 7bS`Ob]`>ObbS`\ ^Oaab W[[S` /ZZS`RW\Ua hSWUb RWSaSa 0SWa^WSZ OcQV ROaa SW\ AbO\RO`R@ShS^b \WQVb W[[S` !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
!$ ?PccTa] d]S 5aP\Tf^aZb
RWS SW\hWUS ]RS` PSabS :rac\U Wab( RS\\ W\ RWSaS[ 4OZZ eW`R SW\ S`TOV`S\S` 8OdO >`]U`O[[WS`S` eOV`aQVSW\ZWQV RWS S`eSWbS`bS 4]`AQVZSWTS d]`hWSVS\ ?a^VaP\\ 0aaPh;Xbc!) ;»bd]Vbe^abRW[PV ! TafTXcTacTa 5^aBRW[TXUT
import java.util.*; public class ArrayList02 { public static void main(String[] args) { ArrayList sammlung = new ArrayList(); sammlung.add("Erstes Objekt"); sammlung.add("Zweites Objekt"); sammlung.add("Drittes Objekt"); sammlung.add("Viertes Objekt"); // Ausgeben mit erweiterter For-Schleife for (Object s : sammlung) { System.out.println(s); } } } 2WSaS DO`WO\bS Rc`QV SW\S 1]ZZSQbW]\ hc WbS`WS`S\ Wab W[ 5SUS\aObh hc` 7bS`Ob]` >ObbS`\ SW\S a^ShWSZZS 8OdO;rUZWQVYSWb AWS PWSbSb aWQV O\ eS\\ P[[T 3ZS[S\bS dS`O` PSWbSb eS`RS\ a]ZZS\ c\R eS\\ RWS DS`O`PSWbc\U YSW\ C^RObS RS` 1]ZZSQbW]\7\VOZbS S`T]`RS`b 2S` 3W\aObh RSa 7bS`Ob]`a ROUSUS\ Wab SW\ c\WdS`aSZZSa 2SaWU\ >ObbS`\ c\OPVÉ\UWU d]\ SW\S` a^ShWSZZS\ >`]U`O[[WS`a^`OQVS 2WSaS :rac\U Wab W\ 8OdO W[[S` RO\\ SW\ hcaSbhS\ eS\\ RWS 1]ZZSQbW]\ \WQVb \c` USZSaS\ a]\RS`\ OcQV W\VOZbZWQV dS`É\RS`b eS`RS\ a]ZZ ÎQd]V id\ ?a^VaP\\ 0aaPh;Xbc! :raS\ AWS RWS /cTUOPS [Wb SW\S` SW\TOQVS\ U^aAQVZSWTS :rac\UaVW\eSWa( U^a X]c X,* X+#* X BhbcT\^dc_aX]c[]bP\\[d]VVTcX*
(KOYVOKRLX*KYOMT6GZZKXT 3<)SUJKR\OK]IUTZXUR
3W\ eSWbS`Sa PSYO\\bSa 2SaWU\>ObbS`\ Wab ;D1 []RSZdWSeQ]\b`]Z 2O[Wb eW`R PSaQV`WSPS\ eWS SW\S 8OdO/\eS\Rc\U W\ R`SW BSWZS OcTUSbSWZb eS`RS\ YO\\ RWS XS eSWZa ab`WYb USb`S\\b d]\SW\O\RS` OZa ;]RcZS `SOZWaWS`b eS`RS\ 2WS ;]RcZS VOPS\ T]ZUS\RS TSab RSTW\WS`bS /cTUOPS\( •
ROa \^ST[;]RcZ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PW[T]aTXWT eW`R OcQV /``OgdO`WOPZS US\O\\b 2S` 2ObS\bg^ X]c UWZb Tº` XSRSa SW\hSZ\S ;WbUZWSR RS` 5`c^^S !!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"
ATXWd]VT] QT]dciT] PaaPhb
9][^]\S\bS 3ZS[S\b 2WS SQYWUS 9ZO[[S` abSVb VW\bS` RS[ 2ObS\bg^ aWS YO\\ OcQV VW\bS` RS[ 7RS\bWTWS` abSVS\ R]QV RWSaS AQV`SWPeSWaS eW`R \WQVb S[^T]VZS\ 2Oa SWUS\bZWQVS /``Og]PXSYb YO\\ eWS PSW =PXSYbS\ ºPZWQV [Wb ]Tf S`hScUb eS` RS\(
zahlenreihe = new int[5]; ;Wb RWSaS` /\eSWac\U eS`RS\ Rg\O[WaQV hc` :OcThSWb W[ /`PSWbaa^SWQVS` # X]c 3ZS[S\bS O\USZSUb OZZS c\bS` RS[ ZObh\c[[S` 7\RSf h0 zahlenreihe[2] = 15; ;Wb RWSaS` ES`bShceSWac\U eW`R RWS R`WbbS 9][^]\S\bS Oca RS` HOVZS\`SWVS [Wb RS[ ES`b # USTºZZb 0WbbS PSOQVbS\ AWS( RS` 7\RSf [caa UO\hhOVZWU aSW\ c\R RWS OR`SaaWS`b RWS ! HOVZ eSWZ RWS ZÉbhS PSW PSUW\\b ?a^VaP\\ 0aaPh ) 4X] 0aaPh TabcT[[T] d]S \Xc FTacT] U¶[[T] public class Array01 { public static void main(String[] args) int[] umsatz; umsatz = new int[3]; umsatz[0] = 100; umsatz[1] = 200; umsatz[2] = 300; } }
{
2c`QV RWS 2SYZO`ObW]\ int[] umsatz; eW`R SW\S @STS`S\hdO`WOPZS O\USZSUb RWS RWS 4ÉVWUYSWb VOb OcT SW\S @SWVc\U d]\ 7\bSUS`ES`bS\ hc dS`eSWaS\ 2c`QV ROa O\ aQVZWSzS\RS AbObS[S\b umsatz = new umsatz[3]; eS`RS\ ! /`PSWbaa^SWQVS` ^ZÉbhS O\USZSUb XSRS` Wab " 0gbSa ZO\U 8SRS` VOb RWS 4ÉVWUYSWb 7\bSUS`eS`bS OcThc \SV[S\ /R`SaaWS`b eS`RS\ RWS SW\hSZ\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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a^VaP\\ 0aaPh&) 8cTaXTaT] SdaRW TX] 0aaPh
d]S IdVaXUU PdU YTSTb 4[T\T]c public class Array07 { public static void main(String[] args) float[] zahlen; zahlen = new float[4]; for (int i=0; i<4; i++) zahlen[i] = i + 125.0f; } }
{
3W\S eSWbS`S DS`O`PSWbc\UadO`WO\bS PSabSVb RO`W\ RWS 5`c^^S RS` 3ZS[S\bS OZa 5O\ hSa hc dS`O`PSWbS\ 2Ohc PWSbSb RWS 9ZOaaS YPePdcX[0aaPhb aWSVS /PaQV\Wbb !#( 1ZOaa 0aaPhb SW\S 4ºZZS d]\ ;SbV]RS\ h0 RWS ;SbV]RS UX[[ ?a^VaP\\ 0aaPh') 3Pb 0aaPh P[b 6P]iTb eTaPaQTXcT]
public class Array08 { public static void main(String[] args) { float[] zahlen; zahlen = new float[4]; java.util.Arrays.fill(zahlen, 12.45f); for (float zahl : zahlen) System.out.println(zahl); } } ÎQd]V id\ ?a^VaP\\ 0aaPh' 9ZÉ`S\ AWS O\VO\R RS` />72]Yc[S\bObW]\ [Wb eSZQVS` ;SbV]RS RS` 9ZOaaS 0aaPhb SW\ U[^Pc/``Og W\ SW\S Ab`W\U`S^`ÉaS\bObW]\ c[USeO\RSZb eS`RS\ YO\\ 3`UÉ\hS\ AWS ROa >`]U`O[[ c[ SW\S\ S\ba^`SQVS\RS\ /caUOPSPSTSVZ ;»bd]VbWX]fTXb)
System.out.println(java.util.Arrays.toString(zahlen));
6XL[TMJKY/TJK^J[XIN8[T:OSK;SMKH[TM
8SRS` /``OgHcU`WTT eW`R d]\ RS` :OcThSWbc[USPc\U ºPS`^`ºTb 2S` DS`acQV SW\S\ 7\RSf hc dS`eS\RS\ RS` YZSW\S` OZa
!&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"" IdVaXUU PdU SXT 0aaPh:^\_^]T]cT]
?a^VaP\\ 0aaPh() 5P[bRWT 0SaTbbXTad]V TX]Ta 0aaPh:^\_^]T]cT public class Array09 { public static void main(String[] args) { char[] buchstaben = {'a','b','c','d','e'}; for(int i=0; i<6; i++) { System.out.println(buchstaben[i]); } } } ÎQd]V id\ ?a^VaP\\ 0aaPh( 0SW RS` /caTºV`c\U UWPb Sa RWS 4SVZS`[SZRc\U /``Og7\RSf=cb=T0]c\Ra3fQS^bW]\( # AW\\US[Éz PSRScbSb ROa ROaa RS` 7\RSf # SW\S\ A^SWQVS` OczS`VOZP RWSaS` /` `OgU`S\hS\ OR`SaaWS`b 9]``WUWS`S\ AWS ROa >`]U`O[[ a] ROaa Sa TSVZS`T`SW OcaUSTºV`b eS`RS\ YO\\
3KSHKX
Hc XSRS[ /``Og UWPb Sa SW\S hcaÉbhZWQVS SW\USPOcbS DO`WOPZS RWS OZa ES`b RWS /\hOVZ RS` /``Og3ZS[S\bS S\bVÉZb RWS DO`WOPZS [T]VcW AWS YO\\ h0 W[ 9]^T SW\S` U^a AQVZSWTS PS\cbhb eS`RS\ c[ RWS 2c`QVZOcTPSRW\Uc\U hc T]`[cZWS`S\ ?a^VaP\\ 0aaPh ) 0aQTXcT] \Xc STa EPaXPQ[T] [T]VcW
public class Array10 { public static void main(String[] args) { char[] buchstaben = {'a','b','c'}; for(int i=0; i`]U`O[[WS`S` \WQVb OPhÉVZS\ [caa eWSdWSZ 3ZS[S\bS ROa /``Og S\bVÉZb Hc[ O\RS`S\ Wab aWS OcaaOUSTÉVW US`( [O\ S`YS\\b a]T]`b ROaa OZZS 3ZS[S\bS dS`O`PSWbSb eS`RS\ ÎQd]VT] id\ ?a^VaP\\ 0aaPh ÎQd]V ) 3`UÉ\hS\ AWS ROa >`]U`O[[ a] ROaa RS` ES`b RS` DO`WOPZS\ [T]VcW OcT RS` 9]\a]ZS OcaUSUSPS\ eW`R ÎQd]V !( 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa [Wb SW\S` 4]`3OQVAQVZSWTS ROa /``Og Rc`QVacQVb eW`R \OQV RS[ 0cQVabOPS\ P ES\\ RWSaS` ES`b USTc\RS\ eW`R a]ZZ S` OcaUSUSPS\ c\R RWS AcQVS OPUSP`]QVS\ eS`RS\ !'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"
ATXWd]VT] QT]dciT] PaaPhb
;»bd]Vbe^abRW[PV
public class Array11 { public static void main(String[] args) { char[] buchstaben = {'a','b','c'}; for (char buchstabe: buchstaben) { if (buchstabe == 'b') { System.out.println(buchstabe); break; } } } } 2WS DO`WOPZS [T]VcW S\bVÉZb \WQVb RWS /\hOVZ RS` VTU¶[[cT] 9][^]\S\bS\ a]\RS`\ RWS 5SaO[bO\hOVZ OZZS` 3ZS[S\bS c\OPVÉ\UWU ROd]\ ]P aWS [Wb W\RWdWRcSZZS\ ES` bS\ USTºZZb e]`RS\ aW\R ]RS` ]P aWS RWS 2STOcZb7\WbeS`bS S\bVOZbS\ ES\\ OZa] \c` RWS USTºZZbS\ 3ZS[S\bS dS`O`PSWbSb eS`RS\ a]ZZS\ a] [caa RWS S\b a^`SQVS\RS /PT`OUS d][ >`]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; i<10; i++) { zahlen[i] = i+1; } int summe = 0; for (int wert: zahlen) { summe = summe + wert; } System.out.println("Die Summe ist: " + summe); } }
!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"# >QYTZcT X] 0aaPhb bP\\T[]
5HPKQZKOT'XXG_YYGSSKRT
/``Oga Yr\\S\ \WQVb \c` ES`bS d]\ ^`W[WbWdS\ 2ObS\bg^S\ S\bVOZbS\ a]\RS`\ aWS Yr\\S\ OcQV =PXSYbS OcT\SV[S\ 2O\\ eS`RS\ OPS` \WQVb RWS =PXSYbS aSZPab W[ /` `Og USa^SWQVS`b a]\RS`\ ZSRWUZWQV RWS @STS`S\hdO`WOPZS\ 2WS =PXSYbS [ºaaS\ d][ UZSWQVS\ Bg^ aSW\ DS`eO\RbS aW\R S`ZOcPb RV Sa Yr\\S\ OcQV AcPBg^S\ RS` RS TW\WS`bS\ 9ZOaaS USa^SWQVS`b eS`RS\ ?a^VaP\\ 0aaPh #)
BP\\T[] e^] 8]bcP]iT] X] TX]T\ 0aaPh import java.util.*; public class Array14 { public static void main(String[] args) Calendar[] tage = new Calendar[3]; for (int i=0; i<3; i++) tage[i] = Calendar.getInstance(); System.out.println(tage[1]); } }
{
2Oa >`]U`O[[ 0aaPh # S`hScUb SW\S @STS`S\hdO`WOPZS cPVT 2WSaS VOb RWS 4ÉVWUYSWb OcT SW\ /``Og hc hSWUS\ ROa =PXSYbS d][ Bg^ 2P[T]SPa aO[[SZb ;Wb ]Tf eW`R RWS aSa /``Og S`hScUb 3a S\bVÉZb R`SW 9][^]\S\bS\ XSRS `STS`S\hWS`b OcT SW\ 1OZS\RO` =PXSYb bOUS
@STS`S\h
@STS`S\h
@STS`S\h!
/PP! ( /``Og [Wb @STS`S\hS\ OcT ! =PXSYbS 0SW[ AO[[SZ\ c\R DS`eOZbS\ d]\ =PXSYbS\ W[ 6Oc^ba^SWQVS` Wab Sa bg^WaQV ROaa RWS /\hOVZ RS` =PXSYbS RWS USa^SWQVS`b eS`RS\ a]ZZS\ VÉcTWU abO`Y dO`WWS`b 4º` RWS aS 4ÉZZS Wab SW\ /``Og \WQVb Ucb USSWU\Sb eSWZ RSaaS\ 5`rzS abObWaQV Wab 0SaaS`S :r ac\US\ PWSbSb ROa 2^[[TRcX^]4`O[Se]`Y d]\ 8OdO 2]`b UWPb Sa SW\S UO\hS /\hOVZ c\bS`aQVWSRZWQVS` 9ZOaaS\ RWS OZa =PXSYbAO[[Zc\US\ PS\cbhb eS`RS\ Yr\\S\ h0 RWS ETRc^a9ZOaaS 2S` >`]U`O[[WS`S` YO\\ RO[Wb \OQV RS` 3`hScUc\U RSa DSQb]`a PSZWSPWU dWSZS =PXSYbS SW\Sa Bg^a aO[[SZ\ c\R dS`O`PSWbS\ 8OdO a]`Ub Tº` RWS Rg \O[WaQVS /\^Oaac\U RS` :É\US ÎQd]V id\ ?a^VaP\\ 0aaPh # >`ºTS\ AWS ]P O\abSZZS RSa @STS`S\hbg^a 2P[T]SPa W\ HSWZS " OcQV >QYTRc 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 ))
"%
3KNXJOSKTYOUTGRK'XXG_Y
3W\ /``Og YO\\ =PXSYbS d]\ XSRS[ O\RS`S\ 2ObS\bg^ S\bVOZbS\ OZa] OcQV d][ Bg^ /``Og 2Oa VSWzb W\ 8OdO eS`RS\ [SV`RW[S\aW]\OZS /``Oga OZa /``Oga RSTW\WS`b RS`S\ 3ZS[S\bS eWSRS`c[ /``Oga aW\R dS`aQVOQVbSZbS /``Oga O``Og ]T O``Og 2WS 2STW\W bW]\ int matrix[4][3]; dS`SW\PO`b SW\S ;Ob`Wf d][ Bg^ X]c 3a eS`RS\ " X]c3ZS[S\bS O\USZSUb RWS XSeSWZa eWSRS` Oca ! X]c3ZS[S\bS\ PSabSVS\ 2S` HcU`WTT OcT RWS SW\hSZ\S\ 3ZS[S\bS S`T]ZUb c\bS` /\UOPS RS` PSWRS\ 7\RWhSa RWS XSeSWZa W\ SQYWUS\ 9ZO[[S`\ SW\USaQVZ]aaS\ aW\R( matrix[2][1] = 8; 2O[Wb eW`R ROa ! 3ZS[S\b OR`SaaWS`b c\R W\\S`VOZP RWSaSa ! 3ZS[S\ba ROa 3ZS [S\b 0SW RS` 2SYZO`ObW]\ eW`R ^`] AQVOQVbSZc\UabWSTS SW\ SQYWUSa 9ZO[[S`\^OO` PS\rbWUb C\R PSW[ HcU`WTT eS`RS\ a]dWSZ 9ZO[[S`\^OO`S O\USUSPS\ eWS RWS 2W[S\aW]\ RSa /``Oga O\UWPb 4º` RWS DS`O`PSWbc\U PWSbS\ aWQV USaQVOQVbSZbS U^aAQVZSWTS\ O\
/TOZOGROYOKX[TM\UTSKNXJOSKTYOUTGRKT,KRJKXT
;SV`RW[S\aW]\OZS 4SZRS` Yr\\S\ PSW RS` 2SYZO`ObW]\ SPS\TOZZa [Wb /\TO\UaeS`bS\ dS`aSVS\ eS`RS\ 2WS T]ZUS\RS 2STW\WbW]\ W\WbWOZWaWS`b SW\S X]c;Ob`Wf UZSWQVhSWbWU [Wb RS` 2SYZO`ObW]\( int matrix[][] = { {1, 2, 3}, {4, 5, 6} }; 5SRO\YZWQV YO\\ RWSaS 2STW\WbW]\ a] ºPS`aSbhb eS`RS\( 3`abSZZS SW\ /``Og Oca heSW HSWZS\ [Wb XSeSWZa R`SW A^OZbS\ 2Oa UZSWQVS 3`USP\Wa eW`R Rc`QV T]ZUS\RSa >`] U`O[[ S``SWQVb( ?a^VaP\\ 0aaPh!)
IfTXSX\T]bX^]P[Tb 0aaPh \Xc _aX\XcXeT] Ch_T] public class Array20 { public static void main(String[] args) int[][] matrix; matrix = new int [2][3]; matrix[0][0] = 1; matrix[0][1] = 2; matrix[0][2] = 3; matrix[1][0] = 4; matrix[1][1] = 5; matrix[1][2] = 6; } }
{
! !
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"
ATXWd]VT] QT]dciT] PaaPhb
@[MXOLLG[LJOK'XXG_+RKSKTZK
2Oa T]ZUS\RS >`]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<4; i++) { for (int j=0; j<3; j++) System.out.println(woertermatrix[i][j]); } } } ÎQd]V 0WbbS S`abSZZS\ AWS SW\ >`]U`O[[ 0aaPh!! [Wb SW\S[ RW[S\aW]\OZS\ /``Og ROa Oca R`SW 3ZS[S\bS\ PSabSVb 8SRSa RS` R`SW 3ZS[S\bS a]ZZ eWSRS` Oca SW\S[ /``Og PSabS VS\ \É[ZWQV XSeSWZa Oca SW\S` @SWVc\U d]\ dWS` RWPaES`bS\ 7[ >`]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; i<3; i++) { for (int j=0; j<4; j++)
{
! "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"& 0aaPhb P[b ?PaP\TcTa d]S ATcda]fTac QTX
zeichen[i][j] = unicode++; } // Ausgeben der Zeichen for(int i=0; i<3; i++) { for (int j=0; j<4; j++) { System.out.print(zeichen[i][j]); } System.out.println(); } } }
'XXG_YGRY6GXGSKZKX[TJ8KZ[XT]KXZHKO3KZNUJKT
/``Oga aW\R YSW\S SW\TOQVS\ 2ObS\bg^S\ a]\RS`\ @STS`S\hbg^S\ 2O[Wb UWZb Tº` aWS RWS =PXSYbaS[O\bWY c\R ROa PSRScbSb h0 PSW RS` ÍPS`UOPS d]\ /``Oga OZa >O`O[S bS` ROaa RS` 3[^TÉ\US` [Wb RS[ =`WUW\OZO``Og O`PSWbSb c\R \WQVb [Wb SW\S` 9]^WS RS\\ S` PSY][[b RWS @STS`S\h ºPS`USPS\ ?a^VaP\\ 0aaPh!") 0aaPh P[b 0aVd\T]c QTX\ `]U`O[[ 0aaPh!# eW`R SW\ /``Og OZa ;rUZWQVYSWb PS\cbhb c[ [SV` OZa SW\ 3`USP\Wa O\ RS\ /cT`cTS` SW\S` ;SbV]RS hc`ºQY hc USPS\ 2Oa >`] U`O[[ S\bVÉZb SW\S ;SbV]RS RWS SW\S 5O\hhOVZ Rc`QV ! RWdWRWS`b c\R RWSaSa 3`USP \Wa hc`ºQYUWPb 5ZSWQVhSWbWU a]ZZ SW\ heSWbSa 3`USP\Wa \É[ZWQV RS` UO\hhOVZWUS @Sab USZWSTS`b eS`RS\ 2SaVOZP eW`R W\\S`VOZP RS` ;SbV]RS SW\S Z]YOZS /``OgDO`WOPZS RSYZO`WS`b [Wb RS\ PSWRS\ 3`USP\WaaS\ USTºZZb c\R RO\\ [Wb aTcda] RWS @STS`S\h O\ RS\ /cT`cTS` ºPS`b`OUS\ ! #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"
ATXWd]VT] QT]dciT] PaaPhb
?a^VaP\\ 0aaPh!#) 0aaPh P[b ATcda]fTac TX]Ta
public class Array24 { public static void main(String[] args) { int zahl = 125; int[] erg = dividieren(zahl); System.out.println("125 / 3 = " + erg[0]); System.out.println("Ganzzahliger Rest: " + erg[1]); } static int[] dividieren(int z) { int[] erg = {0,1}; erg[0] = z / 3; erg[1] = z % 3; return erg; } }
@[YGSSKTLGYY[TM 'XXG_YRKXTKTOT9KQ[TJKT
•
/``Oga aW\R =PXSYbS AWS eS`RS\ [Wb RS[ AQVZºaaSZe]`b ]Tf S`hScUb
•
/PS`( /``Oga aW\R YZOaaS\Z]aS =PXSYbS Sa UWPb Tº` aWS YSW\S Sf^ZWhWbS 9ZOaaS c\R d]\ ROVS` UWPb Sa OcQV SW\S AcPYZOaaS\ d]\ /``Oga C\R RS\\]QV( /``Oga VOPS\ ;S[PS`dO`WOPZS\ [T]VcW c\R aWS PSaWbhS\ OZZS ;SbV]RS\ Oca RS` 9ZOaaS >QYTRc
•
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[
•
0aaPhb WPQT] TX]T UTbcT ;Ê]VT 2WS 9O^OhWbÉb 5`rzS eW`R PSW RS` 3`hScUc\U RSa =PXSQba [Wb ]Tf O\USUSPS\ ]RS` aWS eW`R d][ 1][^WZS` S`[WbbSZb O\VO\R SW\S` :WabS d]\ 7\WbWOZeS`bS\ 2O\OQV YO\\ RWS 5`rzS \WQVb [SV` USÉ\RS`b eS` RS\
•
7\RWdWRcSZZS 7\WbWOZeS`bS Yr\\S\ PSW RS` 2STW\WbW]\ O\USUSPS\ eS`RS\ AWS abS VS\ W\ USaQVeSWTbS\ 9ZO[[S`\ ROa AQVZºaaSZe]`b ]Tf YO\\ W\ RWSaS[ 4OZZ S\b TOZZS\
•
/``Oga Yr\\S\ ^`W[WbWdS 2ObS\eS`bS ]RS` OcQV @ST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S\ DS`O`PSWbc\Ua[rU ZWQVYSWbS\ RS[]\ab`WS`b c\R OcQV UShSWUb e]`OcT PSa]\RS`a hc OQVbS\ Wab ?a^VaP\\ 0aaPh") 4b fXaS ]da STa ETafTXb Z^_XTac public class Array30 { public static void main(String[] args) { int[] z1 = {11, 23, 4, 15}; int[] z2; z2 = z1; // Referenz-Semantik ! for (int z : z2) System.out.println(z); } } ÎQd]V id\ ?a^VaP\\ 0aaPh" 0WbbS YZÉ`S\ AWS Rc`QV >`]U`O[[É\RS`c\U ]P T]ZUS\RS hcaÉbhZWQVS /\eSWac\U PS eW`Yb ROaa aWQV OcQV ROa /``Og i! É\RS`b( z1[2] = 100; ?a^VaP\\ 0aaPh" ) ?Ta BRW[TXUT TX]iT[]T FTacT Z^_XTaT] public class Array31 { public static void main(String[] args) int[] z1 = {11, 23, 4, 15}; int[] z2 = new int[z1.length]; for (int i=0; i
{
! %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
"
ATXWd]VT] QT]dciT] PaaPhb
for (int z : z2) System.out.println(z);
} } ÎQd]V id\ ?a^VaP\\ 0aaPh" 0WbbS YZÉ`S\ AWS Rc`QV >`]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\
public class Array32 { public static void main(String[] args) { int[] z1 = {11, 23, 4, 15}; int[] z2 = new int[z1.length]; System.arraycopy(z1, 0, z2, 0, z1.length); for (int z : z2) System.out.println(z); } } 2WS 9ZOaaS >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]
public class Array33 { public static void main(String[] args) int[] z1 = {11, 23, 4, 15}; int[] z2 = z1.clone(); for (int z : z2) System.out.println(z); } }
{
ÎQd]V id\ ?a^VaP\\ 0aaPh"" 0WbbS YZÉ`S\ AWS OcQV VWS` Rc`QV >`]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]V AWS PWSbSb RWS ;rUZWQVYSWb SW\S\ PSZWSPWU ZO\US\ Ab`W\U hc a^SW QVS`\ 4º` XSRSa HSWQVS\ RS` HSWQVS\YSbbS eS`RS\ W[ /`PSWbaa^SWQVS` $ PWb P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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
public class String02 { public static void main(String[] args) String vorname = null; System.out.println(vorname); } }
{
ÎQd]VT] id\ ?a^VaP\\ BcaX]V! Ò\RS`\ AWS RWS ES`bhceSWac\U W\ RS` ! HSWZS eWS T]ZUb( String vorname = "0"; =RS` eS\\ AWS e]ZZS\ OcQV a]( String vorname = "Null"; !!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# 4abcT[[T] e^] BcaX]V>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\
public class String05 { public static void main(String[] args) { String vorname = "Roman"; String nachname = "Merker"; String name1, name2; name1 = vorname + " " + nachname; // 1.Möglichkeit name2 = vorname.concat(" " + nachname); // 2.Möglichkeit System.out.println(name1); System.out.println(name2); } }
!!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#!
1UT\KXZOKX[TM`]OYINKTVXOSOZO\KT:_VKT[TJ9ZXOTMY
2S` DS`YSbbc\Ua]^S`Ob]` YO\\ OcQV Tº` ES`bS PS\cbhb eS`RS\ RWS YSW\S Ab`W\Ua aW\R 2O\\ Y]\dS`bWS`b 8OdO RS\ ES`b W\ SW\S\ Ab`W\U c\R Y]\YObS\WS`b RO\OQV ?a^VaP\\ BcaX]V%) 0dc^\PcXbRWT D\fP]S[d]V X\_[XiXc public class String06 { public static void main(String[] args) { System.out.println("Bahnhofstr. " + 48); } } @SUSZ( ES\\ W\ SW\S[ /caR`cQY RS` =^S`Ob]` PS\cbhb eW`R a] YO\\ RWSa c\bS` aQVWSRZWQVS /YbW]\S\ hc` 4]ZUS VOPS\ ES\\ OZZS =^S`O\RS\ \c[S`WaQVS Bg^S\ aW\R eW`R US`SQV\Sb eS\\ OcQV \c` SW\ =^S`O\R W[ /caR`cQY SW\ Ab`W\U Wab a] eW`R Y]\YObS\WS`b 4º` RWS Sf^ZWhWbS C[eO\RZc\U d]\ SW\TOQVS\ 2ObS\bg^S\ W\ Ab`W\Ua Phe c[USYSV`b RWS 9]\dS`bWS`c\U SW\Sa Ab`W\Ua W\ SW\S\ ^`W[WbWdS\ 2ObS\bg^ S\bVÉZb RWS AbO\RO`R 0WPZW]bVSY dWSZTÉZbWUS ;rUZWQVYSWbS\ 2WSaSa BVS[O eW`R OcaTºV`ZWQV W[ 9O^WbSZ # PSVO\RSZb ?a^VaP\\ BcaX]V&) 4g_[XiXcTb :^]eTacXTaT] e^] IPW[T] X] BcaX]Vb public class String07 { public static void main(String[] args) { float f1 = 3.57f; int z1 = 123; String s1, s2; // s = z1; // liefert Umwandlungsfehler s1 = String.valueOf(f1); s2 = String.valueOf(z1); System.out.println(s1 + s2); // System.out.println(f1 + z1); } } 2WS US\S`SZZS\ @SUSZ\ PSW Bg^c[eO\RZc\US\ [Wb Ab`W\U aW\R( •
Ab`W\U W\ ^`W[WbWdS\ Bg^ c[eO\RSZ\( 2S` HWSZbg^ VOb ROTº` SW\S ;SbV]RS
•
>`W[WbWdS\ Bg^ W\ Ab`W\U c[eO\RSZ\( 2WS 9ZOaaS BcaX]V VOb ROTº` ;SbV]RS\
ÎQd]VT] id\ ?a^VaP\\ BcaX]V& ÎQd]V ( 9ZÉ`S\ AWS RWS 4`OUS eO`c[ RWS $ HSWZS a+h hc SW\S[ C[eO\RZc\Ua TSVZS` TºV`b c\R RSaeSUS\ OcaY][[S\bWS`b eS`RS\ [caabS <]bWS`S\ AWS OcT SW\S[ 0ZObb >O^WS` RWS W\bS`\S 2O`abSZZc\U RS` HSWQVS\ ! eS\\ aWS OZa 2ObS\bg^ X]c Q] !!!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
RWS`b eS`RS\ c\R RWS W\bS`\S 2O`abSZZc\U RS` HSWQVS\ ! eS\\ aWS OZa BcaX]V PS VO\RSZb eS`RS\ :rac\UaVW\eSWaS aWSVS 9O^WbSZ ! ÎQd]V !( ;]RWTWhWS`S\ AWS ROa >`]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\
2Oa DS`UZSWQVS\ d]\ Ab`W\Ua OcT W\VOZbZWQVS 5ZSWQVVSWb Wab SW\ VSWYZSa BVS[O 5`c\R aÉbhZWQV Wab RS` DS`UZSWQVa]^S`Ob]` ++ ]XRWc USSWU\Sb c[ Ab`W\Ua hc dS`UZSWQVS\ ?a^VaP\\ BcaX]V() BcaX]Vb fTaST] \Xc STa
ÎQd]V id\ ?a^VaP\\ BcaX]V( 0WbbS Sf^S`W[S\bWS`S\ AWS [Wb RS[ >`]U`O[[ c[ RS\ C\bS`aQVWSR heWaQVS\ ++ c\R RS` ;SbV]RS T`dP[b VS`OcahcTW\RS\ !!"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#!
VÉ\][S\ S`YZÉ`b eS`RS\- 2S\\ \Obº`ZWQV UWPb Sa OcQV VWS`Tº` Z]UW aQVS 3`YZÉ`c\US\ 4aZ[Êad]V
2S` 1][^WZS` ]^bW[WS`b RWS A^SWQVS`c\U d]\ Ab`W\U]PXSYbS\ ES\\ Ab`W\Ua UZSWQVS 7\VOZbS VOPS\ abSVS\ aWS c\bS` C[abÉ\RS\ \c` SW\[OZ W[ A^SWQVS` VWS` VOPS\ OZ ZS`RW\Ua RWS c\bS`aQVWSRZWQVS\ 8D;a OcQV W\RWdWRcSZZS :rac\US\ 2WSaSa 0SWa^WSZ VOb V]TTS\bZWQV SW\R`cQYad]ZZ RS[]\ab`WS`b ROaa PSW[ DS`UZSWQV [Wb RS[ DS`UZSWQVa]^S`Ob]` ++ D]`aWQVb O\USP`OQVb Wab 3` ^`ºTb \É[ZWQV RWS ATUTaT]i ePaXPQ[T] OcT W\VOZbZWQVS 5ZSWQVVSWb
+OT`KRTK@KOINKTUJKX:KORYZXOTMY\KXGXHKOZKT
3W\ Ab`W\U YO\\ Tº` RWS DS`O`PSWbc\U eWS SW\ /``Og Oca SW\hSZ\S\ 1VO`OQbS` PSVO\ RSZb eS`RS\ 2Oa YO\\ W\ dWSZS\ 4ÉZZS\ aW\\d]ZZ aSW\ h0 eS\\ XSRSa SW\hSZ\S HSW QVS\ W\ RS` HSWQVS\YSbbS OPUST`OUb c\R SdS\bcSZZ dS`O`PSWbSb eS`RS\ a]ZZ ?a^VaP\\ BcaX]V ) 3T] 1dRWbcPQT] a bdRWT] public class String10 { public static void main(String[] args) { String s1 = "Erwin Merker"; for (int i=0; i<s1.length(); i++) if (s1.charAt(i) == 'r') System.out.println("Buchstabe r " + "steht auf Stelle " + i); } } ÎQd]V) 0WbbS aQV`SWPS\ AWS SW\ \ScSa >`]U`O[[ ROa W[ Ab`W\U D]USZ\Sab ROa E]`b \Sab Sfb`OVWS`b W\ SW\S` \ScS\ Ab`W\UDO`WOPZS\ a^SWQVS`b c\R O[ 0WZRaQVW`[ OcaUWPb ;»bd]VbWX]fTXb) 3a UWPb RWS ;SbV]RS bdQbcaX]V) PWbbS YZÉ`S\ AWS RWS 3W\aObh[rU ZWQVYSWb RWSaS` ;SbV]RS O\VO\R RS` />72]Yc[S\bObW]\ !!#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
;»bd]Vbe^abRW[PV
public class String11 { public static void main(String[] args) String s1 = "Vogelnest"; String s2 = s1.substring(5,9); System.out.println(s2); } }
{
2S` ;SbV]RS bdQbcaX]V Yr\\S\ heSW >O`O[SbS` ºPS`USPS\ eS`RS\ RWS 7\RWQSa e^] QXb 8SR]QV Wab RWS AS[O\bWY ROPSW SbeOa SWUS\eWZZWU RS\\ RS` 7\RSf QXb PSRScbSb \WQVb SW\aQVZWSzZWQV a]\RS`\ RWSaS >]aWbW]\ PShSWQV\Sb ROa S`abS HSWQVS\ ROa ]XRWc Y]^WS`b eS`RS\ a]ZZ D]`bSWZ RWSaS` HÉVZeSWaS( 2WS :É\US RSa AcPab`W\Ua YO\\ Rc`QV QXb e^] SW\TOQV S``SQV\Sb eS`RS\
*OK3KZNUJKTJKX9ZXOTMQRGYYKYOTJG[ING[L9ZXOTMROZKXGRKGT]KTJHGX
?a^VaP\\ BcaX]V !( ;Ê]VT UTbcbcT[[T] d]S ITXRWT] d\fP]ST[]
public class String12 { public static void main(String[] args) { String name = "Merker"; System.out.println("Steinfurt".length()); System.out.println(name.toUpperCase()); } } ÒV\ZWQV eWS PSW /``Oga YO\\ [O\ OcQV Tº` Ab`W\Ua RWS :É\US TSababSZZS\ 0SW /``Oga YO\\ [O\ RS\ ES`b RS` DO`WOPZS\ [T]VcW OPT`OUS\ 0SW Ab`W\Ua aS\RSb [O\ RWS
=GYVGYYOKXZ]KTTKOT9ZXOTMUHPKQZMKoTJKXZ]OXJ%
8Sbhb e]ZZS\ eW` SW\S\ PSabSVS\RS\ Ab`W\U W\VOZbZWQV dS`É\RS`\ c[ WV\ O\ RS\ QVW \SaWQVS\ ;O`Yb O\hc^OaaaS\ ( ?a^VaP\\ BcaX]V ") 4abTciT] STa 1dRWbcPQT] a SdaRW [ public class String13 { public static void main(String[] args) String s1 = "Merker"; s1 = s1.replace('r', 'l'); System.out.println(s1); } }
{
!!$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#!
EOa PSW RWSaS` Ò\RS`c\U W[ A^SWQVS` US\Oc ^OaaWS`b eS`RS\ eW` \OQVT]ZUS\R \ÉVS` O\OZgaWS`S\
5HPKQZKJKX9ZXOTM1RGYYKYOTJ[T\KXoTJKXROINOSS[ZGHRK
Hc[ 3W\abWSU W\ RWSaSa BVS[O hc\ÉQVab T]ZUS\RS 0SVOc^bc\U( 3W\ =PXSYb RS` 9ZOaaS BcaX]V Wab c\dS`É\RS`ZWQV W[[cbOPZS RV [O\ YO\\ \c` ZSaS\R RO`OcT hcU`SWTS\ ES\\ SW\ Ab`W\U=PXSYb SW\[OZ [Wb SW\S[ ES`b USTºZZb Wab RO\\ YO\\ RWSaS` ES`b \WS[OZa USÉ\RS`b eS`RS\ EOa PSRScbSb ROa c\R eOa ^OaaWS`b h0 PSW /caTºV`c\U RS` ;SbV]RS aT_[PRT W[ >`]U`O[[ BcaX]V "- /\e]`b( 3a eW`R SW\ Y][^ZSbb \ScS` Ab`W\U S`abSZZb c\R RO\\ RWS @STS`S\h W\ b S`aSbhb Rc`QV RWS A^SWQVS`OR`SaaS RSa \ScS\ =PXSYba 2Oa Wab RS` 5`c\R eO`c[ OZZS ;SbV]RS\ RWS SW\ Ab`W\U=PXSYb [] RWTWhWS`S\ OZa @ºQYUOPSbg^ SW\ Ab`W\U]PXSYb VOPS\ /PS` eOa ^OaaWS`b PSW SW\S` SW\TO QVS\ ES`bShceSWac\U- ?a^VaP\\ BcaX]V #) 0dRW
SXT ATaTaT]iePaXPQ[T Ê]STac bXRW public class String14 { public static void main(String[] args) String s1 = new String("Heidi"); String s2 = s1; System.out.println(s1 == s2); s2 = "Heidi"; System.out.print(s1 == s2); } }
{
2Oa >`]U`O[[ ZWSTS`b hcS`ab cadT RO\\ OPS` UP[bT hc[W\RSab PSW RS` Ac\8@3 c\bS` EW\R]ea 2O[Wb Wab YZO` ROaa RWS PSWRS\ Ab`W\U]PXSYbS \OQV RS` ES`bShceSWac\U heO` X]WP[c[XRW V[TXRW PQTa ]XRWc XST]cXbRW aW\R 3a ec`RS SW\ \ScSa =PXSYb S` hScUb EOa Wab RS` 5`c\R Tº` RWS OcT RS\ S`abS\ 0ZWQY c[abÉ\RZWQVS /`PSWbaeSWaS- /\be]`b( Ab`W\Ua eS`RS\ W\ SW\S[ >]]Z USVOZbS\ A] YO\\ [O\ S``SWQVS\ ROaa Ab`W\Ua RWS RS\aSZPS\ 7\VOZb VOPS\ \c` SW\[OZ W[ A^SWQVS` abSVS\ ES\\ OZa] T]ZUS\RS ES`bS hceSWac\US\ S`T]ZUS\(
a + 6SWRW) A + 6SWRW)
RO\\ Yr\\S\ RWS @STS`S\hS\ W\ b c\R b! UZSWQV aSW\ DS`ZOaaS\ YO\\ [O\ aWQV RO` OcT OPS` \WQVb RS\\ RWSa YO\\ d]\ XSRS` @c\BW[SC[USPc\U O\RS`a `SOZWaWS`b eS` RS\ ÎQd]V id\ ?a^VaP\\ BcaX]V # 9ZÉ`S\ AWS eWS OcT 7V`S[ AgabS[ RS` DS`UZSWQV s1 == s2 OcaTÉZZb eS\\ AWS d]` VS` OcQV RS` DO`WOPZS\ b! RS\ ES`b 6SWRW Sf^ZWhWb hceSWaS\ !!%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
3KZNUJKTJKX)RGYY9ZXOTM([ORJKX =GX[SMOHZKYJXKO9ZXOTM1RGYYKT%
2Oa ]PS\ PSaQV`WSPS\S DS`TOV`S\ Wab `SZObWd OcTeÉ\RWU 2WS 3\beWQYZS` aW\R ]TTS\ aWQVbZWQV ROd]\ OcaUSUO\US\ ROaa RWS D]`bSWZS RS` US[SW\aO[S\ `]U`O[[a dS`Yº`hb ]RS` dS`ZÉ\US`b eS`RS\ 2ORc`QV c\bS`aQVSWRS\ aWQV RWSaS PSWRS\ 9ZOaaS\ d]\ BcaX]V 4º` 3W\abSWUS` W\ RWS >`]U`O[[WS`c\U [Wb 8OdO UWZb UO\h SW\TOQV T]ZUS\RS @SUSZ( ES\\ Ab`W\UdO`WOPZS VÉcTWU USÉ\RS`b eS`RS\ [ºaaS\ a]ZZbS OZa 2ObS\bg^ BcaX]V1dX[ STa c\R \WQVb BcaX]V USeÉVZb eS`RS\ 2WSaS S\bVÉZb US\Oc eWS BcaX]V1dU hOVZ`SWQVS ;SbV]RS\ hc[ DS`É\RS`\ d]\ Ab`W\UW\VOZbS\ h0 P__T]S X]bTac ST[TcT ]RS` aT_[PRT
?a^VaP\\ BcaX]V $) 0aQTXcT] \Xc 2[Pbb BcaX]V1dX[STa public class String15 { public static void main(String[] args) { StringBuilder sb1 = new StringBuilder("Vogel"); sb1.append("nest"); // Anhaengen System.out.println(sb1); sb1.replace(0,5,"Oster"); // Ersetzen System.out.println(sb1); sb1.delete(6,9); // Loeschen System.out.println(sb1); sb1.insert(6, " ist Urlaub"); // Einfuegen System.out.println(sb1); } } ?a^VaP\\ BcaX]V %) FT]] SXTbTb 1TXb_XT[ \Xc STa :[PbbT BcaX]V d]S STa QYTZcT P]VT[TVc public class String16 { public static void main(String[] args) { StringBuilder str = new StringBuilder(). append("Dieser ").append("Satz ").append("wird "). append("als ein ").append("Objekt angelegt"); System.out.println(str); } } !!&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
## BcaX]Vb P[b 2^\\P]S[X]T?PaP\TcTa
9ZXOTMYGRY)USSGTJROTK6GXGSKZKX
Ab`W\Ua aW\R PSW[ 3PcT]PdbcPdbRW heWaQVS\ /\eS\Rc\US\ [Wb c\bS`aQVWSRZWQVS\ >`]U`O[[WS`a^`OQVS\ ]RS` OcT dS`aQVWSRS\S\ 0Sb`WSPaagabS[S\ RS` eWQVbWUabS 2O bS\bg^ 0SW /\eS\Rc\US\ W[ 7\bS`\Sb S`T]ZUb RWS >O`O[SbS`ºPS`UOPS heWaQVS\ 1ZWS\b c\R AS`dS`^`]U`O[[S\ US\S`SZZ OZa Ab`W\U SdS\bcSZZ S`UÉ\hb c[ RS\ >O`O[S bS`\O[S\ 9SgDOZcS>OO`S ]RS` SW\US^OQYb W\ 2ObS\PSaQV`SWPc\US\ \OQV RS[ F;:AbO\RO`R 4º` RS\ 2ObS\OcabOcaQV heWaQVS\ 0Sb`WSPaagabS[ c\R SW\S[ 8OdO^`]U`O[[ UWPb Sa SW\S SW\TOQVS ;rUZWQVYSWb( PSW[ AbO`b SW\Sa 8OdO>`]U`O[[a Yr\\S\ Ab`W\UES`bS O\ ROa >`]U`O[[ ºPS`USPS\ eS`RS\ 2S` S[^TO\US\RS A^SWQVS`PS`SWQV eW`R W[ 9]^T RS` \PX];SbV]RS RSTW\WS`b c\R heO` OZa SW\ /``Og d][ 2ObS\bg^ BcaX]V ?a^VaP\\ BcaX]V!) 4RW^ STa :^\\P]S^iTX[T]?PaP\TcTa
public class String20 i public static void main(String[] args) for (int i=0; i < args.length; i++) System.out.println(args[i]); } k
{
ÎQd]V id\ ?a^VaP\\ BcaX]V! BSabS\ AWS ROa >`]U`O[[ W\RS[ AWS PSW[ AbO`bS\ RWS \c[S`WaQVS\ ES`bS # c\R % OZa >O`O[SbS` [WbUSPS\ aWSVS VWS`hc 6W\eSWaS W[ 9O^WbSZ 2S` >`]U`O[[OcT `cT aWSVb W\ SW\S` 1][[O\RZW\S RSa 0Sb`WSPaagabS[a OZa] eWS T]ZUb Oca(
java String20 1 5 7
3a UWPb SW\S @SWVS d]\ AbO\RO`ROcTUOPS\ RWS bg^WaQV aW\R eS\\ Ab`W\U>O`O[SbS` d]\ O\RS`S\ /\eS\Rc\US\ SW\USZSaS\ eS`RS\ \É[ZWQV ^`ºTS\ ^Q c\R fXTeXT[ >O `O[SbS` ºPS`USPS\ e]`RS\ aW\R ]RS` ^`ºTS\ d]\ fT[RWT\ 3PcT]ch_ aWS aW\R c\R eSZQVS\ 7\VOZb aWS VOPS\ ?a^VaP\\ BcaX]V! ) ?a¶UT] ^Q 4X]VPQT_PaP\TcTa ¶QTaVTQT] f^aST] bX]S
public class String21 { public static void main(String[] args) { if (args.length == 0) System.out.println("Eingabedaten fehlen"); } } ÎQd]V 0WbbS Q]RWS`S\ AWS SW\ \ScSa >`]U`O[[ ROa T]ZUS\RS 4]`[OZ^`ºTc\U Rc`QVTºV`b c\R USUSPS\S\TOZZa SW\S S\ba^`SQVS\RS 4SVZS`[SZRc\U OcaUWPb( 3a [ºaaS\ heWaQVS\
!!'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
c\R [Of ! >O`O[SbS` ºPS`USPS\ eS`RS\ 9SW\ >O`O[SbS` RO`T [SV` OZa # HSWQVS\ VOPS\ ;»bd]Vbe^abRW[PV) FXTeXT[ d]S fT[RWT ?PaP\TcTa fdaST] ¶QTaVTQT].
public class String22 { public static void main(String[] args) { if (args.length == 0 || args.length > 3) System.out.println("Bitte 1 - 3 Parameter eingeben"); for (int i=0; i < args.length; i++) { if (args[i].length() > 5) { System.out.print("Mehr als 5 Zeichen nicht erlaubt "); System.out.println(args[i]); } } }
k 2Oa T]ZUS\RS >`]U`O[[ BcaX]V!" ºPS`^`ºTb ]P RS` /cT`cTS` RWSaSa >`]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\ ?a^VaP\\ BcaX]V!") 2<3;X]T?PaP\TcTa PQUaPVT] d]S VVU Z^]eTacXTaT]
public class String23 { public static void main (String[] args) { int anzahl = 0; if (args.length == 1) { if (args[0].equals("Help")) { System.out.println("Aufruf: java String23 Anzahl"); System.exit(1); } } try { anzahl = Integer.parseInt(args[0]); } catch (Exception e) { System.out.println("Es muss die Anzahl angegeben sein"); System.exit(0); } System.out.println("Die Anzahl ist: " + anzahl); } }
!"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#$ ITa[TVT] e^] CTgc
@KXRKMKT\UT:K^Z 3KZNUJKYVROZ
2WS ;SbV]RS b_[Xc RS` 9ZOaaS BcaX]V PWSbSb SW\S ;rUZWQVYSWb [Wb 6WZTS d]\ @SUcZÉ`S\ /caR`ºQYS\ SW\S\ AObh hc hS`ZSUS\ W\ SW\hSZ\S Er`bS` 2Oa BVS[O @SUcZÉ`S /ca R`ºQYS eW`R W[ /PaQV\Wbb "$ OcaTºV`ZWQV S`ZÉcbS`b VWS` hc\ÉQVab SW\ SW\TOQVSa 0SW a^WSZ Tº` ROa /`PSWbS\ [Wb b_[Xc ?a^VaP\\ ITa[TVT] ) 0dUb_[XccT] TX]Tb Z^\_[TccT] BPciTb
public class Zerlegen01 { public static void main(String[] args) { String s1 = "Dies ist ein Satz, der zerlegt wird"; String[] ergebnis = s1.split(" "); for (int i=0; i<ergebnis.length; i++) System.out.println(ergebnis[i]); } } 2Oa AbO\RO`RB`S\\hSWQVS\ RSZW[WbS` Tº` ROa A^ZWbbS\ Wab SW\S :SS`abSZZS PZO\Y ÎQd]V id\ ?a^VaP\\ ITa[TVT] Ò\RS`\ AWS ROa :WbS`OZ ROa W\ RS\ Ab`W\U b ºPS`b`OUS\ eW`R a] OP ROaa [SV`S`S :SS`abSZZS\ heWaQVS\ RS\ Er`bS`\ Xbc c\R TX] abSVS\ >`ºTS\ AWS RO\OQV RWS >`] U`O[[OcaUOPS 6W\eSWa( Hc[ 0SaQV`SWPS\ d]\ dO`WOPZS\ B`S\\hSWQVS\ PS\rbWUb [O\ @SUcZÉ`S /ca R`ºQYS 2WS :rac\U UWPb Sa W[ /PaQV\Wbb "$
)RGYY9I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]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 ZObh VOZbS` RWS\S\ ]RS` OcQV @SUSZ\ Tº` RWS AcQVS PSaQV`SWPS\ 2WS eSaS\bZWQVS\ A]\ RS`hSWQVS\ c\R AcQV`SUSZ\ eS`RS\ VWS` Yc`h d]`USabSZZb( !"!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
J\ Ja I K J L j
RS` >c\Yb Wab >ZObhVOZbS` Tº` XSRSa HSWQVS\ OczS` RS[ HSWZS\d]`aQVcP EWSRS`V]Zc\U d]`OcaUSVS\RS` HSWQVS\ OcQV YSW\[OZ Wab [rUZWQV [W\RSabS\a SW\[OZ OPS` OcQV PSZWSPWU ]Tb abSVb Tº` ROa HSWZS\S\RS h0 J\ J`J\ ]RS` J` HSWZS\d]`aQVcP Jc/ EVWbSa^OQS \WQVb RO`abSZZPO`S HSWQVS\ eWS BOPcZOb]` ]RS` HSWZS\d]`aQVcP 0S`SWQV h0 I'K Tº` RS\ HOVZS\PS`SWQV ]RS` IOPQK Tº` O P ]RS` Q 0OQYaZOaV <SUObW]\ h0 LOPQ Tº` XSRSa HSWQVS\ OczS` O P ]RS` Q =RS`=^S`Ob]` h0 /j0 PSRScbSb / ]RS` 0
3W\ ;cabS` eWS AS eW`R a]e]VZ ASS OZa OcQV ASO TW\RS\ 2S` `SUcZÉ`S /caR`cQY AQVWITKOV`b TW\RSb AQVWTOV`b AQVWTTOV`b cae OPS` SPS\ OcQV AQVWOV`b ;Wb RS[ /ca R`cQY AQVWITKOV`b eW`R [W\RSabS\a SW\ T S`hec\US\ 3W\S <SUWS`c\U SW\Sa HSW QVS\a ]RS` 0S`SWQVSa S`T]ZUb [Wb L OZa] ZÉaab IL'K YSW\S HOVZ hc /ZZS O\RS`S\ HSWQVS\ RWS YSW\ A]\RS`hSWQVS\ aW\R [ºaaS\ US\Oc a] eWS O\USUS PS\ W[ BSfb d]`Y][[S\ RO[Wb RWS AcQVS S`T]ZU`SWQV Wab C[ SW\ HSWQVS\ ROa OcQV OZa A]\RS`hSWQVS\ RSTW\WS`b ec`RS W[ BSfb hc TW\RS\ Wab RS` 0OQYaZOaV J OZa 4ZcQVbhSWQVS\ 3aQO^SAS_cS\h O\hcUSPS\ h0 Tº` ROa 2]ZZO`hSWQVS\ OZa] J
*OK1RGYYK6GZZKXT
;Wb =PXSYbS\ RS` 9ZOaaS ?PccTa] eS`RS\ RWS `SUcZÉ`S\ /caR`ºQYS W\bS`\ W\ Q][^W ZWS`bS` 4]`[ dS`eOZbSb 2WS 7\abO\h PSY][[b [Wb RS` ;SbV]RS R^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 ATV4g" Ò\RS`\ AWS ROa >`]U`O[[ a] OP ROa OZa B`S\\hSWQVS\ a]e]VZ AS[WY]Z]\ 9][[O c\R EVWbSa^OQS dS`eS\RSb eS`RS\ 2S` hc c\bS`acQVS\RS Ab`W\U Wab SW\a heSW) R`SWdWS` ;»bd]Vbe^abRW[PV) import java.util.regex.*; public class RegEx04 { public static void main(String[] args) { Pattern p = Pattern.compile(";|,|\\s"); String[] erg = p.split("eins zwei;drei,vier"); for (int i=0; i<erg.length; i++) System.out.println(erg[i] + '\n'); } } ÎQd]V id\ ?a^VaP\\ ITa[TVT] Pdb 0QbRW]Xcc #$ )
2Oa >`]U`O[[ O`PSWbSb [Wb RS` b_[Xc;SbV]RS RS` 9ZOaaS BcaX]V :SWRS` Wab RS` A^ZWb d]`UO\U W\ RS` PWaVS`WUS\ DO`WO\bS eS\WU Y][T]`bOPSZ h0 eS`RS\ [SV`S`S 0ZO\Ya heWaQVS\ RS\ Er`bS`\ \WQVb `WQVbWU dS`O`PSWbSb /PS` XSbhb YS\\S\ AWS @SUcZÉ`S /ca R`ºQYS c\R RWS Yr\\S\ OcQV W\ RS` b_[Xc;SbV]RS RS` 9ZOaaS BcaX]V SW\USaSbhb eS`RS\ Ò\RS`\ AWS RSaVOZP ROa >`]U`O[[ a] OP ROaa W[ Ab`W\U OcQV \TWaTaT 0ZO\Ya heW aQVS\ RS\ SW\hSZ\S\ Er`bS`\ `WQVbWU S`YO\\b eS`RS\ !"#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
;»bd]Vbe^abRW[PV public class Zerlegen02 { public static void main(String[] args) { String s1 = "Dies ist ein Satz, der zerlegt werden soll"; String[] ergebnis = s1.split(" +"); for (int i=0; i<ergebnis.length; i++) System.out.println(ergebnis[i]); } }
*OK1RGYYK3GZINKX
2WSaS 9ZOaaS dS`UZSWQVb SW\S\ Ab`W\U [Wb RS[ `SUcZÉ`S\ /caR`cQY c\R dS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WabS\ UWPb Sa RWS CB4&1]RWS`c\U ?a^VaP\\ DC5') :^\_aX\XTacTb BXRWTa] e^] D]XR^ST3PcT] d]S Z^\_PcXQ [Ta 0dbcPdbRW e^] D]XR^ST3PcT] ¶QTa ?[PccU^a\VaT]iT] SdaRW DC5'
public class Utf08 { public static void main(String[] args) String str1 = "A\u0001\u0093";
throws Exception {
// Konvertieren String in UTF byte[] b1 = str1.getBytes("UTF8"); for (int i=0; i
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# ITXRWT]ZTccT] P]fT]ST] bcaX]Vb
String str2 = new String(b1, "UTF8"); System.out.println(str2); } } IdbP\\T]UPbbd]V
HSWQVS\YSbbS\ aW\R 8OdO=PXSYbS 4º` ROa /`PSWbS\ [Wb Ab`W\Ua UWPb Sa W\ RS` AbO\ RO`RPWPZW]bVSY d]\ 8OdO R`SW eWQVbWUS 9ZOaaS\( •
1ZOaa BcaX]V( C\dS`É\RS`ZWQVSa W[[cbOPZS HSWQVS\YSbbS\]PXSYb [Wb dWSZ ;S bV]RS\Y][T]`b
•
1ZOaa BcaX]V1dUUTa( DS`É\RS`ZWQVSa Ab`W\U]PXSYb YO\\ PSW 0SRO`T eÉV`S\R RS` >`]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` RO\\ dS`eS\RSb eS`RS\ eS\\ Ab`W\U]PXSYbS aWQV VÉcTWU É\RS`\ c\R eS\\ [O\ bV`SORaOTSbg \WQVb P`OcQVb
2S` C\bS`aQVWSR heWaQVS\ RS\ PSWRS\ ZSbhbUS\O\\bS\ 9ZOaaS\ Wab SW\ BVS[O Tº` 4]`bUSaQV`WbbS\S( BcaX]V1dUUTa Wab bV`SORaOTS) BcaX]V1dX[STa Wab heO` />7Y][^ObWPSZ hc BcaX]V1dUUTa PWSbSb OPS` YSW\S Ag\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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); } }
5S\S`SZZ Wab SW\S 9]\dS`bWS`c\U PSW @STS`S\hbg^S\ \c` [rUZWQV eS\\ SW\S DS` eO\RbaQVOTb PSabSVb heWaQVS\ RS\ 9ZOaaS\ 3a [caa aWQV OZa] c[ SW\S =PS` c\R C\bS`YZOaaS VO\RSZ\ RV aWS [ºaaS\ W\ SW\S` DS`S`Pc\UaPShWSVc\U abSVS\ Rc`QV ROa AQVZºaaSZe]`b TgcT]Sb 9SW\S >`]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[TJ8KLKXKT`Z_VKT
7\ 8OdO Wab Sa \WQVb S`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WabS\ 4ÉZZS\ S`T]ZUb RO\\ ROa 3W\^O QYS\ e`O^^W\U P]fW\U Ocb][ObWaQV RV Oca RS[ SW\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]` heWaQ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 ÎQd]V id\ ?a^VaP\\ :^]eTac
Ò\RS`\ AWS ROa >`]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É\US` \WQVb ºPS`SW\ a] YO\\ W\ PSabW[[bS\ 4ÉZZS\ SW\S Ocb] [ObWaQVS 2ObS\bg^/\^Oaac\U S`T]ZUS\ 2Oa USaQVWSVb OPS` \c` eS\\ RWS 9]\dS`aW ]\ ]V\S 5STOV`S\ d]\ 7\T]`[ObW]\adS`Zcab ]RS` TÉZaQVc\U [rUZWQV Wab C\R ROTº` UWPb Sa ab`S\US @SUSZ\( •
PSW SW\TOQVS\ Bg^S\( C[eO\RZc\U \c` d]\ YZSW\ \OQV U`]z
•
PSW @STS`S\hbg^S\( C[eO\RZc\U \c` d]\ a^ShWSZZ OcT OZZUS[SW\
2WSaS ab`S\US Bg^WaWS`c\U W\ 8OdO YO\\ OZZS`RW\Ua [Wb SW\WUS\ A^`OQV[WbbSZ\ OcTUS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S` ]RS` c[ =PXSYb [S[PS` VO\RSZb OcQV ROhc a^ÉbS` [SV`)
•
Tº` RWS ;rUZWQVYSWb a] US\O\\bS 0RRTbb <^SXUXTa hc PS\cbhS\ c[ RWS AWQVb PO`YSWb SW\hcU`S\hS\ ]RS` OcahceSWbS\ RWSa Wab \c` Tº` ;S[PS`DO`WOPZS\ [rU ZWQV Z]YOZS DO`WOPZS PZSWPS\ W[[S` \c` Z]YOZ aWQVbPO`
!$!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% <^SXUXTa aXRWcXV TX]bTciT] PRRTbb R^]ca^[
9OINZHGXQKOZ[TJ-RZOMQKOZ\UT
2S` AQ]^S 5ºZbWUYSWbaPS`SWQV SW\S` DO`WOPZS\ Wab RS` 0S`SWQV W\ RS[ RWS DO`WOPZS `STS`S\hWS`b eS`RS\ YO\\ [Wb WV`S[ aW[^ZS\
// Membervariable
// lokale Variable
// Fehler, lokale V.
{
2WS ?cSZZbSfb2ObSW Tº` RWSaSa >`]U`O[[ [caa BR^_TCTbc YPeP VSWzS\ 2WS DO`WOPZS iPW[ Wab OczS`VOZP XSRS` ;SbV]RS RSYZO`WS`b AWS Wab RO[Wb SW\ 3ZS[S\b [S[PS` RS` 9ZOaaS c\R W\ RS` USaO[bS\ 9ZOaaS UºZbWU AWS YO\\ W\ XSRS` ;SbV]RS RWSaS` 9ZOaaS PS\cbhb eS`RS\ 7\ RWSaS[ >`]U`O[[ eW`R RWS DO`WOPZS W\ RS` ;SbV] RS PdbVTQT] O\USa^`]QVS\ 7\\S`VOZP SW\S` 9ZOaaS eS`RS\ RWS ;S[PS` [Wb WV`S[ aW[^ZS\
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%" FT[RWT] 0]UP]VbfTac WPQT] SXT EPaXPQ[T].
3W\S 0Sa]\RS`VSWb W[ :SPS\ SW\S` DO`WOPZS\ Wab SW\S AWbcObW]\ e] aWS bS[^]`É` dS` RSQYb eW`R d]\ SW\S` O\RS`S\ UZSWQV\O[WUS\ DO`WOPZS\ B`]bhRS[ YO\\ aWS O\US a^`]QVS\ c\R dS`O`PSWbSb eS`RS\ ?a^VaP\\ BWPS^f ) ÎQTaSTRZT] TX]Ta EPaXPQ[T] class Shadow01 { static int z1 = 100; // Member-V. public static void main(String[] a) { int z1 = 2; // Lokale V. System.out.println(z1); } } ÎQd]V id\ ?a^VaP\\ BWPS^f ÎQd]V ( 0WbbS ºPS`ZSUS\ AWS eWS W\ RS` \PX];SbV]RS OcT RWS ;S[PS`dO`WOPZS i hcUSU`WTTS\ eS`RS\ YO\\ c\R bSabS\ AWS RWS :rac\U :rac\UaVW\eSWa( 2O Sa aWQV c[ SW\S bcPcXRDO`WOPZS VO\RSZb eW`R aWS _cOZWTWhWS`b [Wb RS[ 9ZOaaS\\O[S\ ÎQd]V !) 0WbbS ^`ºTS\ AWS Rc`QV >`]U`O[[É\RS`c\U ]P RS`aSZPS
=KRINKT'TLGTMY]KXZNGHKTJOK
5`c\RaÉbhZWQV eS`RS\ OZZS ;S[PS`DO`WOPZS\ d]\ 8OdO [Wb SW\S[ ^OaaS\RS\ /\ TO\UaeS`b d]`PSZSUb 2WSaS` 7\WbWOZeS`b Wab OPVÉ\UWU d][ 2ObS\bg^( h0 eS`RS\ \c [S`WaQVS DO`WOPZS\ [Wb QYTZcT UTW[T]) ]d[[ public class Init01 { public static void main(String[] args) { KlasseA a = new KlasseA(); System.out.println(a.str); } } class KlasseA { String str; }
!$#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% <^SXUXTa aXRWcXV TX]bTciT] PRRTbb R^]ca^[
'[YTGNSK RUQGRK
D]\ RWSaS` U`c\RaÉbhZWQVS\ @SUSZ hc[ 7\WbWOZWaWS`S\ UWPb Sa XSR]QV SW\S /ca\OV[S( :]YOZS DO`WOPZS\ eS`RS\ \WQVb Ocb][ObWaQV W\WbWOZWaWS`b ROa Wab /cTUOPS RSa >`] U`O[[WS`S`a 2WSa Wab OcQV aW\\d]ZZ c[ TSVZS`VOTbS D]`PSZSUc\US\ hc dS`[SWRS\ RS\\ Z]YOZS DO`WOPZS\ eS`RS\ VÉcTWU bS[^]`É` OZa HeWaQVS\a^SWQVS` PS\rbWUb ?a^VaP\\ 8]Xc!) ;^ZP[T EPaXPQ[T] \¶bbT] _Ta 7P]S X]XcXP[XbXTac fTaST] public class Init02 { public static void main(String[] args) { String str; System.out.println(str); } } ÎQd]V id\ ?a^VaP\\ 8]Xc! 2Oa >`]U`O[[ YO\\ \WQVb TSVZS`T`SW c[USeO\RSZb eS`RS\ 9]``WUWS`S\ AWS RWSaS\ 4SVZS`
2KHKTYJG[KX\UT
EO\\ ZSUb ROa AgabS[ A^SWQVS`^ZObh Tº` RWS DO`WOPZS\ O\ c\R eO\\ eW`R RWSaS` eWS RS` T`SW USUSPS\- /\RS`a UST`OUb eWS Wab RWS :SPS\aROcS` ZWTSbW[S Rc`ObW]\ RS` DO`WOPZS\-
2KHKTYJG[KX\UTRUQGRKT
/[ SW\TOQVabS\ Wab RWSaS 4`OUS PSW Z]YOZS\ DO`WOPZS\ hc PSO\be]`bS\( :]YOZS DO`WOP ZS\ eS`RS\ W[ /`PSWbaa^SWQVS` O\USZSUb eS\\ SW\S 2SYZO`ObW]\aO\eSWac\U OcaUS TºV`b eW`R ;SbV]RS\^O`O[SbS` PSZSUS\ A^SWQVS`^ZObh a]POZR RWS ;SbV]RS OcTUS`c TS\ eW`R 2O\OQV YO\\ XSRS /\eSWac\U W\\S`VOZP RWSaSa 0Z]QYa Phe RS` ;SbV]RS RO`OcT hcU`SWTS\ 2WS 3fWabS\h RS` DO`WOPZS\ S\RSb eS\\ RS` 0Z]QY ]RS` RWS ;SbV] RS W\ RS` aWS RSYZO`WS`b e]`RS\ Wab dS`ZOaaS\ eW`R ?a^VaP\\ ;^ZP[ ) ETabdRW TX]T [^ZP[T EPaXPQ[T ]PRW 4]ST STa ;TQT]bSPd Ta PdbidVTQT] public class Lokal01 { public static void main(String[] a) { for (int i = 0; i< 3; i++) { System.out.println(i); } System.out.println(i); } } !$$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%# ;TQT]bSPdTa e^] EPaXPQ[T]
ÎQd]V id\ ?a^VaP\\ ;^ZP[ 2Oa >`]U`O[[ YO\\ \WQVb TSVZS`T`SW c[USeO\RSZb eS`RS\ 0WbbS PSVSPS\ AWS RS\ 4SVZS` ;»bd]Vbe^abRW[PV public class Lokal02 { public static void main(String[] a) { int i; for (i = 0; i< 3; i++) { System.out.println(i); } System.out.println(i); } } 2WS :SPS\aROcS` d]\ ;SbV]RS\^O`O[SbS`\ ÉV\SZb RS` d]\ Z]YOZS\ >O`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`
public class MethodParm01 { public static void main(String[] a) { MethodParm01 m = new MethodParm01(); m.methodA(17); // System.out.println(zahl); // existiert nicht mehr! } void methodA(int zahl) { System.out.println(zahl++); } } 7[ >`]U`O[[ O`O[SbS` d]\ RS` ;SbV]RS \TcW^S0 RSYZO`WS`b 2S` DS`acQV d]\ OczS`VOZP RWSaS` ;SbV]RS OcT RWS DO`WOPZS iPW[ hchcU`SWTS\ TºV`b hc SW\S[ C[eO\RZc\UaTSVZS` 2SaeSUS\ Wab RWS HSWZS # OZa 9][[S\bO` USaQV`WSPS\ e]`RS\ ÎQd]V id\ ?a^VaP\\ `]U`O[[ a] ROaa RS` USeº\aQVbS 3TTSYb S`hWSZb eW`R :r ac\UaVW\eSWa( 2S` ES`b RSa >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 ))
% <^SXUXTa aXRWcXV TX]bTciT] PRRTbb R^]ca^[
2KHKTYJG[KX\U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ROaa d]`VS` 7\abO\hS\ RWSaS` 9ZOaaS S`hScUb eS`RS\ c[ RO`OcT hchcU`SWTS\ <]QV SW\ 6W\eSWa hc[ 0SU`WTT bcPcXR( 2Oa AQVZºaaSZe]`b bcPcXR eW`R [O\QV[OZ UZSWQVUSaSbhb [Wb Y]\abO\b 2Oa ^Oaab W\ RWSaS[ 4OZZ OPS` \WQVb RS\\ [Wb bcPcXR Wab ROa 5SUS\bSWZ d]\ Rg\O[WQ US[SW\b eSWZ RWSaS DO`WOPZS\ \WQVb hc` :OcThSWb S`hScUb eS` RS\ a]\RS`\ PSW[ :ORS\ RS` 9ZOaaS c\R RO\\ abObWaQV PWa hc[ 3\RS RS` >`] U`O[[ZOcThSWb hc` DS`TºUc\U abSVS\ ?a^VaP\\ BcPcXRCTbc ) BcPcXREPaXPQ[T eTaPaQTXcT]
class Static01 { static int zahl; static String text; } class StaticTest01 { public static void main(String[] a) { System.out.println(Static01.zahl + Static01.text); } } ÎQd]V id\ ?a^VaP\\ BcPcXRCTbc 0WbbS YZÉ`S\ AWS Rc`QV >`]U`O[[É\RS`c\U RWS 4`OUS ]P RWS \PX];SbV]RS OcQV W\ \S`VOZP RS` 9ZOaaS BcPcXR abSVS\ Yr\\bS EWS É\RS`b aWQV RO\\ RWS /`b RS` /R`Sa aWS`c\U d]\ iPW[ c\R cTgc. !$&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%# ;TQT]bSPdTa e^] EPaXPQ[T]
bcPcXR<^SXUXTa U¶a `][W\S\bSa 0SWa^WSZ SW\S` a]ZQVS\ ;SbV] RS( RWS ;SbV]RS \PX] AWS eW`R d][ :OcThSWbagabS[ USabO`bSb ]V\S ROaa d]`VS` SW\S 7\abO\h RWSaS` 9ZOaaS S`hScUb eW`R %#!!
8]bcP]iT[T\T]cT >QYTZcePaXPQ[T]
/[ eWQVbWUabS\ aW\R RWS 7\abO\hSZS[S\bS h0 DO`WOPZS\ RWSaS eS`RS\ Tº` XSRS 7\ abO\h O\USZSUb RWS S`hScUb eW`R \]`[OZS`eSWaS [Wb RS[ AQVZºaaSZe]`b ]Tf 2WS DS`O`PSWbc\U YO\\ Oca OZZS\ \]`[OZS\ ;SbV]RS\ RWSaS` 9ZOaaS VS`Oca S`T]ZUS\ Rc`QV 0S\cbhc\U RSa SW\TOQVS\
class Instanz01 { int zahl; String text; Instanz01() {}; Instanz01(int z, String t) { zahl = z; text = t; } } class InstanzTest01 { public static void main(String[] a) { Instanz01 instanz1 = new Instanz01(17,"ABC"); Instanz01 instanz2 = new Instanz01(25,"XYZ"); System.out.println(instanz1.zahl + instanz1.text); } } 2WS C[eO\RZc\UaSW\VSWb ?cSZZbSfbRObSW [caa 8]bcP]iCTbc YPeP VSWzS\ 3W\ BSab RSa >`]U`O[[a RS[]\ab`WS`b ROaa SW\ AObh ;S[PS`dO`WOPZS\ ^`] =PXSYb O\USZSUb eW`R /czS`RS[ hSWUb Sa eWS RWS SW\hSZ\S\ DO`WOPZS\ `STS`S\hWS`b eS`RS\ ÎQd]V id\ ?a^VaP\\ 8]bcP]iCTbc 0WbbS É\RS`\ AWS ROa >`]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 ))
% <^SXUXTa aXRWcXV TX]bTciT] PRRTbb R^]ca^[
@[MXOLLYXKINZK\UTG[KXNGRHKOTKX1RGYYKGIIKYYIUTZXUR
2WSaS` /PaQV\Wbb PSTOaab aWQV [Wb RS` 4`OUS( ES` RO`T d]\ OczS\ OcT 3ZS[S\bS SW\S` 9ZOaaS hcU`SWTS\- ES` RO`T OZa] RWS 4SZRS` PS\cbhS\ RV ZSaS\ ]RS` dS`É\RS`\ c\R eS` RO`T RWS ;SbV]RS\ OcT`cTS\- 7\\S`VOZP SW\S` 9ZOaaS YO\\ XS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S\beSRS` RS`
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%$ IdVaXUUbaTRWcT e^] PdvTaWP[Q TX]Ta :[PbbT PRRTbb R^]ca^[
?a^VaP\\ IdVaXUUCTbc ) @dP[XUXZPcX^] SdaRW ATUTaT]iePaXPQ[T
class Zugriff01 { int zahl1; void setZahl1(int z3) { zahl1 = z3; } void ausgeben() { System.out.println(zahl1); } }
// Nicht private!
public class ZugriffTest01 { public static void main(String[] a) { Zugriff01 z01 = new Zugriff01(); z01.setZahl1(15); z01.ausgeben(); System.out.println(z01.zahl1); // Direktaufruf } } 2WS ;S[PS`dO`WOPZS iPW[ Wab SW\ 3ZS[S\b RS` 9ZOaaS IdVaXUU AWS Wab ]XRWc Oca R`ºQYZWQV OZa _aXePcT RSYZO`WS`b 2SaeSUS\ UWZb RWS AbO\RO`R`SUSZ( 8SRS O\RS`S 9ZOaaS W\ RWSaS[ >OYSb YO\\ OcT RWSaSa 3ZS[S\b hcU`SWTS\ c\R Sa OcQV dS`É\RS`\ 2S` HcU`WTT S`T]ZUb O\RS`a OZa W\\S`VOZP SW\S` 9ZOaaS \c\ _cOZWTWhWS`b R V [Wb 6WZTS RSa >c\Yb=^S`Ob]`a X]bcP]i]P\TUT[S]P\T ÎQd]VT] id\ ?a^VaP\\ IdVaXUU ÎQd]V ( 1]RWS`S\ AWS Tº` RWS ;S[PS`dO`WOPZS iPW[ RS\ HcU`WTTa[]RWTWS` _aXePcT ROa S \WQVb dS`USaaS\ RS\\ _aXePcT Wab YSW\ RScbaQVSa E]`b DS`acQVS\ AWS SW\S C[eO\RZc\U RS` C[eO\RZc\UaSW\VSWb IdVaXUUCTbc YPeP 3`USP\Wa( Sa eW`R SW\ C[eO\RZc\UaTSVZS` OcaUSUSPS\ :raQVS\ AWS RO\OQV RS\ ;]RWTWS` _aXePcT eWSRS` ÎQd]V !( 3`UÉ\hS\ AWS RWS 9ZOaaS IdVaXUUCTbc c[ T]ZUS\RS /cTUOPS( 3a a]ZZ SW\S heSWbS 7\abO\h i! RS` 9ZOaaS IdVaXUU S`hScUb eS`RS\ 2WS ;S[PS`dO`WOPZS iPW[ a]ZZ RS\ ES`b % PSY][[S\ 2O\OQV a]ZZ RWS ;SbV]RS _aX]c[] OcTUS`cTS\ eS`RS\ RWS RW`SYb RWS ;S[PS`dO`WOPZS iPW[ `STS`S\hWS`b OZZS`RW\Ua Tº` RWS 7\abO\h i! 2WSaS ÍPc\U VOb cO UShSWUb ROaa d]\ RS` AbO\RO`R`SUSZ Tº` ROa HcU`WTTa`SQVb OP USeWQVS\ eS`RS\ YO\\ W\RS[ a] US\O\\bS HcU`WTTa[]RWTWS` h0 _aXePcT PS\cbhb eS`RS\ 0Sd]` eW` XSR]QV RSbOWZZWS`b RWS SW\hSZ\S\ AQVZºaaSZer`bS` Tº` RWS HcU`WTTa`SQVbS PS a^`SQVS\ [ºaaS\ eW` RWS 4`OUS YZÉ`S\ eOa c\bS` SW\S[ >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 ))
% <^SXUXTa aXRWcXV TX]bTciT] PRRTbb R^]ca^[
(KJK[Z[TMJKX6GIQGMK4GSKT
3W\ eWQVbWUSa HWSZ RS` ]PXSYb]`WS\bWS`bS\ >`]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\USPOcb( aWS aW\R \c` W\\S`VOZP SW\Sa 0Z]QYa Phe SW\S` ;SbV]RS O\a^`SQVPO` /\RS`a dS`VÉZb Sa aWQV [W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b 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[
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%% 1TSTdcd]V STa ?PRZPVT=P\T]
?a^VaP\\ IdVaXUU!) 0aQTXcT] \Xc ?PRZPVT]P\T] package merker; class Zugriff02 { int zahl1; void setZahl1(int z3) { zahl1 = z3; } void ausgeben() { System.out.println(zahl1); } } 2c`QV RWS >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 ))
% <^SXUXTa aXRWcXV TX]bTciT] PRRTbb R^]ca^[
ÎQd]V id\ ?a^VaP\\ IdVaXUUCTbc! EO\RSZ\ AWS RO\OQV ROa >`]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
!%"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%& IdVaXUUb\^SXUXTa _aXePcT _dQ[XR _a^cTRcTS
@[MXOLLYSUJOLOKXVXO\GZKV[HROIVXUZKIZKJ @[MXOLLYSUJOLOKXLX,KRJKX
2WS D]`UOPS RSTOcZb Wab ROaa OcT 9ZOaaS\ c\R WV`S 3ZS[S\bS d]\ OZZS\ O\RS`S\ 9ZOaaS\ Oca RS[aSZPS\ >OYSb hcUSU`WTTS\ eS`RS\ Yr\\S\ ES\\ SW\S 9ZOaaS OPS` dS`acQVb OcT 9ZOaaS\ ]RS` RS`S\ 3ZS[S\bS hchcU`SWTS\ RWS OczS`VOZP RSa SWUS\S\ >OQYOUSa aW\R Wab RWSa \WQVb [rUZWQV 3a aSW RS\\ RS` >`] U`O[[WS`S` VOb RWSa [Wb RS\ S\ba^`SQVS\RS\ AQVZºaaSZer`bS`\ OcaR`ºQYZWQV S`ZOcPb C\R RWSaSa AQVZºaaSZe]`b Wab _dQ[XR 2Oa Wab RWS 3`YZÉ`c\U Tº` RS\ C[eO\RZc\UaTSVZS` W\ RS[ >`]U`O[[ IdVaXUU! Oca RS[ d]`VS`WUS\ /PaQV\Wbb 2WS :rac\U ZOcbSb OZa]( 2WS 9ZOaaS [caa _dQ[XR aSW\ ÎQd]V id ST] ?a^VaP\\T] IdVaXUU!IdVaXUUCTbc! 4ºUS\ AWS W[ >`]U`O[[ IdVaXUU!YPeP Tº` RWS 9ZOaaS c\R Tº` RWS PSWRS\ ;SbV]RS\ ROa AQVZºaaSZe]`b _dQ[XR SW\ c\R eO\RSZ\ AWS ROa >`]U`O[[ \Sc c[ ;»bd]Vbe^abRW[PV package merker; public class Zugriff02 { int zahl1; public void setZahl1(int z3) { zahl1 = z3; } public void ausgeben() { System.out.println(zahl1); } } DS`USaaS\ AWS \WQVb SdS\bcSZZ OcQV ROa >`]U`O[[ IdVaXUUCTbc! \Sc c[hceO\RSZ\ 2O\OQV [ºaabS RWS >`]U`O[[OcaTºV`c\U TSVZS`T`SW [rUZWQV aSW\ FT[RWT IdVaXUUb\^SXUXTa VXQc Tb. 3a UWPb R`SW AQVZºaaSZer`bS` c[ RS\ HcU`WTT hc PSaQV`É\YS\ Phe hc S`eSWbS`\( •
_aXePcT( \c` W\\S`VOZP RS` SWUS\S\ 9ZOaaS hcU`SWTPO`
•
_dQ[XR( OZZS Rº`TS\ hcU`SWTS\
•
_a^cTRcTS( \c` OPUSZSWbSbS 9ZOaaS\ c\R RWS SWUS\S \Obº`ZWQV
ES\\ YSW\Sa RWSaS` AQVZºaaSZer`bS` O\USUSPS\ Wab UWZb RS` STUPd[c PRRTbb( •
W\\S`VOZP SW\Sa >OYSba Wab OZZSa OcQV d]\ O\RS`S\ 9ZOaaS\ \cbhPO` !%#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% <^SXUXTa aXRWcXV TX]bTciT] PRRTbb R^]ca^[
IdVaXUUb\^SXUXTa d]S SPb X]U^a\PcX^] WXSX]V 3a UWZb OZa]( ES\\ RS` >`]U`O[[WS`S` \WQVba O\RS`Sa OcaR`ºQYZWQV PSabW[[b RO\\ YO\\ SW\S DO`WOPZS d]\ OZZS\ >`]U`O[[S\ RWSaSa >OYSba dS`É\RS`b eS`RS\ RV aWS Wab \WQVb USaQVºbhb d]` RS[ HcU`WTT Oca O\RS`S\ 9ZOaaS\ 2WSa S\ba^`WQVb \WQVb RS` 7RSS RS` 2ObS\YO^aSZc\U c\R RWS 3[^TSVZc\U Wab RSaVOZP ;S[PS`dO`WOPZS\ [Wb RS[ AQVZºaaSZe]`b _aXePcT hc RSYZO`WS`S\ RO[Wb RS` HcU`WTT a] SW\USU`S\hb eW`R ROaa d]\ OczS`VOZP RS` SWUS\S\ 9ZOaaS YSW\ RW`SYbSa :SaS\ c\R YSW\ RW`SYbSa DS`É\ RS`\ C^RObS [rUZWQV Wab ?a^VaP\\ ?aXePcT ) ?aXePc STbfTVT] IdVaXUU eTaQ^cT] class Private01 { private int zahl; } class PrivateTest01 { public static void main(String[] a) { Private01 p1 = new Private01(); System.out.println(p1.zahl); // illegal } } 3W\ HcU`WTT OcT RWS ^`WdObS\ ;S[PS`dO`WOPZS\ Wab W\ a]ZQVS\ 4ÉZZS\ \c` W\RW`SYb [rU ZWQV Rc`QV ASbbS` c\R 5SbbS`;SbV]RS\ 2WSa S\ba^`WQVb RS` S[^T]VZS\S\ D]`US VS\aeSWaS ES\\ SW\S 3W\aQV`É\Yc\U OZa _aXePcTDO`WOPZS \WQVb [rUZWQV Wab a] a]ZZbS US^`ºTb eS`RS\ ]P RWS DO`WOPZS [Wb RS[ ;]RWTWS` _a^cTRcTS USYS\\hSWQV\Sb eS`RS\ YO\\ 2WSa VOb hc` 4]ZUS ROaa \c` d]\ OPUSZSWbSbS\ 9ZOaaS\ hcUSU`WTTS\ eS`RS\ YO\\ RS` HcU`WTT PZSWPb W\\S`VOZP RS` DS`eO\RbaQVOTb ?a^VaP\\ ?a^cTRcTS ) IdVaXUU ]da U¶a ETafP]ScT d]S X]]TaWP[Q STb ?P ZTcb
class Protected01 { protected int zahl; } class ProtectedTest01 { public static void main(String[] a) { Protected01 p1 = new Protected01(); System.out.println(p1.zahl); // legal } } ÎQd]V id\ ?a^VaP\\ ?a^cTRcTSCTbc ÎQd]V ( EO\RSZ\ AWS ROa >`]U`O[[ c[ c\R bSabS\ AWS Sa A]e]VZ RWS C[eO\R Zc\U OZa OcQV RWS /caTºV`c\U aW\R ]V\S >`]PZS[S [rUZWQV
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%& IdVaXUUb\^SXUXTa _aXePcT _dQ[XR _a^cTRcTS
;»bd]VbWX]fTXb( _a^cTRcTS S`ZOcPb RS\ HcU`WTT S\beSRS` d]\ OZZS\ OPUSZSWbSbS\ 9ZOaaS\ ^STa Pdb ST\bT[QT] ?PRZPVT VS`Oca 0SWRS 9ZOaaS\ abSVS\ W\ RS[aSZPS\ 2STOcZb>OQYOUS 2SaeSUS\ UWPb Sa YSW\S >`]PZS[S ÎQd]V !( 0WbbS ]`R\S\ AWS hc\ÉQVab \c` RWS QZOaa ?a^cTRcTS SW\S[ PSZWSPWUS\ >OQYOUS hc BSabS\ AWS 2O\OQV ]`R\S\ AWS OcQV RWS QZOaa ?a^cTRcTSCTbc RWSaS[ >OQYOUS hc 2O\\ [ºaabS a]e]VZ C[eO\RZc\U OZa OcQV /caTºV`c\U Tc\YbW]\WS`S\ 3a UWPb \]QV SW\ R`WbbSa AQVZºaaSZe]`b Tº` DO`WOPZS\ c[ RWS HcU`WTTa`SQVbS Sf^ZWhWb hc É\RS`\ C\R ROa Wab RS` ;]RWTWS` _dQ[XR 2O[Wb eW`R YTST\ S`ZOcPb RWS a] USYS\\ hSWQV\SbS DO`WOPZS hc ZSaS\ c\R]RS` hc dS`É\RS`\ 2`W\US\RS 3[^TSVZc\U( RWSaSa AQVZºaaSZe]`b a]ZZbS \c` W\ e]VZ PSU`º\RSbS\ /ca\OV[STÉZZS\ SW\USaSbhb eS`RS\
@[MXOLLYSUJOLOKXLX3KZNUJKT
3W\ HcU`WTT OcT SW\S ;SbV]RS SW\S` 9ZOaaS Wab aSZPabdS`abÉ\RZWQV OcQV d]\ XSRS` ;S bV]RS RS` SWUS\S\ 9ZOaaS [rUZWQV 2WSa YO\\ OcQV \WQVb SW\USU`S\hb eS`RS\ /PS` eSWZ OcQV VWS` RWS D]`UOPS ZOcbSb( \c` W\\S`VOZP SW\Sa >OYSbSa YO\\ RWSaS ;S bV]RS PS\cbhb eS`RS\ Wab Sa VÉcTWU \]beS\RWU RWSaS @SQVbS hc S`eSWbS`\ Rc`QV RS\ ;]RWTWS` _dQ[XR 2O[Wb eW`R Sa OcQV RS\ OYSbSa [rU ZWQV RWSaS ;SbV]RS OcThc`cTS\ 3W\S 3W\U`S\hc\U RS` HcU`WTTa`SQVbS Wab SPS\TOZZa [rUZWQV( Rc`QV RS\ ;]RWTWS` _aXeP cT 2O\\ RO`T RWSaS ;SbV]RS \c` d]\ ;SbV]RS\ RS` SWUS\S\ 9ZOaaS OcTUS`cTS\ eS` RS\
@[MXOLLYSUJOLOKXLX1RGYYKT
3W\S 9ZOaaS a]ZZbS [Wb RS[ ;]RWTWS` _dQ[XR dS`aSVS\ aSW\ eS\\ aWS SW\S \PX] ;SbV]RS S\bVÉZb 2Oa VSWzb SW\S 8OdO/^^ZWYObW]\ RWS Rc`QV /cT`cT RSa 7\bS`^`SbS`a USabO`bSb eW`R [caa \WQVb \c` W\ SW\S` C[eO\RZc\UaSW\VSWb [Wb RS[
public class PublicTest01 { public static void main(String[] a) { Public01 p = new Public01(); } } public class Public01 { private int zahl1; void setZahl1(int z3) { zahl1 = z3; !%%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% <^SXUXTa aXRWcXV TX]bTciT] PRRTbb R^]ca^[
} void ausgeben()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) ;]RWTWS`
QZOaa
AcPQZOaa >OQYOUS ESZbeSWb
_aXePcT
f
_a^cTRcTS
f
f
f
_dQ[XR
f
f
f
f
STUPd[c
f
f
/PP $ ( ESZQVS\ HcU`WTT S`ZOcPS\ RWS SW\hSZ\S\ /QQSaa;]RWTWS`- !%&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
0
8]bcP[[PcX^]WX]fTXbT 9!B4 B3: $
'
/TYZGRRGZOUTYNOT]KOYK09+9*1
4º` RWS 7\abOZZObW]\ RS` 8 A3 A29 # c\bS` ;AEW\R]ea aW\R T]ZUS\RS AQV`WbbS \]b eS\RWU( •
3a eS`RS\ DS`eOZbc\Ua`SQVbS PS\rbWUb
•
5SabO`bSb eW`R RWS 2ObSW RWS d]\ RS` ESPAWbS RS` 4W`[O Ac\ USV]Zb ec`RS h0 YSZ N$NN$fX]S^fbX$'%_TgT
•
'/TYZGRRGZOUTNOT]KOYK09+9*1
•
3[^TSVZc\U( /ZZS /\UOPS\ c\dS`É\RS`b ZOaaS\ SdS\bcSZZ YO\\ RS` 7\abOZZObW]\a ]`R\S` USÉ\RS`b eS`RS\
•
2S\ 0cbb]\ =Tgc OcaeÉVZS\ !%'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
0 8]bcP[[PcX^]bWX]fTXbT 9!B4 B3: $
•
2Oa T]ZUS\RS 4S\abS` PWSbSb eSWbS`S ASbc^/\UOPS\ O\(
•
2Oa 4S\abS` PWSbSb RWS ;rUZWQVYSWb RWS C\bS`abºbhc\U Tº` \WQVbSc`]^ÉWaQVS A^`O QVS\ hc W\abOZZWS`S\
•
3[^TSVZc\U( /ZZS /\UOPS\ c\dS`É\RS`b ZOaaS\ ZSRWUZWQV RWS 7\abOZZObW]\a]`R\S` Yr\\bS\ USÉ\RS`b eS`RS\
•
2S\ 0cbb]\ =Tgc OcaeÉVZS\
•
2O\\ ^`ºTb ROa 7\abOZZObW]\a^`]U`O[[ eSZQVS 0`]eaS` PS\cbhb eS`RS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.2005 13:39:00 ))
0 8]bcP[[PcX^]bWX]fTXbT 9!B4 B3: $
•
6S`hZWQVS\ 5ZºQYec\aQV( ROa 8 A3 2SdSZ]^S` 9Wb # Wab OcT 7V`S[ @SQV\S` dS` TºUPO`
Ó]STad]V STa _PcW4]eXa^]\T]cEPaXPQ[T 2O[Wb RWS \]beS\RWUS\ >`]U`O[[S hc[ C[eO\RSZ\ c\R /caTºV`S\ Oca SW\S` 1;2AVSZZ 3W\UOPSOcTT]`RS`c\U c\bS` EW\R]ea PSW[ /cT`cT OcQV USTc\RS\ eS`RS\ [caa \c\ OPaQVZWSzS\R RWS >/B63\dW`]\[S\bDO`WOPZS S`UÉ\hb eS`RS\ c[ RS\ QX]=`R\S` RS` 7\abOZZObW]\a2W`SQb]`g 2WSa USaQVWSVb S\beSRS` bS[^]`É` Rc`QV 3W\UOPS RSa T]ZUS\RS\ 1][[O\Ra(
]RS` ºPS` ROa 71=< /`PSWba^ZObh( 0SW EW\R]ea Rc`QV /cT`cT [Wb RS` `SQVbS\ ;OcabOabS RO\OQV( Eigenschaften|Erweitert|Umgebungsvariablen !&
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
0
8]bcP[[PcX^]WX]fTXbT 9!B4 B3: $
7X]fTXbT id\ _PcWBdRW_UPS) •
2WSaS Ò\RS`c\US\ eS`RS\ S`ab eW`YaO[ \OQV RS[ <ScabO`b RSa 2=A4S\abS`a
•
2WS /\UOPS\ W\ RS` >/B63\dW`]\[S\bDO`WOPZS\ PSaQV`SWPS\ Tº` ROa >`] U`O[[ Q][[O\RQ][ RWS AcQV`SWVS\T]ZUS RS` OcaTºV`PO`S\ >`]U`O[[S TgT 2ObSWS\ ES\\ OZa] h0 ROa 8OdO>`]U`O[[ _a^Va OcaUSTºV`b eS`RS\ a]ZZ eW`R RS` 0STSVZ XOdO ^`]U` SW\USUSPS\ c\R RO\\ acQVb EW\R]ea RWS YP ePTgT2ObSW \OQV RS\ >TOR/\UOPS\ W\ RS` _PcW3\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dRW TX]T] ?d]Zc T]cWÊ[c 2S` >c\Yb VOb SW\S eWQVbWUS 0SRScbc\U Tº` RWS AcQVS RS\\ S` PSabW[[b ROaa OcQV RS` OYbcSZZS >TOR PSW RS` AcQVS SW\PSh]US\ eW`R 0SWa^WSZ(
set classpath=%classpath%;d:\sun\lib\j2ee.jar;.;
3W\S eSWbS`S ;rUZWQVYSWb RS\ 1ZOaa^ObV hc aSbhS\ PSabSVb PSW[ /cT`cT RSa 8OdO 1][^WZS`a c\R RSa 8OdO7\bS`^`SbS`a 0SWRS >`]U`O[[S S`ZOcPS\ SW\S R[Pbb_PcW =^ bW]\ PSW[ AbO`bS\
3(J,XOdO R_ T)K\TaZTa BSab
!&!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
1
(
3KZG9VXGINKT`[X9_TZG^HKYINXKOH[TM
2WS Ag\bOf SW\S` A^`OQVS YO\\ [Wb SW\S` a^ShWSZZS\ ;SbOA^`OQVS SW\S A^`OQVS RWS SW\S O\RS`S A^`OQVS S`YZÉ`b PSaQV`WSPS\ eS`RS\ 0SWa^WSZS Tº` ;SbOa^`OQVS\ aW\R RWS 0OQYca
' ' /PP 0( Ag\bOfRWOU`O[[ EOa Wab SW\S 2ShW[OZhOVZ W\ 8OdO- ! 1PRZdb=Pda5^a\ 1=5 3W\ O\RS`Sa 0SWa^WSZ Wab RWS bSfbcSZZS 2O`abSZZc\U RS` A^`OQVag\bOf /\USZSV\b Wab RWSa [SWabS\a O\ RWS aSWb RS\ $S` 8OV`S\ PSYO\\bS 0OQYca
O Wab RS` hc S`YZÉ`S\RS 0SU`WTT h S\bVÉZb RWS 0SaQV`SWPc\U O eW`R Rc`QV h RSTW\WS`b
f j g
b`S\\b /ZbS`\ObWdS\ S\beSRS` f ]RS` g
I K
eOVZeSWaSa D]`Y][[S\ [OZ ]RS` [OZ ]^bW]\OZ
i k
/caeOVZ D]`Y][[S\ Wab [OZ ]RS` PSZWSPWU ]Tb
3ZS[S\b YO\\ eWSRS`V]Zb eS`RS\
!&"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
1
2Oa \OQVT]ZUS\RS 0SWa^WSZ Wab O\USZSV\b O\ RWS ;P]VdPVT B_TRXUXRPcX^] d]\ Ac\ aWSVS http://java.sun.com/docs/books/jls/
BNF-Beispiel - Variablendeklaration: VariableDeclarators: VariableDeclarator { ,
VariableDeclarator }
VariableDeclarator: Identifier VariableDeclaratorRest VariableDeclaratorRest: BracketsOpt [ =
VariableInitializer]
Kurzbeschreibung für Control-Statements: if (Expression) Statement [else Statement] for ( ForInitOpt
;
[Expression] ; ForUpdateOpt ) Statement
while (Expression) Statement do Statement while (Expression)
;
Ausführliche Beschreibung (Switch): switch (Expression) { SwitchBlockStatementGroups } SwitchBlockStatementGroups: { SwitchBlockStatementGroup } SwitchBlockStatementGroup: SwitchLabel BlockStatements SwitchLabel: case ConstantExpression : default: BlockStatements: { BlockStatement } BlockStatement : LocalVariableDeclarationStatement ClassOrInterfaceDeclaration [Identifier :] Statement
!
2 3XT TabcT] !$% D]XR^STITXRWT] UUUU
)
*OKKXYZKT;TOIUJK@KOINKTLLLL
1]RS ^W\b RSh
VSfO RSh
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007 0x0008 0x0009 0x000A 0x000B 0x000C 0x000D 0x000E 0x000F 0x0010 0x0011 0x0012 0x0013 0x0014 0x0015 0x0016 0x0017 0x0018 0x0019 0x001A 0x001B 0x001C 0x001D 0x001E 0x001F
Ag[ P]Z D]XR^ST
NULL* START OF HEADING* START OF TEXT* END OF TEXT* END OF TRANSMISSION* ENQUIRY* ACKNOWLEDGE* BELL* BACKSPACE* CHARACTER TABULATION* LINE FEED (LF)* LINE TABULATION* FORM FEED (FF)* CARRIAGE RETURN (CR)* SHIFT OUT* SHIFT IN* DATA LINK ESCAPE* DEVICE CONTROL ONE* DEVICE CONTROL TWO* DEVICE CONTROL THREE* DEVICE CONTROL FOUR* NEGATIVE ACKNOWLEDGE* SYNCHRONOUS IDLE* END OF TRANSMISSION BLOCK* CANCEL* END OF MEDIUM* SUBSTITUTE* ESCAPE* INFORMATION SEPARATOR FOUR* INFORMATION SEPARATOR THREE* INFORMATION SEPARATOR TWO* INFORMATION SEPARATOR ONE*
2? !$! 2? '$ EW\R]ea
2 = A
BSWZ d]\ &( 1]RS^]W\b !( AbScS`hSWQVS\ WRS\bWaQV [Wb CA/A177 !&$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
2
3XT TabcT] !$% D]XR^STITXRWT] UUUU
)*OKKXYZKT;TOIUJK@KOINKTLLLL 1]RS ^]W\b RShW[
VS fORS h
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
0x0020 0x0021 0x0022 0x0023 0x0024 0x0025 0x0026 0x0027 0x0028 0x0029 0x002A 0x002B 0x002C 0x002D 0x002E 0x002F 0x0030 0x0031 0x0032 0x0033 0x0034 0x0035 0x0036 0x0037 0x0038 0x0039 0x003A 0x003B 0x003C 0x003D 0x003E 0x003F
Ag[ P]Z D]XR^ST
! " # $ % & ' ( ) * + , . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
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
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
0x0040 0x0041 0x0042 0x0043 0x0044 0x0045 0x0046 0x0047 0x0048 0x0049 0x004A 0x004B 0x004C 0x004D 0x004E 0x004F 0x0050 0x0051 0x0052 0x0053 0x0054 0x0055 0x0056 0x0057 0x0058 0x0059 0x005A 0x005B 0x005C 0x005D 0x005E 0x005F
@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _
COMMERCIAL AT LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LATIN CAPITAL LETTER LEFT SQUARE BRACKET REVERSE SOLIDUS RIGHT SQUARE BRACKET CIRCUMFLEX ACCENT LOW LINE
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
2? !$!
2? '$
EW\R]ea
2 = A
BSWZ ! d]\ &( 1]RS^]W\b $"'#( 5`]zPcQVabOPS\ 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
VSfO
^]W\b RShW[
RSh
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
0x0060 0x0061 0x0062 0x0063 0x0064 0x0065 0x0066 0x0067 0x0068 0x0069 0x006A 0x006B 0x006C 0x006D 0x006E 0x006F 0x0070 0x0071 0x0072 0x0073 0x0074 0x0075 0x0076 0x0077 0x0078 0x0079 0x007A 0x007B 0x007C 0x007D 0x007E 0x007F
Ag[ P]Z D]XR^ST
GRAVE ACCENT LATIN SMALL LETTER A LATIN SMALL LETTER B LATIN SMALL LETTER C LATIN SMALL LETTER D LATIN SMALL LETTER E LATIN SMALL LETTER F LATIN SMALL LETTER G LATIN SMALL LETTER H LATIN SMALL LETTER I LATIN SMALL LETTER J LATIN SMALL LETTER K LATIN SMALL LETTER L LATIN SMALL LETTER M LATIN SMALL LETTER N LATIN SMALL LETTER O LATIN SMALL LETTER P LATIN SMALL LETTER Q LATIN SMALL LETTER R LATIN SMALL LETTER S LATIN SMALL LETTER T LATIN SMALL LETTER U LATIN SMALL LETTER V LATIN SMALL LETTER W LATIN SMALL LETTER X LATIN SMALL LETTER Y LATIN SMALL LETTER Z LEFT CURLY BRACKET VERTICAL LINE RIGHT CURLY BRACKET TILDE DELETE*
2? !$!
2? '$
EW\R]ea
2 = A
BSWZ " d]\ &( 1]RS^]W\b '$ %( 9ZSW\PcQVabOPS\ 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
Ag[ P]Z D]XR^ST
1]RS
VSfO
^]W\b RSh
RSh
128
0x0080
*
129 130
0x0081 0x0082
* BREAK PERMITTED HERE*
131 132
0x0083 0x0084
133 134
2? !$!
2? '$
EW\R]ea
2 = A
80
80
Ç
81
ü
€
82
‚
82
é
NO BREAK HERE* *
83
ƒ
83
â
84
„
84
ä
0x0085 0x0086
NEXT LINE (NEL)* START OF SELECTED AREA*
85
…
85
à
86
†
86
å
135 136
0x0087 0x0088
END OF SELECTED AREA* TABULATION SET*
87
‡
87
ç
88
ˆ
88
ê
137
0x0089
TABULATION WITH JUST.*
89
‰
89
ë
138 139
0x008A 0x008B
LINE TABULATION SET* PARTIAL LINE FORWARD*
8A
Š
8A
è
8B
‹
8B
ï
140 141
0x008C 0x008D
PARTIAL LINE BACKWARD* REVERSE LINE FEED*
8C
Œ
8C
î
8D
ì
142 143
0x008E 0x008F
SINGLE SHIFT TWO* SINGLE SHIFT THREE*
8E
8E
Ä
144 145
0x0090 0x0091
DEVICE CONTROL STRING* PRIVATE USE ONE*
91
146 147
0x0092 0x0093
PRIVATE USE TWO* SET TRANSMIT STATE*
92
148 149
0x0094 0x0095
150 151
Ž
8F
Å
90
É
‘
91
æ
’
92
Æ
93
“
93
ô
CANCEL CHARACTER* MESSAGE WAITING*
94
”
94
ö
95
•
95
ò
0x0096 0x0097
START OF GUARDED AREA* END OF GUARDED AREA*
96
–
96
û
97
—
97
ù
152
0x0098
START OF STRING*
98
˜
98
ÿ
153 154
0x0099 0x009A
* SINGLE CHARACTER INTR.*
99
™
99
Ö
155 156 157 158
0x009B 0x009C 0x009D 0x009E
CONTROL SEQUENCE INTR.* STRING TERMINATOR* OPERATING SYSTEM CM* PRIVACY MESSAGE*
9A 9B
š ›
9A 9B
Ü ø
9C
œ
9C
£
9D
Ø
159
0x009F
APPLICATION PR. CMD*
9E
ž
9E
×
9F
Ÿ
9F
ƒ
BSWZ # d]\ &( 1]RS^]W\b &#'( 7[ C\WQ]RS OZa AbScS`hSWQVS\ PSZSUb C\bS`aQVWSRZWQV PSZSUb PSW 1> # 1> ]RS` &' !'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
2
3XT TabcT] !$% D]XR^STITXRWT] UUUU
1]RS ^]W\b RSh 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
VSfO RSh 0x00A0 0x00A1 0x00A2 0x00A3 0x00A4 0x00A5 0x00A6 0x00A7 0x00A8 0x00A9 0x00AA 0x00AB 0x00AC 0x00AD 0x00AE 0x00AF 0x00B0 0x00B1 0x00B2 0x00B3 0x00B4 0x00B5 0x00B6 0x00B7 0x00B8 0x00B9 0x00BA 0x00BB 0x00BC 0x00BD 0x00BE 0x00BF
Ag[ P]Z D]XR^ST
¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
NO-BREAK SPACE INVERTED EXCLAM. MARK CENT SIGN POUND SIGN CURRENCY SIGN YEN SIGN BROKEN BAR SECTION SIGN DIAERESIS COPYRIGHT SIGN FEMININE ORDINAL INDICATOR LEFT-POINTING DOUBLE ANGLE NOT SIGN SOFT HYPHEN REGISTERED SIGN MACRON DEGREE SIGN PLUS-MINUS SIGN SUPERSCRIPT TWO SUPERSCRIPT THREE ACUTE ACCENT MICRO SIGN PILCROW SIGN MIDDLE DOT CEDILLA SUPERSCRIPT ONE MASCULINE ORDINAL INDICATOR RIGHT-POINTING DOUBLE ANGLE ONE QUARTER ONE HALF THREE QUARTERS INVERTED QUESTION MARK
2? !$!
2? '$
EW\R]ea
2 = A
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
á í ó ú ñ Ñ ª º ¿ ® ¬ ½ ¼ ¡ « » ų Ŵ ŵ Ň ō Á  À © Ť Œ Ř Ş ¢ ¥ ʼn
BSWZ $ d]\ &( 1]RS^]W\b $'( C\WQ]RS 1> # 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[ 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
0x00C0 0x00C1 0x00C2 0x00C3 0x00C4 0x00C5 0x00C6 0x00C7 0x00C8 0x00C9 0x00CA 0x00CB 0x00CC 0x00CD 0x00CE 0x00CF 0x00D0 0x00D1 0x00D2 0x00D3 0x00D4 0x00D5 0x00D6 0x00D7 0x00D8 0x00D9 0x00DA 0x00DB 0x00DC 0x00DD 0x00DE 0x00DF
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
A WITH GRAVE A WITH ACUTE A WITH CIRCUMFLEX A WITH TILDE A WITH DIAERESIS A WITH RING ABOVE LETTER AE C WITH CEDILLA E WITH GRAVE E WITH ACUTE E WITH CIRCUMFLEX WITH DIAERESIS I WITH GRAVE I WITH ACUTE I WITH CIRCUMFLEX I WITH DIAERESIS LETTER ETH N WITH TILDE O WITH GRAVE O WITH ACUTE O WITH CIRCUMFLEX O WITH TILDE O WITH DIAERESIS MULTIPLICATION SIGN O WITH STROKE U WITH GRAVE U WITH ACUTE U WITH CIRCUMFLEX U WITH DIAERESIS Y WITH ACUTE LETTER THORN SMALL LETTER SHARP S
2? !$!
2? '$
EW\R]ea
2 = A
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
BSWZ % d]\ &( 1]RS^]W\b ' !( C\WQ]RS 1> # 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
a WITH GRAVE a WITH ACUTE a WITH CIRCUMFLEX a WITH TILDE a WITH DIAERESIS a WITH RING ABOVE LETTER AE c WITH CEDILLA e WITH GRAVE e WITH ACUTE e WITH CIRCUMFLEX e WITH DIAERESIS i WITH GRAVE i WITH ACUTE i WITH CIRCUMFLEX i WITH DIAERESIS LETTER ETH n WITH TILDE o WITH GRAVE o WITH ACUTE o WITH CIRCUMFLEX o WITH TILDE o WITH DIAERESIS DIVISION SIGN o WITH STROKE u WITH GRAVE u WITH ACUTE u WITH CIRCUMFLEX u WITH DIAERESIS y WITH ACUTE LETTER THORN y WITH DIAERESIS
2? !$!
2? '$
EW\R]ea
2 = A
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
Ó ß Ô Ò õ Õ µ þ Þ Ú Û Ù ý Ý ¯ ´ ± Ĵ ¾ ¶ § ÷ ¸ ° ¨ · ¹ ³ ² Ŷ
BSWZ & d]\ &( 1]RS^]W\b " ##( C\WQ]RS 1> # c\R &' WRS\bWaQV 1> 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[[ S`eO`bSb ºPS` RWS >]`b<` # SW\ HSWQVS\ ROa USZSaS\ c\R RO\OQV O[ 1]\a]ZSPWZRaQVW`[ OcaUSUSPS\ eW`R 6WS` Wab ROa S\ba^`SQVS\RS AS\RS`^`] U`O[[ ?a^VaP\\ BcaTP\#P) 2[XT]c U¶a :^\\d]XZPcX^] ¶QTa C2?8?ETaQX]Sd]V import java.net.*; import java.io.*; class Stream04a { public static void main(String[] args) throws Exception { Socket s = new Socket("localhost",1500); DataOutputStream aus = new DataOutputStream(s.getOutputStream()); aus.write('A'); aus.close(); } } !'"
3 :^\_[TccQTXb_XT[ TX]Ta eTacTX[cT] 0__[XRPcX^]
7X]fTXbT id\ CTbcT] STa 0]fT]Sd]V)
3a eS`RS\ ifTX 2=A0]fS\ PS\rbWUb /QVbc\U( 2WSaS 2=A0]fS\ Rº`TS\ \WQVb ºPS` 8=3 USrTT\Sb eS`RS\ eSWZ RO\\ 3\dW`]\[S\bDO`WOPZS USÉ\RS`b eS`RS\ 3a Wab eWS T]ZUb d]`hcUSVS\( • • • •
AB/@Bj>`]U`O[[SjHcPSVr`j3W\UOPSOcTT]`RS`c\U heSW[OZ 2O\OQV XSeSWZa W\ RWS =`R\S` dS`heSWUS\ W\ RS\S\ RWS 1ZOaa2ObSWS\ abSVS\ 2O\\ hc\ÉQVab ROa AS`dS`^`]U`O[[ abO`bS\( YPeP BcaTP\# C\R XSbhb ROa 1ZWS\b^`]U`O[[ abO`bS\( YPeP BcaTP\#P
2Oa 3`USP\Wa RS` ec\RS`d]ZZS\ HcaO[[S\O`PSWb RWSaS` PSWRS\ >`]U`O[[S Wab ROaa OcT RS[ 1]\a]ZSPWZRaQVW`[ RSa AS`dS`^`]U`O[[a RS` 1]RS^]W\b RSa 0cQVabOPS\a / OcaUSUSPS\ eW`R ÎQd]V id\ ?a^VaP\\ BcaTP\# ÎQd]V ( Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa \WQVb RS` 1]RS^]W\b $# a]\RS`\ RS` 0cQVabOPS / d][ AS`dS`^`]U`O[[ OcaUSUSPS\ eW`R ^`W\bZ\RWPahOVZ) ÎQd]V !) Ò\RS`\ AWS RWS PSWRS\ 9][[c\WYObW]\a^`]U`O[[S a] OP ROaa \WQVb SW\ hSZ\S HSWQVS\ USaS\RSb c\R USZSaS\ eS`RS\ a]\RS`\ Y][^ZSbbS HSWQVS\YSbbS\ Ab`W\Ua [Wb RS\ ;SbV]RS\ e`WbSCB4 c\R `SORCB4 OcaUSbOcaQVb eS`RS\ ;»bd]Vbe^abRW[PV import java.net.*; import java.io.*; class Stream05 { public static void main(String[] args) throws Exception { ServerSocket ss = new ServerSocket(1500); Socket s = ss.accept(); DataInputStream ein = new DataInputStream(s.getInputStream()); String text = ein.readUTF(); System.out.println(text); } } import java.net.*; import java.io.*; class Stream05a { public static void main(String[] args) throws Exception { Socket s = new Socket("localhost",1500); DataOutputStream aus = new DataOutputStream(s.getOutputStream()); aus.writeUTF("Hallo"); aus.close(); } }
!'#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
4 6[^bbPa
+
-RUYYGX
0QbcaPZcX^] /ZZUS[SW\S D]`USVS\aeSWaS c[ 9][^ZSfWbÉb hc dS``W\US`\ 2OPSW eW`R dS`acQVb RWS Tº` SW\S PSabW[[bS /cTUOPS\abSZZc\U eWQVbWUS\ BSWZS hc S`YS\\S\ c\R ROa C\ eSaS\bZWQVS hc dS`\OQVZÉaaWUS\ EW`R W\ RS` >`]U`O[[WS`c\U h0 PSW[ 2SaWU\ d]\ 9ZOaaS\ SW\USaSbhb c[ RWS eSaS\bZWQVS\ ;S`Y[OZS SW\Sa 5SUS\abO\RSa ]RS` 0SU`WTTa VS`Ocahca]\RS`\ PRRTbb \^SXUXTa aWSVS ;]RWTWhWS` 0[V^aXcW\db 0SaQV`SWPc\U Tº` RWS :rac\U SW\Sa PSabW[[bS\ >`]PZS[a Y]\Y`SbS /\ZSWbc\U 6O\R Zc\Uad]`aQV`WTb) YO\\ RWS 4]`[ SW\Sa 1][^cbS`^`]U`O[[a VOPS\ 0VVaTVPcX^]
PSaQV`SWPb eWS SW\hSZ\S BSWZS dS`SW\WUb eS`RS\ hc SbeOa 5O\hS[ 7\ RS` ]PXSYb]`W S\bWS`bS\ >`]U`O[[WS`c\U RWS 0SaQV`SWPc\U eWS 9ZOaaS\ [WbSW\O\RS` dS`Pc\RS\ eS`RS\ \É[ZWQV W\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ab`cYb RS` /PZOcTabScS`c\U PSaQV`SWPb RWS DS`heSWUc\U W\\S`VOZP SW\Sa >`] U`O[[a OcTU`c\R d]\ 0SRW\Uc\US\ 7\ 8OdO `SOZWaWS`b Rc`QV XU c\R bfXcRW abObS[S\ba 1PRZb[PbW 2S` AZOaV RS` OcT RS[ @ºQYS\ ZWSUb OZa] @ºQYeÉ`baab`WQV J 7[ EW\R]eaRO bSWagabS[ hc` B`S\\c\U RS` =`R\S` SW\Sa >TORSa SW\USaSbhb 7\ 8OdO OcQV PS\cbhb Tº` RWS /\UOPS d]\ 3aQO^SAS_cS\hS\ aWSVS R]`b 1PbXbZ[PbbT aWSVS Ac^S`YZOaaS 1232^ST PW\O`g Q]RSR RSQW[OZ DS`aQVZºaaSZc\UdS`TOV`S\ Tº` HOVZS\ 2OPSW eW`R \WQVb ROa `SW\ PW\É`S HOVZS\agabS[ eWS h0 PSW RS[ X]cBg^ dS`eS\RSb a]\RS`\ RWS AbSZZS\eS`bWUYSWb RSa 2ShW[OZaga bS[a PSWPSVOZbS\ RO[Wb C\US\OcWUYSWbS\ Rc`QV RS\ ESQVaSZ RSa AbSZZS\eS`bagabS[a dS`[WSRS\ eS`RS\ 8SRS 2ShW[OZhWTTS` eW`R W\ " PWba SW\ 6OZPPgbS Q]RWS`b EW`R W\ 8OdO d]\ RS` 9ZOaaS 1XV8]cTVTa PS\cbhb c\R W\aPSa]\RS`S Tº` Y][[S`hWSZZS /\eS\ Rc\US\ SW\USaSbhb Q[P]Z a^OQS :SS`hSWQVS\ W[ C\WQ]RS Jc \WQVb hc dS`eSQVaSZ\ [Wb \cZZ) ROa eWQVbUabS EVWbSa^OQS1VO`OQbS` aWSVS R]`b !'%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
4 6[^bbPa
1^^[TbRWT 0[VTQaP
D]\ 0]]ZS &# &$" S\beWQYSZbS :]UWY RWS [Wb RS[ 2cOZhOVZS\agabS[ OZa 0OaWa OZUSP`OWaQVS =^S`ObW]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SYZO`ObW]\ `SaS`dWS`b YSW\S\ A^SWQVS`^ZObh Tº` SW\S 7\abO\h 3TbXV]?PccTa] aWSVS 3\bec`Ta[cabS` 3X\T]bX^]
4SabZSUc\U RS` 5`rzS SW\Sa /``Oga Rc`QV /\UOPS SW\Sa UO\hhOVZWUS\ ES`bSa 8OdO PSWa^WSZ( RS` ES`b # ZSUb TSab ROaa ROa /``Og Oca # 9][^]\S\bS\ PSabSVb c\R RO[Wb RS` HcU`WTT OcT RWS SW\hSZ\S\ 9][^]\S\bS\ RWSaSa /``Oga ºPS` RWS 7\RWQSa d]\ PWa " S`T]ZUb 4]RP_bd[PcX^] aWSVS 9O^aSZc\U 4]cfdaU 2SaWU\ >VOaS RS` A]TbeO`SS\beWQYZc\U W\ RS` Oca RS` U`]PS\ :SWabc\UaPSaQV`SWPc\U RWS bSQV\WaQVS AgabS[O`QVWbSYbc` S\beWQYSZb eW`R 4]cfdaUb\dbcTa 2SaW\U >ObbS`\ D]`aQVZÉUS Tº` RS\ 3\bec`T d]\ ]PXSYb]`WS\bS`bS\ A]TbeO`SagabS[S\ AWS aW\R SW\S /`b @ShS^b Tº` UcbSa c\R STTWhWS\bSa >`]U`O[[WS`S\ c\R PSaQV`SWPS\ SW\S US\S`OZW aWS`bS :rac\UaWRSS hc W[[S` eWSRS`YSV`S\RS\ 3\bec`Ta^`]PZS[S\ AWS aW\R ]Tb ROa 3`USP\Wa d]\ XOV`SZO\US` 3`TOV`c\U W\ Y][^ZSfS\ >`]XSYbS\ c\R PSaQV`SWPS\ PS eÉV`bS :rac\UaO\aÉbhS AWS S\bVOZbS\ OPS` YSW\S TS`bWU Q]RWS`bS\ :rac\US\ 4bRP_TBT`dT]i aWSVS AbScS`hSWQVS\ 4gRT_cX^] /ca\OV[SaWbcObW]\ PSW RS` /caTºV`c\U SW\Sa 8OdO>`]U`O[[a `c\bW[S``]` B`Wbb SW\S /ca\OV[S OcT a] eW`R SW\ =PXSYb USe]`TS\ RV d][ /\eS\Rc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