Hello, great gods. Originally, I wanted to write a code as follows, but my report is as follows. I just want to find out where it went wrong:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code-non-static method isKeyRow (java.lang.String) cannot be referenced from a static context
at javaapplication3.JavaApplication3.main (JavaApplication3.java:12)
Claze UsersViviAppDataLocalNetBeansCache8.2executorlysnippetsrun.xml second 53: Java returned: 1 BUILD FAILED (total time: 1 second)
I am a novice at java, can I help you?
package javaapplication3;
import java.util.Scanner;
public class JavaApplication3 {
public static void main(String[] args) {
System.out.println(isKeyRow("user"));
}
public boolean isKeyRow(String user){
String string1="qwertyuiop";
String string2="asdfghjkl";
String string3="zxcvbnm";
Character u;
boolean b=true;
for(int i=0;i<user.length();iPP){
u=user.charAt(i);
for(int a=0;a<string1.length();aPP){
if(string1.charAt(a)!=u){
b=false;
break;
}
}
for(int a=0;a<string2.length();aPP){
if(string2.charAt(a)!=u){
b=false;
break;
}
}
for(int a=0;a<string3.length();aPP){
if(string3.charAt(a)!=u){
b=false;
break;
}
return b;
}
}