Final answer:
The Java program contains errors in class naming and syntax which prevent it from demonstrating hierarchical inheritance. Once corrected, it will showcase the concept as expected by outputting the designated statements for each class.
Step-by-step explanation:
The given Java program aims to demonstrate hierarchical inheritance but contains some errors that prevent it from running correctly. The errors in the program are: The class Student is incorrectly referred to as Students; the method Play() needs to have its string properly closed with a quote; and the classes FT and PT should extend Student, not 'Students'. Upon fixing these, the program should run and demonstrate hierarchical inheritance as expected.
Here is the corrected version of the program:
class Student {
void Play() {
System.out.println("We are proud students of NUST");
}
}
class FT extends Student {
void FTStudy() {
System.out.println("Mr Steven - I am in FT programme");
}
}
class PT extends Student {
void PTStudy() {
System.out.println("Ms Jane - I am in PT programme");
}
}
public class Lab08_A {
public static void main(String args[]) {
FT ft = new FT();
PT pt = new PT();
ft.Play(); // Now uncommented to match the expected output
ft.FTStudy();
pt.PTStudy();
}
}