Question: Here is my code, and below are my errors. Can you please help me debug? I am currently running in NetBeans. package TestProjectWeek3; public class

Here is my code, and below are my errors. Can you please help me debug? I am currently running in NetBeans.

package TestProjectWeek3;

public class TestProjectWeek3 {

public static void main(String[] args) { System.out.println("Caesar Cipher Implementation"); int key=0; String text=""; while(true) { text=""; try { System.out.println("Enter the key and text seperated by space: "); String[] s = in.nextLine().trim().split(" "); key = Integer.parselnt(s[0]); for(int i=1;i3 ||key<-3) break; String encryptedText= translate(text,key); System.out.println("Encrypted Text: "+encryptedText); } catch(NumberFormatException e){ System.out.println("ERROR: Key is not an Integer."); } } in.close(); } public static string translate(String inText, int key) { string outText=""; for(int i=0;i

Errors--

java.lang.NoClassDefFoundError: string at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) Caused by: java.lang.ClassNotFoundException: string at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 7 more Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" C:\Users\blink\AppData\Local\NetBeans\Cache\8.2\executor-snippets un.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!