Baffled while calling method
Code:
import java.io.*;
import java.util.Scanner;
class project12 {
public void mast(String[] args) { //METHOD DECLARED HERE
int num1 = 10429;
int num2 = 15;
double dnum1 = 47.8;
double dnum2 = 5;
System.out.println("Hello World!");
System.out.println(num1 + "x" + num2 + "=" + (num1+num2) + " Hooray for addition");
System.out.println(dnum1 + " devided by " + dnum2 + " gives us " + (dnum1/dnum2) + ", But you couldn't do this with integers so i used doubles\n");
//counting system: example of the for loop which can do all that a while loop can do
int i;
System.out.println("below is an example of for loops, it repeats a proccess while counting to 10:");
for (i=1; i<=10; i++) {
System.out.println("count:" + i);
}
//Use of condition statements to generate boolean variable output
System.out.println("\nif the following statements are true then it should show:");
System.out.println(num1 + " > " + num2 + " is " + (num1>num2));
System.out.println(num1 + " < " + num2 + " is " + (num1<num2));
//input and conditions (requires 'import java.io.*;' for reader.readLine()):
System.out.println("would you like to use the manuel counter? (y/n): ");
int cuse = 'y'; //counter-use? ~= cuse
try {
cuse = System.in.read();
}catch(java.io.IOException exp){ exp.printStackTrace();}
if (cuse=='y') {
int cnum = 10;
System.out.println("enter a number (prefferably within the known and feasible universe): ");
Scanner scan = new Scanner(System.in); //required for scan.nextInt()
cnum = scan.nextInt(); //scans for integer input
int dd;
System.out.println("counting to " + cnum + ":");
for (dd=1; dd<=cnum; dd++) {
System.out.println(dd);
}
}
else {
System.out.println("??? wtf??? why... what... wtf???");
}
}
public static void main(String[] args) {
int repet = 1;
while (repet==1) {
mast(); //METHOD CALLED HERE
int re = 'y';
System.out.println("\n\nwould you like to stay? (y/n): ");
try {
re = System.in.read();
}catch(java.io.IOException exp){ exp.printStackTrace();}
if (re=='y') {
continue;
} else {
repet = 3;
break;
}
}
System.out.println("bye for now\n");
}
}
i am very new to java and so im basically picking things up and testing them as i go along, this program IS completely useless, and (from my knowledge of other languages) chaotic and badly laid out. i have tried to integrate a lot of different concepts to practice my java, and it all worked untill i tried to make the method that had previously been main (mast() where is says METHOD DECLARED HERE) a separate method and make a new main method which i call the mast() method from. I compiled it with javac in ubuntu and this is what i got:
Code:
james@james-laptop:~/Desktop/coding/Jcoding$ javac pro1-3.java
pro1-3.java:54: main(java.lang.String[]) in project13 cannot be applied to ()
main();
^
1 error
i figure it is something gone wrong with my call of the mast function - err.. i mean method - but i don't know the precise nature of the problem. Could somebody please explain where i have gone wrong and how to put it right?
(or direct me to a previous post that i haven't found)
thanks in advance