Answer:
Following are the program in the java language
public class Main // Main class
{
String courseStudentsname; // variable declaration
int age; // variable declaration
int ID; // variable declaration
Main() // default constructor
{
courseStudentsname="Smith";//assign the values mention in the question
age=20;//assign the values which is mention in the question
ID=9999;//assign the values which is mention in the question
}
void printAll() // method definition of printAll()
{
System.out.print("Name: " + courseStudentsname ); // display name
System.out.print(", Age: " + age); // display age
System.out.print(", ID: " + ID); // display id
}
public static void main(String[] args) // main fuunction()
{
Main ob=new Main(); // create the object of Main class
ob.printAll(); // calling the method printAll()
}
}
Output:
Name:"Smith, Age:20, ID:9999
Explanation:
Following are the description of program