Problem mit Eclipse (throws java.io.I0Exception will nicht)

Status
Nicht offen für weitere Antworten.
D

Daniel Koch

Gast
Guten Tag alle miteinander,

ich versuche grade Java anhand des Buches "Java - Programmieren von Anfang an"von Helmut Erlenkötter zu erlernen
bin aber auf ein Problem gestoßen.


Ich mache meine Beispielprogramme aus dem Buch mit Eclipse und nun bin ich bei folgendem Code den ich aus dem Buch abgeschrieben habe:

Code:
public class Sternchen {

	public static void main(String[] args) {
		throws java.io.I0Exception{
			int summe = 0, eingabe = 0;
			System.out.print("\nZifferntaste druecken >");
			eingabe = System.in.read();
			eingabe = Character.digit((char)eingabe,10);
			while(eingabe > 0) {
				System.out.print(eingabe+" + ");
				summe = summe + eingabe--;
			}
		System.out.print(eingabe+" = "+summe);
		
		}
}
}

auf das Problem gestoßen, dass er die throws java... etc Zeile nicht annehmen will ... ich habe leider keine Ahnung woran das liegen könnte, ich habe es einwandfrei vom Buch abgeschrieben. : /
Die Suchmaschine hat mir leider auch kein Ergebnis liefern könne.
Bei dem throws erwartet er scheinbar ein "throw" und bei dem I0Exception will er irgendwo ein Semikodon haben wovon allerdings im Buch nix steht..

Hier ein Screenshot von der Fehleranzeige:

http://img351.imageshack.us/my.php?image=eclipsegh3.jpg


Liegt es vielleicht an Eclipse?

Danke im Vorraus für die Beschäftigung mit meinem Problem. :) Wie gesagt... mit der Suchfunktion konnte ich leider nichts erreichen.

mfg

Daniel Koch
[/code]
 
R

Roar

Gast
erstmal muss es throws heißen.
außerdem hast du vor dem throws IOException eine '{', die du sogar auch noch am ende schileßt.
 
D

Daniel Koch

Gast
Wie gesagt, das ist 1zu1 aus dem Buch abgeschrieben.
Könntest du mir eventuell mal den code richtig stellen?

mache ich aus dem throw ein throws und entferne die Klammern so wird beim throw zwar kein fehler mehr angezeigt aber erwartet noch das ';' bei dem I0Exception .. setze ich das dann dahinter so ist das mit dem Exception so ist das zwar richtig aber dann ist das throws wieder falsch und er erwartet dort ein throw... änder ich das dann wieder in throw so ist wieder das exception falsch... ein absoluter Teufelskreis.

Ich würd ja gerne ohne Eclipse arbeiten, aber das mit Suchpfaden etc find ich dermaßen verwirrend ... ich bekomm das ohne IDE nicht hin. :(
 

Xandro

Bekanntes Mitglied
Code:
public class Sternchen {

   public static void main(String[] args) throws java.io.I0Exception {
         int summe = 0, eingabe = 0;
         System.out.print("\nZifferntaste druecken >");
         eingabe = System.in.read();
         eingabe = Character.digit((char)eingabe,10);
         while(eingabe > 0) {
            System.out.print(eingabe+" + ");
            summe = summe + eingabe--;
         }
         System.out.print(eingabe+" = "+summe);
   }
}

So müsste es korrekt laufen.
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
U Problem mit Eclipse - WindowBuilder - memoryLeak? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 15
B Eclipse Problem mit jar Datei? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
Splayfer Problem mit der Eclipse Autovervollständigung... IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
R Eclipse Cursor Problem bei Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
V Eclipse:Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
P Eclipse Luna SR2 (4.4.2)- Problem bei hinzufügen von Software IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P Eclipse Eclipse-Problem unter Debian IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
E Eclipse Eclipse building workspace Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
V Eclipse Eclipse Problem beim erstellen einer JAR IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M Eclipse Problem mit Mac und Windows IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
B Eclipse SVN Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
B Eclipse Eclipse Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
P Eclipse Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 14
S Problem mit javacc-Plugin für Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
V Eclipse Galileo und Visual Editor Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 20
G Schon mal dieses Problem bei Eclipse gehabt? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
A Eclipse 3.4 Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
G Eclipse unter Ubuntu --- Problem mit deutschen Buchstaben IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
G eclipse problem beim ausführen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
Y Eclipse 3.3 Problem mit Subversive(SVN) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P Eclipse u. CVS - Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
F Problem mit eclipse formatter, javadoc und generics. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
der JoJo [eclipse]Kommunikations Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
B eclipse problem beim öffnen einer datei absturz IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
N Problem mit Integer.parseInt bei Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
V Problem mit Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
C Problem mit eclipse 3.2.1 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
T Eclipse 3.2 mag mich net (import problem) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
A Eclipse 3.1.2 Refresh Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
O Eclipse Linux Start Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
T Problem mit Eclipse .deployable- Aktualisierung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P Problem mit dem Visual Editor in Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
M Eclipse content assist PROBLEM IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
Icewind Problem mit Eclipse 3.1 und kompillierung für java 1.4 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
C Problem mit Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
R screenhandling-problem unter eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
DaRolla Problem: Eclipse Plugins IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
Wildcard Eclipse Problem bei Hot Code Replace IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
Y Eclipse 3.0 Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
I Eclipse: Debugging-Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
N Debugging-Problem mit Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
C Eclipse: Problem mit Slime unter Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
H Problem mit dem Debugger von Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
MamaMia44 Ich habe problem mit Intelej Idea IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
K Java Editor Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
Robertop Eclipse EXE Icon fehlt im Explorer (Windows Problem?) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
B Problem bei der Ausgabe IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
melaniemueller Eclipse Problem mit dem Debugger IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
S Problem mit BlueJ IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
1 Problem beim JavaFX installieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 20
D Jenkins/Gradle maven-publish Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
F Eclipse Problem mit Aufhänger bei verschiedenen Prozessen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
H Selenium Problem mit Browsern IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
P Problem accessing /rap. Reason: ProxyServlet: /rap IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
Tarrew Problem mit Maven und der Erkennung von generierten Antlr Files. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
F Egit-Problem nach Merge-Konflikt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
Y GIT remote Problem keine Synchronisation IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
N NetBeans Javadoc Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M NetBeans und UTF8 Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
fLooojava Eclipse Problem mit Template proposals IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
M NetBeans Problem mit eMail Programm IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 11
R Eclipse Problem beim Export als Executable Jar IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
S Problem mit Git IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M Eclipse JavaEE IDE Problem mit Servlets IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M Eclipse Problem beim Projektimport mit user libraries IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
T Eclipse 'refreshing external folders' has encountered a problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
H NetBeans Export Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
A gdal problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
D Eclipse Autocomplete Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M IDEA IntelliJ Subversion connection problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
F Eclipse Problem mit CVS Server IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
A Eclipse Matisse Problem ComboBoxen in real länger als in Vorschau IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
B Eclipse Subversive + Helios Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
N Subclipse Problem: Blaues Rechteck! IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
U Problem mit Buttons beim Panel-Zeichnen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
T NetBeans Maven2 + IDE Variables + NB Actions: Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
E Problem beim Ausführen von RCP GUI Tests mit Hudson IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
U Problem unter Netbeans 6.8 bei Farben IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
M Problem mit JSP IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
F CVS Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
Landei JDeveloper-Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
J NetBeans IDE 6.0.1 Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
F Datenpfad problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
V Problem mit einbinden externer Bibliotheken [NetBeans] IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
G NetBeans RCP Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
W Ganymed - Encoding-Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
B ACHTUNG! Netbeans Update -Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
D problem mit Subclipse über Netzwerk IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
I JTextArea Problem und Debugger IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
D Problem mit Freedesign unter NetBeans IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
R RCP: Problem bei deklarativem LightWeightDecorator IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
K JAVA Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
G Problem Netbeans Komponenten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
A NetBeans GUI Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
Q "Problem" mit SVN und (sub)Clipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
M Problem beim installieren? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
S NetBeans IDE 5.5 Problem beim Kompilieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
A NetBeans 5.5 - Problem: Endlosschleife classpath scanning IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
F Jasperreport - Parameterübergabe Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
Q Netbeans -CMP Entity Beans Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4

Ähnliche Java Themen

Neue Themen


Oben