package com.DataFlair.StringInput; import java.util.*; import java.util.Scanner; public class ScannerClassInput { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter a String"); String str = sc.nextLine(); System.out.println("The String input using Scanner class is: " +str); } }
Error
C:\Users\nandhu\OneDrive\Documents\NetBeansProject s>java ScannerClassInput
Error: Could not find or load main class ScannerClassInput
Caused by: java.lang.NoClassDefFoundError: com/DataFlair/StringInput/ScannerClassInput (wrong name: ScannerClassInput)