import java.io.*;
import java.lang.*;
import java.util.*;
class First
{
public int No;
public String Name;
void getDetails() throws IOException
{
Scanner sc = new Scanner(System.in);
No = sc.nextInt();
Name = sc.nextLine();
}
void showDetails() throws IOException
{
System.out.println("The No and Name entered is: " +No +"\t" +Name);
}
}
class Second extends First
{
public double Salary;
public void showSalary() throws IOException
{
BufferedReader br = new BufferedReader ( new InputStreamReader (System.in) );
Salary = Double.parseDouble(br.readLine() );
System.out.println(" The salary for no:" +No +"is" +Salary);
}
}
class Demo_Inheritance
{
public static void main(String s[]) throws IOException
{
Second sd = new Second();
sd.getDetails();
sd.showDetails();
sd.showSalary();
First fs = new First();
fs.getDetails();
fs.showDetails();
fs.showSalary(); }
}
当我执行此编码时,我在最后一行收到错误为“ fs.showSalary() ”-> 找不到符号“。(点)”