declare and initialize a string variable in java code example
Example: how to initialize a string in java
Scanner sc = new Scanner(System.in);
String str = sc.next();
Scanner sc = new Scanner(System.in);
String str = sc.next();