Câu hỏi 170940 - Kỹ thuật lập trình hướng đối tượng - IT07
Đoạn mã sau thực hiện nhiệm vụ gì?
public class NV {
float hsl;
public NV( float xx) { hsl = xx; }
public NV { hsl = 0; }
float tinhluong { return hsl * 1500000; }
float tinhluong( float pc) { return (hsl+pc) * 1500000; }
public static void main(String arg[])
{
NV x = new NV( );
System.out.print(“1. Ket qua:” + x.tinhluong);
System.out.print(“2. Ket qua:” + x.tinhluong( 1 ));
}
}