error:reached end of file while parsing. How can i solve this?
package en.codegym.task.pro.task09.task0905;
/*
Octal converter
*/
public class Solution {
public static void main(String[] args) {
int decimalNumber = 21;
System.out.println("Decimal number " + decimalNumber + " is equal to octal number " + toOctal(decimalNumber));
int octalNumber = 25;
System.out.println("Octal number " + octalNumber + " is equal to decimal number " + toDecimal(octalNumber));
}
public static int toOctal(int decimalNumber) {
//write your code here
int i=0;
int octal1=0;
while(decimalNumber!=0){
octal1=octal1+(decimalNumber%8)*Math.pow(10,i);
decimalNumber=decimalNumber/8;
i++;
}
return octal1;
}
public static int toDecimal(int octalNumber) {
//write your code here
int i=0;
int dec1=0;
while(octalNumber!=0){
dec1=dec1+(octalNumber%10)*Math.pow(8,i);
octalNumber=octalNumber/10;
i++;
return dec1;
}
}