Main.java:3: class Holeintext is public, should be declared in a file named Holeintext.java public class Holeintext { ^ Note: Main.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error
this is error i m getting this is an compilation error can someone tell me how to solve this. please help. while compiling on my pc it is running with out any error but the moment i upload it on site to compile it show me this error.
the code is :
package holeintext;
import java.io.*;
class Holeintext {
public static void main(String[] args) throws Exception {
// TODO code application logic here
DataInputStream in = new DataInputStream(System.in);
String s;
char[] str;
System.out.println("INPUT:");
int c = Integer.parseInt( in .readLine());
String[] str1 = new String[c];
for (int m = 0; m < c; m++) {
s = in .readLine();
str1[m] = s; //at this point we have a array with our input
}
System.out.println("OUTPUT:");
for (int g = 0; g < str1.length; g++) {
s = str1[g];
str = s.toCharArray();
int i = 0;
int count = 0;
while (i < str.length) {
if ((str[i] == 'A') || (str[i] == 'D') || (str[i] == 'O') ||
(str[i] == 'P') || (str[i] == 'R')) {
count = count + 1;
} else
if (str[i] == 'B') {
count = count + 2;
}
i++;
}
System.out.println(count);
}
}
}