Hey @ all,
wie der Titel schon sagt, möchte ich gerne anfangen mit Eclipse zu arbeiten. Ich habe schon einige Anleitungen im Internet gesucht und gefunden. Das grundlegende Muster wie man ein Projekt erstellt, habe ich auch verstanden. ABER: Eclipse nimmt einfach nicht meinen Code an.
Das ganze funktioniert under BlueJ aber halt nicht unter Eclipse...Code:public class Test { private double x; private double y; private double r; public Test() { } public void Prozentwert(double x,double y) { r = 100/y*x; System.out.println(x + " aus " + y + " sind " + r + "%"); } public void Prozentsatz(double x,double y) { r = y/100*x; System.out.println(x + "% von " + y + " sind " + r); } public void Grundwert(double x,double y) { r = y/x*100; System.out.println(x + "% von " + y + " sind" + r); } }
Die Fehlermeldung kommt nicht, wenn ich das Kästchen "public static void main (String[] args) beim Klassenerstellen anklicke. Dann sieht der Code so aus:Code:no suitable method `main' in class
Allerdings kommt dann gar nichts... Er schreibt einfach nix.Code:package test; public class test { private double x; private double y; private double r; public test() { } public void Prozentwert(double x,double y) { r = 100/y*x; System.out.println(x + " aus " + y + " sind " + r + "%"); } public void Prozentsatz(double x,double y) { r = y/100*x; System.out.println(x + "% von " + y + " sind " + r); } public void Grundwert(double x,double y) { r = y/x*100; System.out.println(x + "% von " + y + " sind" + r); } public static void main(String[] args) { // TODO Auto-generated method stub } }
Was soll ich denn da machen? Ich muss auch nicht (wie eig. im Source Code vorgesehen) eingaben zu X und Y machen.
Kann mir da bitte einer weiterhelfen?
Gruß
nessor

LinkBack URL
About LinkBacks


Zitieren


Lesezeichen