Explanation
This Java code is a simple program designed to demonstrate how to declare, initialize, and print the values of string variables. It defines a class named prog1, which contains the main method—the entry point for any Java application. Inside this method, three String variables (rollNo, name, and dept) are created. Each variable is assigned a specific text value. Finally, the program uses System.out.println() to display the value stored in each of these variables on the console, with each value appearing on a new line. Essentially, it's a basic "hello world" equivalent for demonstrating string manipulation and console output.