void datatype::print() { switch (vartype) { case character: cout << " 字符型 : " << c << endl; break; case integer: cout << " 整型 : " << i << endl; break; case floating_point: cout << " 浮点型 : " << f << endl; break; } } void main() { datatype A('c'),...
14 System.out.println("字符型:"+s); 15 System.out.println("整型:"+a); 16 System.out.println("浮点型:"+b); 17 } 18 public static void main(String[] args) { 19 DataType p=new DataType('m',10,125.2f); 20 p.display(); 21 } 22 } 1. 2. 3. 4. 5. 6. 7. 8. 9. 1...