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\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 eS`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\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ZS` 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 /`P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RS\ YO\\ 5SabO`bSb eW`R RWS 3\beWQYZc\Uac[USPc\U [Wb(
START|PROGRAMME|Fantastic-Bits|JOE|JOE
3[^TSVZc\U( :SUS\ AWS SW\S DS`Y\º^Tc\U OcT RS[ 2SaYb]^ O\ ?a¶UT] ^Q 9>4 Z^aaTZc X]bcP[[XTac Xbc ÍPS` RS\ ;S\c^c\Yb Optionen|Einstellungen a]ZZbS ºPS`^`ºTb eS`RS\ ]P RWS >TORS hc[ 1][^WZS` c\R hc[ 7\bS`^`SbS` Y]``SYb SW\USb`OUS\ aW\R 3dS\bcSZZ [caa RWSa [O\cSZZ \OQVUSV]Zb eS`RS\ EOVZeSWaS YO\\ VWS` OcQV RS` HWSZ^TOR Tº` RWS /caUOPS RSa 1][^WZS`a SW\USb`OUS\ eS`RS\ 0][TVT] TX]Tb ]TdT] >aS]Tab U¶a SXT ÎQd]VbSPcTXT] 4º` ROa /`PSWbS\ [Wb RS\ 0SWa^WSZS\ W\ RWSaS[ 0cQV Wab Sa VWZT`SWQV eS\\ SW\ aS^O `ObSa DS`hSWQV\Wa O\USZSUb eW`R 2S`
Î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`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 0gbSQ]RS 3a UWPb >`]U`O[[WS`a^`OQVS\ h0 1 PSW RS\S\ ROa A]c`QS>`]U`O[[ W\ SW\ ;O aQVW\S\^`]U`O[[ c[USeO\RSZb eW`R 0SW RWSaS` C[eO\RZc\U eW`R SW\ OcaTºV`PO`Sa >`]U`O[[ Tº` SW\S US\Oc RSTW\WS`bS >ZObbT]`[ eSZQVS` >`]hSaa]` eSZQVSa 0Sb`WSPa agabS[ S`hScUb PSW SW\S[ ESQVaSZ RS` >ZObbT]`[ [caa \Sc Q][^WZWS`b eS`RS\ $
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
# 3Pb TabcT 9PeP?a^VaP\\ TabcT[[T] d\fP]ST[] d]S PdbU¶WaT]
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][^W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VOPS\ ?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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S`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 TgT2ObS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Oa^`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 @SW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]RS` 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\\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ESaS\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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OYcabWaQVS 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^]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\WQVb US\cbhb ;WQ`] a]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\bZW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TX]Tb ?a^VaP\\b eTafT]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\ /A177HSWQ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 RWS >ZObh\c[[S` & W[ C\WQ]RS 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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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 id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SaS\ ]RS` ºPS` RWS BOabObc` SW\ USUSPS\ eS`RS\ [ºaaS\ 2S[ 7\bS`^`SbS` [ºaaS\ RO\\ RWS >]aWbW]\ RS` 2ObS\ W[ /`PSWbaa^SWQVS` WV`S Ab`cYbc` RV RWS W\bS`\S 2O`abSZZc\U RS` 2ObS\ c\R WV`S DS` O`PSWbc\Ua[rUZWQVYSWbS\ PSYO\\b aSW\ C\R US\Oc ROTº` UWPb Sa RWS 2SYZO`ObW]\a O\eSWac\U W\ 8OdO 2c`QV RWS 2ObS\PSaQV`SWPc\U RSQZO`ObW]\ DS`SW\PO`c\U eW`R RS[ 1][^WZS` PS YO\\b US[OQVb eSZQVS 2ObS\ ROa >`]U`O[[ dS`O`PSWbSb eWS aWS OcTUSPOcb aW\R eSZQVS DS`O`PSWbc\Ua[rUZWQVYSWbS\ Sa Tº` aWS UWPb c\R eWS aWS `STS`S\hWS`b RV O R`SaaWS`b eS`RS\ 7\ 8OdO aWSVb RWS 2SYZO`ObW]\aO\eSWac\U UO\h OZZUS[SW\ eWS T]ZUb Oca(
0SWa^WSZ Tº` SW\S 2ObS\RSYZO`ObW]\(
String
text;
;Wb RWSaS` /\eSWac\U eW`R RS[ 1][^WZS` [WbUSbSWZb ROaa d][ 2ObS\bg^ BcaX]V SW\ =PXSYb PS\rbWUb eW`R ROa c\bS` RS[ 0ShSWQV\S` cTgc OR`SaaWS`b eS`RS\ YO\\ 2S` 0ShSWQV\S` cTgc eW`R OcQV OZa @STS`S\hdO`WOPZS PShSWQV\Sb RS\\ S` YO\\ SW\S @STS `S\h OcT SW\ PSabW[[bSa BcaX]V=PXSYb S\bVOZbS\ 2S` 2ObS\bg^ BcaX]V Wab W\ SW\S` [WbUSZWSTS`bS\ 9ZOaaS RS` AbO\RO`R0WPZW]bVSY SfOYb PSaQV`WSPS\ 2]`b abSVb e]`Oca RWSaS` 2ObS\bg^ PSabSVb SW\ BcaX]V Wab Oca SW\hSZ\S\ HSWQVS\ hcaO[[S\USaSbhb c\R eSZQVS DS`O`PSWbc\Ua[rUZWQVYSWbS\ RS[ >`]U`O[ [WS`S` hc` DS`TºUc\U abSVS\ h0 YO\\ [O\ BcaX]V OcaUSPS\ dS`UZSWQVS\ Y]^WS`S\ c\R Y]\YObS\WS`S\ OZa] heSW Ab`W\Ua hcaO[[S\TOaaS\ hc SW\S[ SW\hWUS\ cae 3W\S 0Sa]\RS`VSWb Wab ROaa PSW RS` 2SYZO`ObW]\ [SV`S`S 0ShSWQV\S` O\USUSPS\ eS` RS\ Yr\\S\ h0 double gehalt, stundenlohn, pension, rente; ;Wb RWSaS` 2SYZO`ObW]\ eS`RS\ dWS` 0ShSWQV\S` PSYO\\b US[OQVb ROPSW Wab RS` 2O bS\bg^ \c` SW\[OZ O\USUSPS\ 7\ RS` /cThÉVZc\U eS`RS\ RWS 0ShSWQV\S` eWS Tº` /cThÉVZc\US\ W\ 8OdO US\S`SZZ ºPZWQV Rc`QV 9][[O USb`S\\b 4º` XSRS RWSaS` dWS` DO`WOPZS\ UWZb ROaa RS` 2ObS\bg^ S^dQ[T Wab /ZZS`RW\Ua eW`R RWSaS AQV`SWPeSWaS \WQVb S[^T]VZS\ eSWZ RWS :SaPO`YSWb RSa ?cSZZbSfbSa RORc`QV ZSWRSb 2WS 2SYZO`ObW]\aO\eSWac\U YO\\ hcaÉbhZWQV SW\S 9ZOcaSZ hc[ 7\WbWOZWaWS`S\ S\bVOZbS\ 2WSaS 9ZOcaSZ RS` 7\WbWOZWhS` PSabSVb Oca RS[ HceSWac\Ua]^S`Ob]` + c\R SW\S[ /caR`cQY RS` RS\ /\TO\UaeS`b a^ShWTWhWS`b h0
int zahl = 4700;
""
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#!
FPb Xbc STa 3PcT]ch_.
=GYOYZJKX*GZKTZ_V%
8SRS DO`WOPZS VOb SW\S\ 2ObS\bg^ 7[ \OQVT]ZUS\RS\ >`]U`O[[ eW`R SW\S Ab`W\UdO`W OPZS SW\ =PXSYb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R RS` 0STSVZad]``Ob RWS ;S\US RS` [rUZWQVS\ =^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 DO`WOPZS RSYZO`WS`b Wab c\R ]P SW\ Y]``SYbS` 7\VOZb d]`VO\RS\ Wab A] [caa d]` RS` S`abS\ 0S\cbhc\U SW\ ^OaaS\RS` ES`b hcUSeWSaS\ aSW\ S\beSRS` Rc`QV SW\S 7\WbWOZWaWS`c\U ]RS` Rc`QV SW\S ES`bShceSWac\U "$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
#!
FPb Xbc STa 3PcT]ch_.
ÎQd]V ! id\ ?a^VaP\\ 3TZ[PaPcX^]! BSabS\ AWS ]P SW\S TSVZS`T`SWS C[eO\RZc\U [rUZWQV Wab eS\\ AWS RWS 7\WbWOZWaWS`c\U W\ RS` R`WbbS\ HSWZS S\bTS`\S\ Phe [Wb OZa 9][[S\bO` YS\\hSWQV\S\ 5PiXc) 2ObS\bg^S\ VOPS\ T]ZUS\RS /cTUOPS\( •
DS``W\US`c\U RS` >`]U`O[[WS`TSVZS` ;rUZWQVS 4SVZS` a]ZZbS\ S\bRSQYb eS`RS\ PSd]` SW\ >`]U`O[[ hc` DS`O`PSWbc\U O\ RWS 8D; ºPS`USPS\ eW`R /Za] a]ZZbS RS` 1][^WZS` PS`SWba dS`VW\RS`\ ROaa A^SWQVS`PS`SWQVS TOZaQV dS`eS\RSb eS` RS\
•
DS`[SWRc\U d]\ 4SVZS`\ eÉV`S\R RS` /caTºV`c\U eSWZ a^ÉbSabS\a RWS @c\ BW[SC[USPc\U RWS \]`[OZS 4]`bTºV`c\U SW\Sa >`]U`O[[a dS`VW\RS`\ eW`R eS\\ Tº` 2ObS\ \WQVb S`ZOcPbS =^S`ObW]\S\ OcTUS`cTS\ eS`RS\
•
>`]PZS[US`SQVbS /\^Oaac\U d]\ W\bS`\S\ =PXSYbS\ 2c`QV RWS 2SYZO`ObW]\ YO\\ SW\S =^bW[WS`c\U RS` W\bS`\S\ @S^`ÉaS\bObW]\ RS` 2ObS\ S`T]ZUS\
•
2WS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 RWS 9ZOaaS BcaX]V RWS 9ZOa aS 3PcT ]RS` RWS 9ZOaaS ?^X]c 2WS Ag\bOf Tº` RWS 2SYZO`ObW]\ d]\ @STS`S\hdO`WOPZS\ c\bS`aQVSWRSb aWQV \WQVb d]\ RS` 2SYZO`ObW]\ SW\S` ^`W[WbWdS\ DO`WOPZS\ 7\ PSWRS\ 4ÉZZS\ PSabSVb RWS 2SYZO`ObW]\ W\ RS` SW\TOQVabS\ 4]`[ Oca RS[ 2ObS\bg^ c\R RS[
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[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QV SW\S /R`SaaS OZa DS`eSWa OcT RWS SWUS\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\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DO`WOPZS PSYO\\b [OQVb c\R c\bS` 2STW\WbW]\ eW`R RO\\ \WQVb \c` RWS 2SYZO`ObW]\ a]\RS`\ OcQV RWS A^SWQVS`OZZ]YObW]\ Tº` RWS DO`WOPZS dS` abO\RS\ 8OdO c\bS`aQVSWRSb \WQVb heWaQVS\ RWSaS\ PSWRS\ 0SU`WTTS\ /cT RS\ \ÉQVabS\ ASWbS\ eW`R XSRS` 2ObS\bg^ RSbOWZZWS`b PSa^`]QVS\ 2WS 0SWa^WSZ^`] U`O[[S VOPS\ W[[S` RS\ UZSWQVS\ /cTPOc 2O[Wb AWS SW\ DS`abÉ\R\Wa Tº` RWS Ab`cY bc` c\R RWS eWQVbWUabS\ A^`OQVSZS[S\bS RWSaS` W[[S` UZSWQV OcTUSPOcbS\ >`]U`O[[S PSY][[S\ S`ZÉcbS`\ eW` hc\ÉQVab SW\ ;cabS`^`]U`O[[ ?a^VaP\\ Ch_T] ) 4X] ch_XbRWTb 43E?a^VaP\\ bXTWc X] 9PeP b^ Pdb)
import java.util.Scanner; public class Typen01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); int zahl; zahl = eingabe.nextInt(); zahl = zahl + 50; System.out.println("Ergebnis ist: " + zahl); } } 2Oa >`]U`O[[ VOb RWS bg^WaQVS Ab`cYbc` dWSZS` 32D>`]U`O[[S( 3W\UOPS DS`O`PSW 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` 2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SaS[ 0SWa^WSZ RWS T]ZUS\RS\ Tº\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]\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^S\
##! 3Ta 3PcT]ch_ X]c 2S` eWQVbWUabS 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 ))
##
B_TiXP[UP[[) ?aX\XcXeT 3PcT]ch_T]
*KX*GZKTZ_VINGX 2S` HSWQVS\bg^ RWPa Wab RS` SW\hWUS ^`W[WbWdS 2ObS\bg^ RS` [Wb SW\S` dS`SW\PO`bS\ 1]RWS`c\UabOPSZZS O`PSWbSb RV eÉV`S\R RWS 0WbY][PW\ObW]\S\ W\ RS\ dWS` 5O\hhOV ZS\bg^S\ OZa 2ShW[OZhOVZS\ W\bS`^`SbWS`b eS`RS\ eW`R RS` 7\VOZb SW\S` RWPa DO`WOPZS\ OZa SW\ SW\hSZ\Sa HSWQVS\ W\bS`^`SbWS`b 7\ 8OdO eW`R W\bS`\ Tº` XSRSa HSW QVS\ Oca RS[ C\WQ]RS RWS dS`SW\PO`bS >ZObh\c[[S` Q]RS^]W\b USa^SWQVS`b eS\\ RS` 2ObS\bg^ RWPa dS`SW\PO`b eW`R 7[ C\WQ]RS Wab Tº` XSRSa HSWQVS\ RWS 1]RWS`c\U TSabUSZSUb O\RS`a OZa PSW HOVZS\ e] \WQVb RWS HWTTS`\hSWQVS\ SW\hSZ\ dS`aQVZºaaSZb eS`RS\ a]\RS`\ e] RS` HOVZS\eS`b OZa 5O\hSa c[US`SQV\Sb eW`R W\ SW\S 2cOZhOVZ [Wb RS` AbSZZS\eS`bWUYSWb 4º` XSRSa HSWQVS\ eS`RS\ W\ 8OdO heSW 0gbSa PSZSUb D]`hSWQVS\ UWPb Sa PSW[ 2ObS\ bg^ RWPa \WQVb 2O[Wb ZWSUb RS` VSfORShW[OZS ES`bSPS`SWQV RSa 2ObS\bg^a RWPa heW aQVS\ Jc \WSR`WUabS` ES`b c\R Jc4444 VrQVabS` ES`b 2WS RW`SYbS 3W\UOPS SW\Sa C\WQ]RShSWQVS\a Wab ºPS` RWS BOabObc` BhbcT\X] \WQVb a] ]V\S eSWbS`Sa [rUZWQV RS\\ e] UWPb Sa BOabObc`S\ [Wb SW\WUS\ BOcaS\R C\WQ]RS hSWQVS\- 2SaVOZP VOPS\ 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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
# :[PbbT] d]S P]STaT Ch_T] QTbRWaTXQT] 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\
•
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O` É\RS`PO` Wab A][Wb PSabSVS\ SW\TOQVS 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]i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]Ta HSWQVS\YSbbS hc dS`PW\RS\ Y]\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\ XSR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;SbV]RS c^BcaX]V ?a^VaP\\ ?^X]c ) 8]bcP]i STa :[PbbT ?^X]c TaiTdVT] d]S PdbVTQT]
import java.awt.*; class Point01 { %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$"
ATUTaT]iePaXPQ[T]
public static void main(String[] args) { Point p; p = new Point(5,3); System.out.println(p.toString()); } } 2Oa >`]U`O[[ ?^X]c RSTW\WS`b RWS @STS`S\hdO`WOPZS ^ S`hScUb [Wb ]Tf SW\ =PXSYb d][ Bg^ ?^X]c [Wb RS\ ES`bS\ # c\R ! c\R `cTb O\aQVZWSzS\R RWS ;SbV]RS c^BcaX]V OcT RO[Wb RWS ES`bS ºPS` BhbcT\^dc OZa Ab`W\U O\UShSWUb eS`RS\
=KXZ`[]KOY[TMHKO8KLKXKT`Z_VKT ES\\ SW\S @STS`S\hdO`WOPZS dS`O`PSWbSb eS`RS\ a]ZZ [caa aWS OZa ES`b S\beSRS` ]d[[ S\bVOZbS\ eS\\ Tº` aWS \]QV YSW\ =PXSYb SfWabWS`b ]RS` SW\S @STS`S\h c[ SW\ =P XSYb hc S``SWQVS\ 2OPSW Yr\\S\ Rc`QVOca [SV`S`S @STS`S\hdO`WOPZS OcT ROaaSZPS =PXSYb dS`eSWaS\ ?a^VaP\\ ?^X]c!) IfTX ATUTaT]iT] PQTa ]da >QYTZc import java.awt.*; public class Point02 { public static void main(String[] args) { Point p1 = new Point(5,3); Point p2; p2 = p1; // Wertezuweisung System.out.println(p2.toString()); } } A] eWS ^`W[WbWdS\ DO`WOPZS\ SW\ ES`b hcUSeWSaS\ eS`RS\ YO\\ a] Wab RWSa OcQV Tº` @STS`S\hdO`WOPZS\ S`ZOcPb /ZZS`RW\Ua UWZb Tº` PSWRS DO`WOPZS\O`bS\( RWS ES`bS [ºaaS\ Y][^ObWPSZ aSW\ RV aWS [ºaaS\ hc RS[ 3[^TÉ\US` ^OaaS\ <WQVb S`ZOcPb h0 Wab RWS HceSWac\U SW\Sa ^`W[WbWdS\ Bg^a O\ SW\S\ @STS`S\hbg^ RS\\ RWSaS DO`WOPZS\ aW\R \WQVb idfTXbd]VbeTacaÊV[XRW 3W\S` @STS`S\hdO`WOPZS\ YO\\ \c` SW\ ES`b hc USeWSaS\ eS`RS\ RS` RS[ 9ZOaaS\bg^ S\ba^`WQVb [Wb RS[ aWS RSTW\WS`b e]`RS\ Wab ÎQd]V id\ ?a^VaP\\ ?^X]c! ÎQd]V ( ÍPS`ZSUS\ AWS hc\ÉQVab bVS]`SbWaQV RWS /caeW`Yc\U T]ZUS\RS` >`] U`O[[É\RS`c\U( ESWaS\ AWS RS` DO`WOPZS\ ^ c\[WbbSZPO` d]` RS[ /caUOPSPSTSVZ ]d[[ hc Rc`QV( p1 = null;" 9O\\ ^ b`]bhRS[ Y]``SYb OcaUSUSPS\ eS`RS\- ÍPS`^`ºTS\ AWS RWSa ^`OYbWaQV ÎQd]V !) DS`acQVS\ AWS RO\OQV RWS ES`bS RSa =PXSYba _ OcahcUSPS\ :rac\Ua VW\eSWa( 3a [ºaabS T]ZUS\RS 4SVZS`[SZRc\U Y][[S\( Exception in thread "main" java.lang.NullPointerException". %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
7[ >`]U`O[[ ?^X]c! ec`RS RS` ES`b d]\ _ RS` DO`WOPZS _! hcUSeWSaS\ 2O[Wb eO`S\ W[ /`PSWba^SWQVS` T]ZUS\RS >ZÉbhS PSZSUb ^
f + # g + !
^
/PP #( HeSW @STS`S\hdO`WOPZS\ OPS` \c` =PXSYb 0Sa]\RS`a eWQVbWU Wab RWS 3`YS\\b\Wa ROaa Rc`QV RWS HceSWac\U W[ >`]U`O[[ ?^X]c! \WQVb ROa =PXSYb RS[ 3[^TÉ\US` hcUSeWSaS\ eW`R a]\RS`\ ROaa ZSRWUZWQV RWS @STS`S\h OcT ROa =PXSYb Y]^WS`b c\R W\ RWS DO`WOPZS\ _! b`O\a^]`bWS`b e]`RS\ Wab 2Oa =PXSYb aSZPab Wab \c` SW\[OZ W[ /`PSWbaa^SWQVS` 2Oa \ÉQVabS >`]U`O[[ ?^X]c" PSeSWab RWSaS /caaOUS 2]`b eS`RS\ \É[ZWQV RWS PSWRS\ ES`bS d]\ f c\R g USÉ\RS`b RV XSbhb eW`R ROa =PXSYb aSZPab dS`É\RS`b ?a^VaP\\ ?^X]c") FTacTidfTXbd]V P] SPb >QYTZc bT[Qbc import java.awt.*; public class Point03 { public static void main(String[] args) { Point p1 = new Point(5,3); Point p2; p2 = p1; // Wertezuweisung p2.x = 3333; p2.y = 4444; System.out.println(p1.toString()); System.out.println(p2.toString()); } } 2WS /caUOPS Wab W\ PSWRS\ 4ÉZZS\ UZSWQV 2O[Wb eW`R RScbZWQV ROaa a]e]VZ _ OZa OcQV _! OcT ROaaSZPS =PXSYb `STS`S\hWS`S\ ÎQd]V id\ ?a^VaP\\ ?^X]c" 0WbbS USPS\ AWS [Wb RS` _aX]c[];SbV]RS RS\ gES`b RS` 7\abO\h ^ Oca :rac\Ua VW\eSWa( RWSaS DO`WOPZS YO\\ `STS`S\hWS`b eS`RS\ Rc`QV p1.y"
%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$"
ATUTaT]iePaXPQ[T]
=UJ[XIN[TZKXYINKOJKTYOINVXOSOZO\K[TJ8KLKXKT`\GXOGHRKT% 7\ SW\S[ 8OdO^`]U`O[[ Yr\\S\ DO`WOPZS\ SW\S\ ^`W[WbWdS\ 2ObS\bg^ ]RS` SW\S\ @S TS`S\hbg^ VOPS\ 2S[hcT]ZUS Yr\\S\ OcQV heSW /`bS\ d]\ DO`WOPZS\eS`bS\ c\bS` aQVWSRS\ eS`RS\( ^`W[WbWdS ES`bS c\R @STS`S\heS`bS E] ZWSUS\ RWS U`c\RaÉbhZWQVS\ C\bS`aQVWSRS heWaQVS\ RS\ @STS`S\hdO`WOPZS\ c\R SW\TOQVS\ DO`WOPZS\- •
>`W[WbWdS DO`WOPZS\ PSabSVS\ Oca US\Oc SW\S[ ES`b RWSaSa 2ObS\bg^a @STS`S\h DO`WOPZS\ Yr\\S\ OcT hcaO[[S\USaSbhbS =PXSYbS dS`eSWaS\ RWS Oca c\bS` aQVWSRZWQVS\ Bg^S\ hcaO[[S\USaSbhb aW\R
•
2WS Ag\bOf eWS aWS S`hScUb eS`RS\ Wab c\bS`aQVWSRZWQV( Tº` @STS`S\hdO`WOPZS\ PS\rbWUb [O\ ROa AQVZºaaSZe]`b ]Tf
•
/`b c\R C[TO\U RSa A^SWQVS`^ZObhSa Wab c\bS`aQVWSRZWQV( =PXSYbS PS\rbWUS\ hc aÉbhZWQV hc RS\ SWUS\bZWQVS\ 2ObS\ \]QV SW\S @STS`S\hdO`WOPZS RWS OcT RS\ HWSZeS`b dS`eSWab
•
2S` HSWb^c\Yb eO\\ RWS 5`rzS RSa /`PSWbaa^SWQVS`^ZObhSa Tº` RWSaS DO`WOPZS PS abW[[b eW`R Wab c\bS`aQVWSRZWQV( PSW SW\TOQVS\ 2ObS\bg^S\ YO\\ RWSa PS`SWba hc` C[eO\RZc\UahSWb Q][^WZSbW[S c\R PSW @STS`S\hbg^S\ S`ab hc` /caTºV`c\Ua hSWb `c\bW[S PSabW[[b eS`RS\
•
2S` HSWb^c\Yb eO\\ RS` A^SWQVS`^ZObh O\UST]`RS`b eW`R /ZZ]YWS`c\U Wab c\bS` aQVWSRZWQV( SW\TOQVS DO`WOPZS\ Yr\\S\ PS`SWba PSW[ :ORS\ RSa >`]U`O[[a W\ RS\ /`PSWbaa^SWQVS` RS\ O\UST]`RS`bS\ >ZObh PSZSUS\ @STS`S\hdO`WOPZS\ eS`RS\ \OQV 0SRO`T eÉV`S\R RS` >`]U`O[[OcaTºV`c\U Rg\O[WaQV [Wb RS[ AQVZºa aSZe]`b ]Tf S`hScUb
•
=Pe]VZ SW\S ES`bShceSWac\U Tº` PSWRS DO`WOPZS\bg^S\ [Wb RS[ 5ZSWQVVSWbahSW QVS\ + S`T]ZUS\ YO\\ Wab RWS EW`Yc\U aSV` c\bS`aQVWSRZWQV( PSW SW\TOQVS\ DO`W OPZS\ eW`R RS` ES`b aSZPab hcUSeWSaS\ PSW @STS`S\hbg^S\ eW`R RWS @STS`S\h OcT ROa =PXSYb hcUSeWSaS\
7\ a^ÉbS`S\ 9O^WbSZ\ eS`RS\ AWS fTXcTaT D]cTabRWXTST RWSaS` PSWRS\ DO`WOPZS\O` bS\ YS\\S\ZS`\S\ 2S` D]ZZabÉ\RWUYSWb VOZPS` eS`RS\ RWSaS PS`SWba VWS` OcTUSTºV`b( •
2WS Ag\bOf eWS aWS dS`O`PSWbSb eS`RS\ h0 dS`UZSWQVS\ hceSWaS\ Y]^WS`S\ cae Wab c\bS`aQVWSRZWQV 0SW @STS`S\hbg^S\ eS`RS\ \]`[OZS`eSWaS ;SbV]RS\ OcTUS`cTS\ PSW SW\TOQVS\ Bg^S\ eW`R [SWabS\a [Wb =^S`Ob]`S\ eWS /RRWbW]\ ]RS` * DS`UZSWQV USO`PSWbSb
•
2WS ÍPS`UOPS OZa >O`O[SbS` PSW[ /cT`cT d]\ ;SbV]RS\ c\bS`aQVSWRSb aWQV PSW =PXSYbS\ U`c\RZSUS\R d]\ RS` /`b eWS SW\TOQVS DO`WOPZS ºPS`USPS\ eS`RS\ 3a eW`R heO` W[[S` RS` ES`b RS` DO`WOPZS\ Y]^WS`b OPS` \c` PSW SW\TOQVS\ DO`WOP ZS\ Wab Sa RS` bObaÉQVZWQVS ES`b PSW =PXSYbS\ VO\RSZb Sa aWQV c[ RS\ ES`b RS` @STS`S\hdO`WOPZS\ OZa] c[ RWS /R`SaaS d]\ RS[ =PXSYb RS` Y]^WS`b c\R ºPS` USPS\ eW`R %!
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
$ A0< eTafP[cT]) EPaXPQ[T d]S >QYTZcT TaiTdVT]
1UTYZGTZKT
3TZ[PaPcX^] e^] :^]bcP]cT]
9]\abO\bS\ aW\R W\ 8OdO `]U`O[[WS`S` ZSRWUZWQV [rUZWQV RWSaS >ZÉbhS TX]\P[ hc TºZZS\ RO\OQV Wab SW \S Ò\RS`c\U \WQVb [SV` S`ZOcPb 9]\abO\bS\ PSabSVS\ Oca •
SW\S[
•
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 ))
$$
;XcTaP[T
•
EOV`VSWbaeS`bS aW\R d][ Bg^ Q^^[TP]
•
3W\hSZ\S HSWQVS\ W\ SW\TOQVS\ /\TºV`c\Uaab`WQVS\ /^]ab`]^V aW\R d][ Bg^ RWPa h0 P
•
HSWQVS\YSbbS\ [ºaaS\ W\ R]^^SZbS\ /\TºV`c\Uaab`WQVS\ R]cPZS _c]bSa abSVS\ aWS aW\R d][ Bg^ BcaX]V h0 7P\QdaV
7\ HceSWac\US\ [caa RS` 2ObS\bg^ RSa :WbS`OZa SdbZ O\ RS\ Bg^ RS` 3[^TÉ\US`dO`W OPZS\ O\US^Oaab eS`RS\ 2WSaS 9]\dS`bWS`c\U USaQVWSVb Ocb][ObWaQV a]ZO\US RWS PSWRS\ Bg^S\ Y][^ObWPSZ aW\R EW` Y][[S\ a^ÉbS` OcT ROa BVS[O Bg^c[eO\RZc\U c\R 1OabW\U hc`ºQY RSRWhWS`b eW`R Sa W\ 9O^WbSZ # PSVO\RSZb
/TZKMKX2OZKXGRK 5O\hhOVZWUS :WbS`OZS eS`RS\ OZa HWTTS`\T]ZUS ]V\S 6]QVY][[O USaQV`WSPS\ AWS eS`RS\ c\OPVÉ\UWU d]\ WV`S` 5`rzS W[[S` OZa 2ObS\bg^ X]c W\bS`^`SbWS`b 0SWa^WSZS(
% #
AbO\RO`R[ÉzWU eW`R O\US\][[S\ ROaa Sa aWQV c[ SW\S 2ShW[OZhOVZ VO\RSZb OZa] hc` 0OaWa /PS` ROa UWZb \WQVb W[[S` Sa UWPb OcQV AQV`SWPeSWaS\ Tº` UO\hhOVZWUS :WbS`OZS W\ O\RS`S\ AbSZZS\eS`bagabS[S\( •
3\bVÉZb RWS HOVZ SW\S TºV`S\RS
•
0SUW\\b RWS HOVZ [Wb RS\ HSWQVS\ f a] eW`R ROVW\bS` SW\S 6SfORShW[OZhOVZ OZa] hc` 0OaWa $ S`eO`bSb RWS RS\ 0W\É`eS`b RS` 2ShW[OZhOVZ `S^`ÉaS\bWS`b c\R Rc`QV 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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[O :WbS`OZS eW`R \OQV RS[ 0cQVabOPS\ 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\ d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aS 5S`ÉbS OZa HWSZ ]RS` ?cSZZS SW\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]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a dS`O`PSWbS\
2Oa \ÉQVabS 0SWa^WSZ^`]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]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12.2005 13:39:00 ))
%
BcaTP\:^]iT_c
?a^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
'XHKOZKTSOZJKX1RGYYK9IG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US ZSaS\ 2OPSW eW`R ROd]\ OcaUSUO\US\ ROaa RWSaS HSWZS T]ZUS\RS\ /cTPOc VOb( hc \ÉQVab eW`R SW\S PSZWSPWUS HSWQVS\T]ZUS Ab`W\U S`eO`bSb) PSS\RSb eW`R RWSaS` Ab`W\U PSW[ /cTb`SbS\ RSa B`S\\hSWQVS\a 0ZO\Y 2O\\ T]ZUb OZa \ÉQVabSa B]YS\ SW\S UO\hS HOVZ c\R ROa ZSbhbS B]YS\ W\ RWSaS` HSWZS [caa SW\S 5ZSWbY][[OhOVZ W\ eWaaS\ aQVOTbZWQVS` AQV`SWPeSWaS [Wb RS[ 0cQVabOPS\ T aSW\ ?a^VaP\\ BRP]]Ta ) 4X]VPQT e^] ch_XbXTacT] 3PcT] BcaX]V X]c d]S S^dQ[T import java.util.Scanner; public class Scanner01 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); String str = eingabe.next(); // Komplettes Wort lesen int zahl1 = eingabe.nextInt(); // Ganzzahl lesen double zahl2 = eingabe.nextDouble(); // E-Format z.B. 5e3 lesen System.out.printf("%s | %d | %f", str, zahl1,zahl2); } }
'#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
ÎQd]VT] id\ ?a^VaP\\ BRP]]Ta ÎQd]V ( 3W\S Y]``SYbS 3W\UOPShSWZS aWSVb SbeO a] Oca( aaaa 4700 5e3. 9r\\S\ RWS R`SW 2ObS\ OcQV W\ XSeSWZa SW\S` SWUS\S\ HSWZS abSVS\- ÎQd]V !( EOa ^OaaWS`b eS\\ TOZaQVS 2ObS\ W[ 3W\UOPSab`][ abSVS\-
,KNRKXHKNGTJR[TM[TJ6XL[TMKT 5S\S`SZZ eW`R ROa BVS[O 4SVZS`PSVO\RZc\U W\ RWSaS[ 0cQV \WQVb PSa^`]QVS\ RS\\ RWS >`]U`O[[WS`c\U d]\ @]cbW\S\ hc` 4SVZS`PSVO\RZc\U 3fQS^bW]\VO\RZW\U S` T]`RS`b W\ 8OdO SW\WUS bWSTS`USVS\RS 9S\\b\WaaS RS` =PXSYb]`WS\bWS`c\U C\R d]` OZ ZS[ eº`RS RWS 3W\TOQVVSWb RS` >`]U`O[[S Rc`QV RWS >`]U`O[[WS`c\U RS` 4SVZS`PS VO\RZc\U ZSWRS\ c\R RS[ 3W\abSWUS` RWS ÍPS`aWQVb S`aQVeS`S\ 2S\\]QV eS`RS\ eW` [Wb RS[ \OQVT]ZUS\RS\ >`]U`O[[ SW\S Yc`hS 3W\TºV`c\U W\ RWSaSa BVS[O USPS\ 2Oa >`]U`O[[ Cah2PcRW YPeP ZWSab d]\ RS` 1]\a]ZS ROa S`abS B]YS\ SW\ c\R ^`ºTb ]P RS` SW\USUSPS\S ES`b \c[S`WaQV Wab ES\\ \WQVb eW`R SW\S 4SVZS`[SZRc\U OcaUSUSPS\ O\RS`\TOZZa eW`R ]Y OcaUSUSPS\ ?a^VaP\\ Cah2PcRW ) ;TbT] \Xc 5^a\P[_a¶Ud]V PdU ]d\TaXbRW
import java.util.Scanner; public class TryCatch01 { public static void main(String[] args) { int zahl; Scanner eingabe = new Scanner(System.in); String str = eingabe.next(); // Erstes Wort lesen try { zahl = Integer.parseInt(str); // Konvertieren in Ganzzahl } catch (NumberFormatException e) { System.out.println("Es wurde keine Ganzzahl eingegeben"); System.exit(8); } System.out.println("Der eingegebene Text ist ok"); } }
2WS 0SVO\RZc\U d]\ 4SVZS`\ S`T]ZUb W\ 8OdO [Wb 6WZTS RS` cahRPcRW/\eSWac\U 7\ \S`VOZP RSa cah0Z]QY eS`RS\ RWS TSVZS`b`ÉQVbWUS\ /\eSWac\US\ OcaUSTºV`b c\R d]\ RS[ RPcRW0Z]QY eS`RS\ SdS\bcSZZ OcTUSb`SbS\S 4SVZS` PSVO\RSZb EW` VOPS\ W\ OZ ZS\ O\RS`S\ >`]U`O[[S\ W\ RWSaS[ 0cQV OcT RWSaS /`b RS` /ca\OV[SPSVO\RZc\U dS`hWQVbSb c\R VOPS\ Rc`QV RWS 9ZOcaSZ cWa^fb 4gRT_cX^] W[ 9]^T RS` ;SbV]RS TSabUSZSUb ROaa [rUZWQVS 4SVZS` d][ :OcThSWbAgabS[ c\R \WQVb W\RWdWRcSZZ PSVO\ RSZb eS`RS\ a]ZZS\
'$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
%!
BcP]SPaS4X]VPQT
ÎQd]V id\ ?a^VaP\\ Cah2PcRW Ò\RS`\ AWS ROa >`]U`O[[ a] ROaa OcT SW\S W\RWdWRcSZZS 4SVZS`PSVO\RZc\U dS`hWQVbSb eW`R BSabS\ AWS ROa >`]U`O[[ c\R PS]POQVbS\ AWS ROa AgabS[dS`VOZbS\ EOa ^Oa aWS`b eS\\ RS` 0SRWS\S` TOZaQVS 2ObS\ SW\bW^^b- ?a^VaP\\ BRP]]Ta") ;»bd]Vbe^abRW[PV U¶a ST] ETaiXRWc PdU X]SXeXSdT[[T 5TW[TaQTWP]S[d]V import java.util.Scanner; public class Scanner03 { public static void main(String[] args) throws Exception { int zahl; Scanner eingabe = new Scanner(System.in); String str = eingabe.next(); // Erstes Wort lesen zahl = Integer.parseInt(str); // Konvertieren in Ganzzahl System.out.println("Der eingegebene Text ist ok"); } }
2WS 4SVZS`PSVO\RZc\U VOb W\ RS` >`OfWa SW\S aSV` U`]zS 0SRScbc\U c\R RWS 3[^ TSVZc\U O\ RS\ >`]U`O[[WS`S` ZOcbSb( 8SRS` RS\YPO`S 4SVZS`TOZZ [caa d][ >`] U`O[[ W\RWdWRcSZZ PSVO\RSZb eS`RS\ [Wb cahRPcRW
eTJKXTJKY*KROSOZKXJKY(KMXKT`[TMY`KOINKTY`[S'[LZXKTTKTJKX(KMXOLLK 2WS 9ZOaaS BRP]]Ta PWSbSb RS[ >`]U`O[[WS`S` RWS ;rUZWQVYSWb RS\ 2SZW[WbS` B`S\\hSWQVS\ XS \OQV AWbcObW]\ hc É\RS`\ 2Oa B`S\\hSWQVS\ Tº` SW\hSZ\S B]YS\ YO\\ Rc`QV /cT`cT RS` ;SbV]RS dbT3T[X\XcTa USÉ\RS`b eS`RS\ ASV` VÉcTWU eS`RS\ RWS SW\hSZ\S\ 0SU`WTTS RS` 3W\UOPSRObS\ Rc`QV 9][[O OPUSb`S\\b c\R ROa T]ZUS\RS >`]U`O[[ hSWUb SW\S :rac\U Tº` RWSaS /cTUOPS\abSZZc\U ?a^VaP\\ BRP]]Ta #) Ó]STa] STb 1TVaT]id]VbiTXRWT]b import java.util.Scanner; public class Scanner04 { public static void main(String[] args) { Scanner eingabe = new Scanner(System.in); eingabe.useDelimiter(","); // Delimiter aendern String str = eingabe.next(); // Komplettes Wort lesen int zahl1 = eingabe.nextInt(); // Ganzzahl lesen double zahl2 = eingabe.nextDouble(); // E-Format z.B. 5e3 lesen System.out.printf("%s | %d | %f", str, zahl1,zahl2); } }
'%
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
0SWa^WSZ Tº` SW\S Y]``SYbS 3W\UOPShSWZS(
Javabuch,17,3e5,
2Oa ZSbhbS 9][[O W\ RS` 3W\UOPShSWZS Wab heW\US\R \]beS\RWU a]\ab eW`R RS` 3W\ UOPSd]`UO\U RSa ZSbhbS\ B]YS\ \WQVb PSS\RSb /czS`RS[ Rº`TS\ W\ RWSaS[ aSV` SW\TOQVS\ 0SWa^WSZ YSW\S :SS`hSWQVS\ heWaQVS\ RS\ B]YS\ abSVS\ `]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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b c\bS` aQVWSRZWQV W\bS`^`SbWS`b eS`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\ 2W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]`[Ob !
(( merker2.doc
Stand: 22.12.2005 13:39: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[[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\ :^]eTac"YPeP c\R eWS hc[ AQVZcaa
•
RWS dWS` /A177HSWQVS\ eWSRS` OZa RWS 2ShW[OZhOVZ W\bS`^`SbWS`b eS`RS\ RWS aWS c`a^`º\UZWQV RO`USabSZZb VOPS\ :^]eTac#YPeP
?a^VaP\\ :^]eTac ) 4abcT[[T] STa 0dbVP]VbSPcTX BcaTP\ cgc import java.io.*; public class Konvert01 { public static void main(String[] args) throws Exception { OutputStream aus = new FileOutputStream("Stream01.txt"); DataOutput ausgabe = new DataOutputStream(aus); ausgabe.writeInt(174); } } 2WS ;SbV]RS faXcT8]c Q]RWS`b RWS 2ShW[OZhOVZ %" OZa `SW\S PW\É`S HOVZ c\R aQV`SWPb aWS W\ RWS 2ObSW BcaTP\ cgc 7\ 8OdO aW\R X]cBg^S\ W[[S` " 0gbSa ZO\U RWSaS ! PWba VOPS\ RWS AbSZZS\eS`bWUYSWb RSa 0W\É`agabS[a /Za] VOb RWS 2ObSW T]Z US\RS\ 7\VOZb( PW\É`( VSfORShW[OZ OcaUSR`ºQYb(
00 00 00 AE #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
% 4X]VPQT d]S 0dbVPQT SdaRWU¶WaT] X^^_TaPcX^]
2WSaS` 7\VOZb YO\\ OcQV OZa SW\S 4]ZUS d]\ " SW\hSZ\S\ 0gbSa W\bS`^`SbWS`b eS`RS\ 2Oa ZSbhbS 0gbS S\bVÉZb f/3 VSfORShW[OZ /3 ROa Wab SW\ ES`b RS` XS\aSWba RS` /A 177AbO\RO`R1]RWS`c\U d]\ %4 ZWSUb C\R eW` eWaaS\( OZZS HSWQVS\ RWS ]PS`VOZP d]\ f%4 ZWSUS\ aW\R W\ /A177 \WQVb abO\RO`RWaWS`b 6WS` Wab S\baQVSWRS\R [Wb eSZ QVS[ 1VO`OQbS`aSb USO`PSWbSb eW`R /cT RS` ;AEW\R]ea>ZObbT]`[ eW`R PSW RS` 7\ abOZZObW]\ SW\ AbO\RO`R1VO`OQbS`aSb OPVÉ\UWU d][ :É\RS`aQVZºaaSZ TSabUSZSUb 2WSa Wab W\ ESabSc`]^O RS` 1VO`OQbS`aSb 1> # :SWRS` VOb RWS 2=A0]f c\bS` ;A EW\R]ea SW\S ROd]\ OPeSWQVS\RS 1]RWS`c\U \É[ZWQV 1>&# 7[ /\VO\U 1 aW\R PSWRS HSWQVS\Q]RWS`c\US\ hcaO[[S\ [Wb RS[ C\WQ]RS OcTUS TºV`b 4º` RWS VSfDS`aQVZºaaSZc\U /3 TW\RS\ eW` R]`b T]ZUS\RS HSWZS: Codepoint: UnicodeZeichen/Text: %" f/3 { @357AB3@32 A75<
CP-1252: ®
CP-850: «
7[ C\WQ]RS c\R W[ ;AEW\R]eaAbO\RO`R eW`R RS` 2ShW[OZeS`b %" OZa] OZa `S UWabS`SR `SUWab`WS`bSa HSWQVS\ W\bS`^`SbWS`b) W\ SW\S` 2=A0]f ROUSUS\ eW`R RS` R]^^SZbS >TSWZ OcaUSUSPS\ ÎQd]V id\ ?a^VaP\\ :^]eTac 0WbbS ºPS`^`ºTS\ AWS eWS RS` 7\VOZb RS` 2ObSW BcaTP\ cgc W\ • •
SW\S` 2=A0]f [Wb RS[ 2=A1][[O\R bg^S RObSW\O[S c\R eWS RS` 7\VOZb W\ SW\S[ 3RWb]` h0 ;A3RWb]` ]RS` ;AE]`R
O\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\ RO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SWS\ 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
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WUS` 0STSVZ a]\RS`\ BSWZ SW\S` /\eSWac\U 2WS ]PW US\ 0SWa^WSZOcaR`ºQYS Yr\\S\ S\beSRS` Rc`QV /\VÉ\US\ SW\Sa AS[WY]Z]\a hc SW\S` d]ZZabÉ\RWUS\ /\eSWac\U US[OQVb eS`RS\ ]RS` aWS Yr\\S\ W\\S`VOZP d]\ O\RS`S\ /\eSWac\US\ PS\cbhb eS`RS\ /cQV VWS`hc SW\WUS 0SWa^WSZS(
zahl = 25; System.out.println(a+ 5 / b); boolean b = a > 3;
HceSWac\UaO\eSWac\U /caR`cQY OZa ;SbV]RS\^O`O[SbS` /caR`cQY OZa BSWZ RS` HceSWac\U
3W\ /caR`cQY YO\\ ºPS`OZZ RO abSVS\ e] SW\ ES`b PS\rbWUb eW`R 3` YO\\ OcQV Oca \c` SW\S[ =^S`O\RS\ PSabSVS\ W[ SW\TOQVabS\ 4OZZ Oca SW\S` DO`WOPZS\ ]RS` Oca SW\S[ :WbS`OZ 2Oa Wab RSaeSUS\ eWQVbWU hc S`eÉV\S\ eSWZ ºPS`OZZ RO e] ZOcb Ag\ bOfPSaQV`SWPc\U SW\ /caR`cQY S`eO`bSb eW`R OcQV SW\S SW\hWUS DO`WOPZS ]RS` SW\ :W bS`OZ abSVS\ RO`T 2Oa 3`USP\Wa SW\Sa /caR`cQYa RS` \c` Oca SW\S` DO`WOPZS\ PSabSVb Wab OZa] RS` ES`b RWSaS` DO`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`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US [OQVb ROhc a^ÉbS` [SV` 0dbSa¶RZT \Xc =TQT]TUUTZc 7\ /ca\OV[STÉZZS\ YO\\ Sa aSW\ ROaa SW\ /caR`cQY \WQVb \c` SW\S\ \ScS\ ES`b S` [WbbSZb RS` RO\\ eSWbS` dS`O`PSWbSb eW`R a]\RS`\ ROaa UZSWQVhSWbWU OcQV RS` ES`b SW \Sa RS` =^S`O\RS\ W[ A^SWQVS` dS`É\RS`b eW`R h0 PSW[ 7\Y`S[S\b P* 2WSaS "
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
&
>_TaP]ST] d]S >_TaPc^aT]
/\eSWac\U S\bVÉZb RS\ /caR`cQY P 2WS EW`Yc\U RSa /caR`cQYa PSabSVb RO`W\ ROaa RS` ES`b RS` DO`WOPZS\ O c[ S`VrVb eW`R 5ZSWQVhSWbWU VOb S` RS\ <SPS\ST TSYb ROaa RWSaS` \Sc S`[WbbSZbS ES`b OcQV RS` DO`WOPZS\ O hcUSeWSaS\ eW`R 7\ a]Z QVS\ 4ÉZZS\ a^`WQVb [O\ d]\ SW\S[ /caR`cQY [Wb <SPS\STTSYb =Pe]VZ RS` 0SU`WTT <SPS\STTSYb W\ RS` 7\T]`[ObWY VÉcTWU dS`Pc\RS\ Wab [Wb RS` D]`abSZZc\U d]\ c\S` eº\aQVbS\ <SPS\eW`Yc\US\ PSW RS` DS`O`PSWbc\U d]\ DO`WOPZS\ Wab W\ RWSaS[ 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\ \]`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ObW]\ eW`R RWSaS` @SQVS\d]`UO\U hcS`ab OcaUSTºV`b PSd]` RO\\ ROa 3`USP\Wa W\ SW\S\ X]cBg^ Y]\dS`bWS`b eW`R ?a^VaP\\ 0dbSadRZ!) :[P\\Ta] eTaÊ]STa] SXT 0dbfTacd]VbaTXWT]U^[VT
class Ausdruck02 { public static void main(String[] args) { // int z1 = (int)1.23 * 100; // Zuerst 1.23 in int konvertieren int z1 = (int) (123 * 100); // Zuerst multiplizieren System.out.println(z1); } }
#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
& 0dbSa¶RZT eTabcTWT] Tg_aTbbX^]
'XOZNSKZOYINK5VKXGZUXKT
*OK-X[TJXKINKTGXZKT 3a UWPb Tº` RWS dWS` 5`c\R`SQVS\O`bS\ XSeSWZa SW\S\ =^S`Ob]`( 2WS =^S`O\RS\ [ºaaS\ \c[S`WaQVS Bg^S\ aSW\ Hc RS\ \c[S`WaQVS\ 2ObS\bg^S\ USVr`S\ OZZS ^`W [WbWdS\ Bg^S\ [Wb SW\S` /ca\OV[S( 0]]ZSO\Bg^S\ aW\R \WQVb \c[S`WaQV [Wb WV\S\ YO\\ [O\ \WQVb `SQV\S\ ?a^VaP\\ 0aXcW\TcXZ ) 1TXb_XT[ U¶a SXT eXTa 6ad]SaTRWT]PacT]
class Arithmetik01 { public static void main(String[] args) { float a = 25.7f; float b = 5f; short x = 212; int y = 148; System.out.println("x System.out.println("x System.out.println("x System.out.println("a
+ / /
y y y b
= = = =
" " " "
+ + + +
(x (x (x (a
+ / /
y)); y)); y)); b));
} } ÎQd]VT] id\ ?a^VaP\\ 0aXcW\TcXZ ÎQd]V ( AbO`bS\ AWS ROa >`]U`O[[ c\R ºPS`^`ºTS\ AWS RWS 3`USP\WaaS 7ab ROa ZSbhbS 3`USP\Wa Y]``SYb- EOV`aQVSW\ZWQV eW`R SW\ >`]U`O[[WS`O\TÉ\US` hcaO[[S\hcQYS\( 9r\\S\ 1][^cbS` \WQVb `SQV\S\- EW` eS`RS\ C`aOQVS c\R :rac\U RWSaSa >VÉ\] [S\a a^ÉbS` PSa^`SQVS\ ÎQd]V !) 0WbbS É\RS`\ AWS ROa >`]U`O[[ a] ROaa RWS dWS` DO`WOPZS\ O P f c\R g \SUObWdS 7\WbWOZeS`bS VOPS\ h0 ÍPS`^`ºTS\ AWS RWS 3`USP\WaaS <SPS\ RS\ dWS` 5`c\R`SQVS\O`bS\ UWPb Sa \]QV SW\S\ hcaÉbhZWQVS\ O`WbV[SbWaQVS\ =^S`Ob]`( >`]hS\bhSWQVS\ 2WSaS` eW`R OcQV ;]RcZ] ]RS` @Sab=^S`Ob]` US \O\\b ;O\ YO\\ RORc`QV RS\ @Sab SW\S` 2WdWaW]\ S`[WbbSZ\ 0SWa^WSZ( 2S` UO\hhOVZW US @Sab RS` 2WdWaW]\ # USbSWZb Rc`QV ! Wab ?a^VaP\\ 0aXcW\TcXZ!) 0]fT]Sd]V STb <^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 b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T]ZUS\RS\ 0SWa^WSZS\ RWaYcbWS`S\ Sa eS`RS\ TOZaQVS 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` ]RS` TOZaQV eOV` ]RS` TOZaQV eOV` ]RS` TOZaQV
2WS /caaOUS\Z]UWY S`abSZZb \c\ @SUSZ\ Tº` ROa 3`USP\Wa ROa RWS 0ZOQY 0]f ZWSTS`b OPVÉ\UWU d]\ RS\ 3W\UO\UaeS`b O c\R P 2OPSW Yr\\S\ RWS PSWRS\ EOV`VSWbaeS`bS RS` dWS` 3`USP\WaaS PSZWSPWU [WbSW\O\RS` hc SW\S` @SUSZ dS`Y\º^Tb eS`RS\ 2ORc`QV S`USPS\ aWQV " V]QV + $ 9][PW\ObW]\S\ U !
U "
U #
U $
U %
P
Q
U
U!
U"
U#
U$
U%
U&
U'
U(
U
U
0=3
G>A
>A
/PP % ( 2WS $ heSWabSZZWUS\ 4c\YbW]\S\ 0SWa^WSZS Tº` /\eS\Rc\US\ RWSaS` @SUSZ\( •
•
2WS W\ >`]U`O[[WS`a^`OQVS\ USP`ÉcQVZWQVabS\ DS`Y\º^Tc\Ua`SUSZ\ aW\R •
RWS D=3DS`PW\Rc\U 9]\Xc\YbW]\ ROa VSWzb ROa 5SaO[bS`USP\Wa Wab \c` RO\\ eOV` eS\\ a]e]VZ O OZa OcQV P eOV` aW\R c\R
•
RWS =23@DS`PW\Rc\U 2WaXc\YbW]\ ROa VSWzb ROa 5SaO[bS`USP\Wa Wab \c` RO\\ TOZaQV eS\\ a]e]VZ O OZa OcQV P TOZaQV aW\R 2WSaS =23@DS`PW\Rc\U eW`R OcQV TX]bRW[XTvT]STb >34A US\O\\b 2O`ºPS` VW\Oca UWPb Sa W\ 8OdO \]QV
•
RWS PdbbRW[XTvT]ST >34ADS`PW\Rc\U SfYZcaWdSa =23@ F=@ Phe S\beS RS`]RS` RWS \c` RO\\ eOV` Wab eS\\ SW\S RS` PSWRS\ /caaOUS\ OPS` \WQVb PSWRS UZSWQVhSWbWU eOV` Wab
1^^[TbRWT 0[VTQaP ;Wb 6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QVS Tº` ROa SW\aQVZWSzS\RS =23@
•
L Tº` ROa OcaaQVZWSzS\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.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hcTºV`S\
"$
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'T]KOY[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^VaP\\ ;^ZP[ ÎQd]V ( 0WbbS Y]``WUWS`S\ AWS RS\ 4SVZS` 6W\eSWaS hc` C`aOQVS aWSVS d]`VS`WUS\ /PaObh( 0Z]QYPWZRc\U c\R Z]YOZS DO`WOPZS\ ÎQd]V !) 9ZÉ`S\ AWS Rc`QV >`]U`O[[É\RS`c\U RWS 4`OUS ]P RS` DO`WOPZS\\O[S iPW[ OcQV W\\S`VOZP RSa 0Z]QYa h 0 W\ RS` _aX]c[];SbV]RS PS\cbhb eS`RS\ RO`T 2WS 3`YS\\b\Wa Oca RWSaS\ ÍPc\US\ Wab ROaa SW\ /\eSWac\UaPZ]QY RS\ 5ºZbWUYSWba PS`SWQV d]\ DO`WOPZS\ RSTW\WS`b 7ab SW\S DO`WOPZS W\ SW\S[ 0Z]QY RSTW\WS`b a] Wab aWS \c` R]`b UºZbWU AWS YO\\ OczS`VOZP RWSaSa 0Z]QYa \WQVb O\USa^`]QVS\ eS`RS\ ;O\ \S\\b RWSaS DO`WOPZS Z]YOZS DO`WOPZS 0Z]QYa Yr\\S\ PSZWSPWU USaQVOQVbSZb eS`RS\ /ZZS`RW\Ua [ºaaS\ W\\S`VOZP SW\S` ;S bV]RS RWS 0ShSWQV\S` RS` Z]YOZS\ DO`WOPZS\ SW\RScbWU aSW\ RV SW\ SW\[OZ RSYZO`WS` bS` 0ShSWQV\S` RO`T \WQVb \]QV SW\[OZ RSYZO`WS`b eS`RS\ OcQV \WQVb W\ SW\S[ C\bS` PZ]QY
9ZK[KXGT]KOY[TMKT ;Wb 6WZTS d]\ AbScS`O\eSWac\US\ YO\\ RS` >`]U`O[[WS`S` RS\ /PZOcT RSa >`] U`O[[a abScS`\ 3a UWPb AbScS`O\eSWac\US\ Tº` DS`heSWUc\US\ XU c\R bfXcRW c\R Tº` RWS AQVZSWTS\PWZRc\U U^a fWX[T S^ AWS aW\R SPS\TOZZa hcaO[[S\USaSbhbS /\ eSWac\US\ RS\\ aWS S\bVOZbS\ O\RS`S /\eSWac\US\ RWS RO\\ S\beSRS` aSZSYbWd UO` \WQVb eSWZ RWS 0SRW\Uc\U \WQVb S`TºZZb Wab ]RS` SW\[OZ Phe [SV`[OZa OcaUS TºV`b eS`RS\ eS\\ RWS ROTº` \]beS\RWUS 0SRW\Uc\U S`TºZZb Wab /ZZS\ AbScS`O\eSWac\US\ US[SW\aO[ Wab ROaa RS` eSWbS`S /PZOcT RSa >`]U`O[[a d]\ SW\S[ /caR`cQY USabScS`b eW`R RS` d][ Bg^ Q^^[TP] aSW\ [caa ?a^VaP\\ 0]fTXbd]V ) 1^^[TbRWTa 0dbSadRZ X\ XU1TUTW[ class Anweisung01 { public static void main(String[] args) { if (5 > 3) System.out.println("5 ist groesser als 3"); } }
"'
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
2S` 740STSVZ PSUW\\b [Wb RS[ AQVZºaaSZe]`b XU 2O\\ T]ZUb W\ `c\RS\ 9ZO[[S`\ SW\ /caR`cQY RS` OZa 3`USP\Wa SW\S\ P]]ZSaQVS\ ES`b ZWSTS`b XO ]RS` \SW\ 7[ 0SWa^WSZ S\bVÉZb RWS XU/\eSWac\U RO\OQV SW\S eSWbS`S /\eSWac\U \É[ZWQV RS\ /cT`cT SW\S` _aX]c[];SbV]RS 2WSaS` 0Z]QY eW`R \c` OcaUSTºV`b eS\\ RS` P]]ZSaQVS /caR`cQY cadT ZWSTS`b /cT XSRS\ 4OZZ Wab RS` USaO[bS 740STSVZ S`ab \OQV RS[ AS[WY]Z]\ PSS\ RSb 2Oa AS[WY]Z]\ aQVZWSzb VWS` ROa AbObS[S\b [Wb RS[ ;SbV]RS\OcT`cT OP Hc aO[[S\USaSbhbS /\eSWac\US\ W\ RWSaS[ 4OZZ OZa] ROa XUAbObS[S\b aSZPab eS`RS\ ]XRWc [Wb SW\S[ AS[WY]Z]\ OPUSaQVZ]aaS\ ?a^VaP\\ 0]fTXbd]V!) 0]fTXbd]VbQ[^RZ P]bcT[[T STa 4X]iT[P]fTXbd]V class Anweisung02 { public static void main(String[] args) { if (5 > 3) { System.out.println("Das Ergebnis der Prüefung ist: "); System.out.println("Fuenf ist groesser als 3"); } } } 7\ RS[ >`]U`O[[ 0]fTXbd]V! PSabSVb RS` 8OHeSWU RS` XU/\eSWac\U Oca [SV` OZa SW\S` /\eSWac\U 2SaeSUS\ [caa SW\ /\eSWac\UaPZ]QY USPWZRSb eS`RS\ RS` Rc`QV RWS USaQVeSWTbS\ 9ZO[[S`\ hcaO[[S\USVOZbS\ eW`R 2S` USaO[bS 740STSVZ Wab \OQV RWSaS[ 0Z]QY PSS\RSb 3a eW`R O[ 3\RS YSW\ AS[WY]Z]\ USaSbhb
=KXZK`[]KOY[TM
2c`QV SW\S ES`bShceSWac\U OaaWU\[S\b eW`R RS` 7\VOZb SW\S` DO`WOPZS\ dS`É\ RS`b aWS PSY][[b SW\S\ \ScS\ ES`b hcUSeWSaS\ 2S` =^S`Ob]` Tº` RWS HceSWac\U Wab ROa 5ZSWQVVSWbahSWQVS\ + ?a^VaP\\ IdfTXbd]V ) EPaXPQ[T] TX]T] ]TdT] FTac idfTXbT]
class Zuweisung01 { public static void main(String[] args) { int zahl = 15; // Initialisierung System.out.println("Vorher: " + zahl); zahl = 1; // Wertezuweisung System.out.println("Nachher: " + zahl); } } @SQVba d][ 5ZSWQVVSWbahSWQVS\ abSVb RS` AS\RS` ZW\Ya d][ 5ZSWQVVSWbahSWQVS\ abSVb RS` 3[^TÉ\US` 2S` AS\RS` Wab SW\ /caR`cQY OZa] SW\S DO`WOPZS 9]\abO\bS ]RS` SW\ ;SbV]RS\OcT`cT ]RS` SW\S PSZWSPWUS 9][PW\ObW]\ RO`Oca 2S` 3[^TÉ\US` YO\\ \c` Oca SW\S` DO`WOPZS\ PSabSVS\ RV d]` RS[ 5ZSWQVVSWbahSWQVS\ abSVb RS` #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'!
FTacTidfTXbd]V
7RS\bWTWS` RS` DO`WOPZS\ RWS RS\ \ScS\ ES`b RSa /caR`cQYa PSY][[b 2S` PWaVS`WUS ES`b RS` DO`WOPZS\ eW`R Z^\_[Tcc S`aSbhb Rc`QV RS\ SdOZcWS`bS\ ES`b RSa /caR`cQYa Hc` EWSRS`V]Zc\U \]QV SW\[OZ RS` 6W\eSWa( SW\ /caR`cQY PS`SQV\Sb TX]T] c\R \c` SW\S\ ES`b ?a^VaP\\ IdfTXbd]V!) 4X] 0dbSadRZbfTac fXaS TeP[dXTac d]S idVTfXTbT] class Zuweisung02 { public static void main(String[] args) { int zahl = 15; System.out.println("Vorher: " + zahl); zahl = (1 + 6) / 2; System.out.println("Nachher: " + zahl); } } 8SRS` /caR`cQY VOb OZa] \c` TX]T] ES`b 7[ 0SWa^WSZ IdfTXbd]V!YPeP Wab RWSaS` heSWTSZZ]a d][ 2ObS\bg^ X]c RS\\ OZZS =^S`O\RS\ RWSaSa AbObS[S\ba VOPS\ RS\aSZ PS\ Bg^ c\R Sa UWPb RSaeSUS\ OcQV YSW\S`ZSW /\^Oaac\Ua^`]PZS[S 2O[Wb Wab OcQV UZSWQVhSWbWU RS` 2ObS\bg^ RSa /caR`cQYa TSabUSZSUb 2WSaS` 2ObS\bg^ RSa AS\RS` /caR`cQYa [caa ºPS`SW\abW[[S\ [Wb RS[ 2ObS\bg^ RS` 3[^TÉ\US`dO`WOPZS\ EOa ^OaaWS`b OPS` eS\\ •
RS` 2ObS\bg^ RSa AS\RS`/caR`cQYa \WQVb ºPS`SW\abW[[b [Wb RS[ 2ObS\bg^ RS` S[^TO\US\RS\ DO`WOPZS\ ]RS`
•
RWS =^S`O\RS\ RSa /caR`cQYa c\bS`aQVWSRZWQVS 2ObS\bg^S\ VOPS\-
D]cTabRWXTS[XRWT 3PcT]ch_T] QTX BT]STa d]S 4\_UÊ]VTa 5S\S`SZZ YO\\ RS` 3[^TÉ\US` \c` 2ObS\ a^SWQVS`\ RWS [Wb aSW\S[ Bg^ ºPS`SW\ abW[[S\ 2SaeSUS\ eW`R RS` 2ObS\bg^ RSa /caR`cQYa O\ RS\ Bg^ RSa 3[^TÉ\US`a O\US^Oaab OZZS`RW\Ua \c` eS\\ RORc`QV \WQVb RWS 5STOV` PSabSVb ROaa 7\T]`[ObW] \S\ dS`Z]`S\ USVS\ W[^ZWhWbS Bg^c[eO\RZc\U /\RS`\TOZZa UWPb Sa 4SVZS` PSW RS` C[eO\RZc\U ?a^VaP\\ IdfTXbd]V") D\fP]S[d]VbUTW[Ta fTVT] UP[bRWTa IdfTXbd]V public class Zuweisung03 { public static void main(String args[]) { int zahl1 = 10; short zahl2 = 5; zahl2 = zahl1; zahl1 = zahl2; } } #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
2Oa >`]U`O[[ IdfTXbd]V"YPeP YO\\ \WQVb TSVZS`T`SW c[USeO\RSZb eS`RS\ eSWZ RWS S[^TO\US\RS DO`WOPZS iPW[! hc YZSW\ Wab Tº` SW\S\ X]cES`b ÎQd]V id\ ?a^VaP\\ IdfTXbd]V" 9]``WUWS`S\ AWS RS\ 4SVZS` W\RS[ AWS RS\ 2ObS\bg^ RS` S[^TO\US\RS\ DO`WOPZS\ É\RS`\ 3W\ \WQVb UO\h a] ]TTS\aWQVbZWQVS` 4SVZS` abSQYb W[ >`]U`O[[ IdfTXbd]V# ?a^VaP\\ IdfTXbd]V#) D\fP]S[d]VbUTW[Ta fTVT] UP[bRWTa IdfTXbd]V
public class Zuweisung04 { public static void main(String args[]) float s1 = 5.0; } }
{
ÎQd]V id\ ?a^VaP\\ IdfTXbd]V # 9]``WUWS`S\ AWS RS\ 4SVZS` W[ >`]U`O[[ IdfTXbd]V#YPeP 6W\eSWaS hc` :rac\U TW\RS\ AWS W[ 9O^WbSZ # PSW[ BVS[O 4Z]ObW\U^]W\b:WbS`OZS 2]`b Wab PSaQV`WSPS\ eWS SW\ :WbS`OZ d][ Bg^ U[^Pc Q]RWS`b eW`R D]cTabRWXTS[XRWT 3PcT]ch_T] X]]TaWP[Q TX]Tb 0dbSadRZb Bg^O\^Oaac\US\ aW\R OcQV \]beS\RWU eS\\ RWS =^S`O\RS\ W\\S`VOZP SW\Sa /ca R`cQYa c\bS`aQVWSRZWQVS Bg^S\ VOPS\ aWSVS VWS`hc OcQV 9O^WbSZ % 1TXb_XT[ IdfTXbd]V$) Ch_P]_Pbbd]V STa >_TaP]ST] X\ 0dbSadRZ
public class Zuweisung05 { public static void main(String args[]) { String str = "Bahnhofstr."; int nr = 125; System.out.println(str + nr); } } 0SW[ /cT`cT RS` ;SbV]RS _aX]c[] eS`RS\ heSW /`Uc[S\bS ºPS`USPS\ SW\ BcaX]V /`Uc[S\b c\R SW\ X]c/`Uc[S\b 2WS ES`bS [ºaaS\ UZSWQV\O[WU US[OQVb eS`RS\ RS\aSZPS\ Bg^ PSY][[S\ c\R RWSa USaQVWSVb Ocb][ObWaQV ]V\S Sf^ZWhWbS /\UOPS Rc`QV RS\ >`]U`O[[WS`S` eSWZ YSW\ 7\T]`[ObW]\adS`Zcab RORc`QV S\babSVb
@[YGSSKTMKYKZ`ZK@[]KOY[TMYUVKXGZUXKT <SPS\ RS[ PWaVS` PSa^`]QVS\S\ 5ZSWQVVSWbahSWQVS\ + OZa =^S`Ob]` Tº` RWS ES`bS hceSWac\U UWPb Sa W\ 8OdO hcaO[[S\USaSbhbS HceSWac\Ua]^S`Ob]`S\ AWS eS`RS\ W\ T]ZUS\RS` 4]`[ dS`eS\RSb( #
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'!
FTacTidfTXbd]V
empfänger
operator=
sendeausdruck)
2Oa 5ZSWQVVSWbahSWQVS\ eW`R OZa] Y][PW\WS`b [Wb SW\S[ eSWbS`S\ =^S`Ob]` h0 SW \S[ @SQVS\ ]RS` SW\S[ DS`UZSWQVa]^S`Ob]` HeWaQVS\ =^S`Ob]` c\R RS[ 5ZSWQV VSWbahSWQVS\ RO`T YSW\ :SS`hSWQVS\ abSVS\ 0SWa^WSZ( zahl
+= 5;
2WS 0SRScbc\U RWSaSa /caR`cQYa Wab É_cWdOZS\b hc( zahl = zahl + 5; ?a^VaP\\ IdfTXbd]V%) :^\QX]XTacT IdfTXbd]Vb^_TaPc^aT]
public class Zuweisung06 { public static void main(String args[]) { int x = 1; int y = 10; x += 13; // x = x + 13; System.out.println(x); y *= y + 5; // y = y * (y + 5); System.out.println(y); } } =Pe]VZ ROa /`PSWbS\ [Wb RWSaS\ Y][PW\WS`bS\ =^S`Ob]`S\ hc SW\S` dS`Yº`hbS\ AQV`SWPeSWaS TºV`b eW`R RS` 3W\aObh \WQVb S[^T]VZS\ eSWZ RWS :SaPO`YSWb RO`c\bS` ZSWRSb 2WSa RS[]\ab`WS`b PSa]\RS`a RWS d]`ZSbhbS HSWZS RSa >`]U`O[[a IdfTX bd]V%YPeP
3KNXKXK5VKXGTJKTGRY+SVLoTMKXJKX@[]KOY[TM 3W\S eSWbS`S DO`WO\bS RSa HceSWac\Ua]^S`Ob]`a S`ZOcPb ROa /`PSWbS\ [Wb [SV`S`S\ 3[^TÉ\US`=^S`O\RS\ ?a^VaP\\ IdfTXbd]V&)
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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RW[¶bbT[f»acTa
DS`heSWUc\U ASZSYbW]\
WTSZaS aeWbQVQOaS
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\ PWSb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) CTgc e^] BhbcT\X] [TbT] d]S eTaPaQTXcT] import java.io.*; public class Next01 { public static void main (String[] args) throws Exception { BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); String str = " "; while (str != null) { System.out.println("Bitte Text eingeben: "); str = in.readLine(); System.out.println("Verarbeitet wird; " + str); } System.out.println("Programmende"); } } &"
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
'&
;»bd]Vb\dbcTa U¶a BRW[TXUT]
2Oa >`]U`O[[ a]ZZ BSfb d][ 0WZRaQVW`[ ZSaS\ c\R OZa 3QV] eWSRS` OcaUSPS\ 2WS :SaSaQVZSWTS eW`R PSS\RSb eS\\ RWS 3W\UOPS d][ 0SRWS\S` ]d[[ Wab eS\\ OZa] YSW \S 2ObS\ USZSaS\ e]`RS\ aW\R 2WSa Wab RO\\ RS` 4OZZ eS\\ ROa >`]U`O[[ PSS\RSb eW`R ]V\S 2ObS\SW\UOPS c\bS` ;AEW\R]ea Rc`QV 1B@:1 ÎQd]V id\ ?a^VaP\\ =Tgc 0WbbS bSabS\ AWS ROa >`]U`O[[ Rc`QV 3W\UOPS SW\WUS` HSWZS\ 0SS\RS\ AWS RO\\ ROa >`]U`O[[ c\R abO`bS\ AWS Sa \Sc 5SPS\ AWS RWSa[OZ UO` \WQVba SW\ a]\RS`\ PSS\RS\ AWS Sa a]T]`b EW`R RWS 3W\UOPS ]d[[ dS`O`PSWbSb- EWS dS`VÉZb aWQV ROa >`]U`O[[ eS\\ RWS DO`WOPZS bca [Wb ]d[[ W\WbWOZWaWS`b eW`R- 2WS :rac\U W[ >`]U`O[[ =Tgc YPeP Wab \WQVb PST`WSRWUS\R eSWZ RWS EWSRS`V] Zc\UaPSRW\Uc\U bca , ]d[[ PSW[ S`abS\ 2c`QVZOcT OPUST`OUb eW`R ]Pe]VZ aWS S`ab a^ÉbS` USaSbhb eW`R Rc`QV ROa :SaS\ 4º` RWSaSa W[[S` eWSRS`YSV`S\RS >`]PZS[ ROaa SW\S /PT`OUS RS` 0SRW\Uc\U PSW[ S`abS\ 2c`QVZOcT \]QV \WQVb [rUZWQV Wab eSWZ RWS D]`OcaaSbhc\U TSVZb UWPb Sa dS` aQVWSRS\S :rac\UadO`WO\bS\ ?a^VaP\\ =Tgc!) 4abcTa ;»bd]Vbe^abRW[PV TX]T 4]S[^bbRW[TXUT import java.io.*; public class Next02 { public static void main (String[] args) throws Exception { BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); String str = " "; while (true) { System.out.println("Bitte Text eingeben: "); str = in.readLine(); if (str == null) break; System.out.println("Verarbeitet wird: " + str); } System.out.println("Programmende"); } } 2WS :rac\U Tc\YbW]\WS`b Ucb R]QV eW`R aWS RORc`QV ZSWQVb c\ºPS`aWQVbZWQV eSWZ \WQVb S`YS\\PO` Wab ROaa RWS 3\RZ]aaQVZSWTS \c` d]`USbÉcaQVb Wab eSWZ Sa aSV` e]VZ SW\S YZO` hc T]`[cZWS`S\RS 0SRW\Uc\U Tº` RWS 3\baQVSWRc\U ºPS` ROa AQVZSWTS\S\RS UWPb 2S` ?cSZZbSfb a]ZZ ROa OcaR`ºQYS\ eOa RS` >`]U`O[[WS`S` PSOPaWQVbWUb 2WSaSa HWSZ eW`R VWS` \WQVb S``SWQVb
&#
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
' 0]fTXbd]VT] Z^SXTaT] bcPcT\T]cb
?a^VaP\\ =Tgc") IfTXcTa ;»bd]Vbe^abRW[PV ?a^QT[TbT] e^a ST\ TabcT] BRW[TXUT]SdaRW[PdU
import java.io.*; public class Next03 { public static void main (String[] args) throws Exception { BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); System.out.println("Bitte Text eingeben: "); String str = in.readLine(); while (str != null) { System.out.println("Verarbeitet wird: " + str); System.out.println("Bitte Text eingeben: "); str = in.readLine(); } System.out.println("Programmende"); } } 2WSaSa >`]U`O[[ O`PSWbSb `WQVbWU 2S` /cTPOc Wab Z]UWaQV c\R dS`abÉ\RZWQV /ZZS`RW\Ua VOb Sa RS\
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_)YPePb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\ 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 S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a]\RS`a Ucb USSWU\Sb Wab)
•
ZS`\S\ eSZQVS 3\bec`Taa^`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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`OYbS\ =^S`ObW]\S\ S`abSZZb RS` RO\\ \OQV c\R \OQV OPaQV\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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c\U OPUSaQVZ]aaS\S >`]U`O[[PZrQYS RWS SW\S Tc\YbW]\O ZS 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]`bU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b 5SZR 5SZR Wab Y\O^^ OZa]( 6WS` aW\R HWSZY]\TZWYbS OcThcZraS\ <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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hS\ c\R RWS /\be]`bhSWb US`W\U hc VOZbS\ ;O\ PShSWQV\Sb RWSa 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 RWSa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US\( OcT 1ZWS\b d]S AS`dS`agabS[S\ Tº` A^WS ZS ]RS` C\bS`\SV[S\aO\eS\Rc\US\ Tº` 6O\Rga c\R >2/a Tº` U`OTWaQVS =PS` TZÉQVS\ c\R Tº` 2ObS\PO\Y c\R F;:/\eS\Rc\US\ 2WSaS 3W\VSWbZWQVYSWb dS` SW\TOQVb \Obº`ZWQV \WQVb \c` RWS /caPWZRc\U RS` ;WbO`PSWbS` a]\RS`\ d]` OZZS[ OcQV RWS EO`bc\U RS` >`]U`O[[S %
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
( B^UcfPaTbhbcT\T T]cfXRZT[] ?a^YTZcT aTP[XbXTaT]
•
7[ 0S`SWQV RS` 7\bS`\Sb/\eS\Rc\U c\R RS` 7\bS`\ObW]\OZWaWS`c\U d]\ /^^ZWYO bW]\S\ PWSbSb 8OdO PSabS D]`OcaaSbhc\US\( 2WS >`]U`O[[S aW\R c\WdS`aSZZ SW\ aSbhPO`( Rc`QV AbO\RO`RWaWS`c\U RS` SW\USPOcbS\ 2ObS\bg^S\ Rc`QV RWS DS` eS\Rc\U RSa C\WQ]RSa c\R d]` OZZS[ Rc`QV RWS ;rUZWQVYSWbS\ RS` :]YOZWaWS `c\U RV Rc`QV RWS /\^Oaac\U O\ `SUW]\OZS ]RS` ZÉ\RS`a^ShWTWaQVS 0Sa]\RS` VSWbS\ 0SWa^WSZ Tº` S\UZWaQVS c\R RScbaQVS EÉV`c\UaOcTPS`SWbc\U( import java.util.*; import java.text.*; class Locale01 { public static void main(String[] args) { // Default-Locale (wenn nicht deutsch, dann bitte angegeben) NumberFormat nf1 = NumberFormat.getInstance(); System.out.println(nf1.format(1245.23)); // Englisches Format NumberFormat nf2 = NumberFormat.getInstance(Locale.ENGLISH); System.out.println(nf2.format(1245.23)); } }
•
8OdO >`]U`O[[S aW\R aWQVS` Rc`QV dWSZTÉZbWUS SW\USPOcbS ASQc`Wbg;SQVO\Wa[S\
7\ RS` >`OfWa VOPS\ aWQ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W\Uc\U S`TºZZb Wab 3^BRW[TXUT \WQVbOPeSWaS\RS AQVZSWTS( 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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QV`WSPS\S\ /ZU]`WbV[ca W\ 8OdO ;»bd]Vbe^abRW[PV)
public class Kaefer01 { public static void main(String[] args) throws Exception { for (int spinne=1; 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` P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PSZZS\ PSabSVb RO`W\ ROaa RWS C[aSbhc\U SW\S` a]ZQVS\ BOPSZZS 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`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ZOaaS\PSaQV`SWPc\US\ d]` ZWSUS\ [ºaaS\ 7[ T]ZUS\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\ Oc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S\ eWS 8OdO eS`RS\ ;SbV]RS\ \]`[OZS`eSWaS W[[S` OcTUS`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 9Z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 9ZOaaS\ OZ^VOPSbWaQV a]`bWS`b O\ UShSWUb 2O`ºPS` VW\Oca PWSbS\ RWS 0`]eaS` ºPS` 03/@037B3<jA37B3 2C@16AC 163< RS\ UShWSZbS\ 2W`SYbhcU`WTT OcT SW\S UO\h PSabW[[bS 9ZOaaS 8SRS SW\hSZ\S 9ZOaaS eW`R R]Yc[S\bWS`b [Wb WV`S[ d]ZZS\ OYSbhcUSVr`WUYSWb WV`S` 3W\]`R\c\U W\ RWS DS`S`Pc\UaVWS`O`QVWS c\R [Wb OZZS\ 3ZS[S\bS\ RWS RWSaS 9ZOaaS S\bVÉZb
(( merker2.doc
Stand: 22.12.2005 13:39:00 ))
! <XcVT[XTUTacT
'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\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W]\ 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 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RS\ 0SWa^WSZ(
/PP ( >O`O[SbS`ºPS`UOPS PSW[ /cT`cT RSa >`]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\_^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W\Ua USa^SWQVS`b e]PSW RS` S`abS Ab`W\U RS\ AcQVPSU`WTT AQVZº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[VZ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W\S \WQVbOcaTºV`PO`S 9ZOaaS [Wb \ScS\ ;SbV]RS\ S`abSZZb 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`