[Unable to find Component]

Kỹ thuật lập trình hướng đối tượng - IT07 (208)

Câu hỏi 664352:

Đâu là đoạn mã để tạo hình tròn như hình minh hoạ

A. class MyFrame extends Frame
{
public MyFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.setColor(Color.BLUE);
g.drawOval(40, 40, 80, 80);
}
}
B. class MyFrame extends Frame
{
public void paint(Graphics g)
{
g.setColor(Color.BLUE);
g.fillOval(40, 40, 80, 80);
}
}
C. class MyFrame extends Frame
{
public MyFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.setColor(Color.BLUE);
g.fillOval(40, 40, 80, 80);
}
}
D. class MyFrame extends Frame
{
public MyFrame(String title)
{
super(title);
g.setColor(Color.BLUE);
g.fillOval(40, 40, 80, 80);
}
}

Câu hỏi 664351:

Cho lớp HangHoa được xây dựng như sau:

public class HangHoa{

private String tenHH;

private int soLuong;

private float donGia;

public String getTenHH() {

return tenHH;

}

public void setTenHH(String name) {

this.tenHH = name;

}

public int getSoLuong() {

return soLuong;

}

public void setSoLuong(int sl) {

this.soLuong = sl;

}

public float getDonGia() {

return donGia;

}

public void setDonGia(float dg) {

this.donGia = dg;

}

}

 

Đâu là đoạn mã để tạo đối tượng HangHoa với giá trị lấy từ các điều khiển trên giao diện như hình:

A. private HangHoa getHangHoa (  ){

HangHoa hh = new HangHoa();

hh.tenHH = txtTenHH.getText();

hh.soLuong = Integer.parseInt(txtSoLuong.getText());

hh.donGia = Float.parseFloat(txtDonGia.getText());

return hh;
}
B. private HangHoa getHangHoa (  ){

HangHoa hh = new HangHoa();

hh.tenHH = txtTenHH.getText();

hh.soLuong = txtSoLuong.getText();

hh.donGia = txtDonGia.getText();

return hh;
}
C. private void getHangHoa( HangHoa hh ){

hh.setTenHH(txtTenHH.getText());

hh.setSoLuong(Integer.parseInt(txtSoLuong.getText()));

hh.setDonGia(Float.parseFloat(txtDonGia.getText()));

}
D. private HangHoa getHangHoa (  ){

HangHoa hh = new HangHoa();

hh.setTenHH(txtTenHH.getText());

hh.setSoLuong(Integer.parseInt(txtSoLuong.getText()));

hh.setDonGia(Float.parseFloat(txtDonGia.getText()));

return hh;
}

Câu hỏi 664350:

Để thêm lần lượt 03 mục cho List như hình minh hoạ thì đoạn mã là gì?

A. colorList = new List(3, false);
colorList.add("Yellow");
colorList.add("Green");
colorList.add("Black");
B. colorList = new List(3, false);
colorList.add("Yellow");
colorList.add("Black");
colorList.add("Green");
C. colorList = new List(3, false);
colorList.add("Green");
colorList.add("Black");
colorList.add("Yellow");
D. colorList = new List(3, false); colorList.add("Black");
colorList.add("Yellow");
colorList.add("Green");

Câu hỏi 147636:

Đâu là đoạn mã xây dựng lớp GiaoVien theo sơ đồ sau:

A. class GiaoVien
{
int maNS, namSinh;
Strinh hoTen;
float luongThang;
void nhapGV(  )
{
Scanner sc = new Scanner(System.in);
System.out.print(“Nhap Ma:”);
maNS = sc.nextInt(  );
System.out.print(“Nhap Ho Ten:”);
hoTen = sc.nextLine(  );
System.out.print(“Nhap Nam Sinh:”);
namSinh = sc.nextInt(  );
System.out.print(“Nhap Luong:”);
luongThang = sc.nextFloat(  );
}
void xuatGV(  )
{
System.out.printf(“\n%7d”, maNS);
System.out.printf(“%15s”, hoTen);
System.out.printf(“%7d”, namSinh);
System.out.printf(“%7.1f”, luongThang);
}
}
B. class GiaoVien extend NhanSu
{
float luongThang;
void nhapGV(  )
{
NhanSu.nhapNS();
Scanner sc = new Scanner(System.in);
System.out.print(“Nhap Luong:”);
luongThang = sc.nextFloat(  );
}
void xuatGV(  )
{
NhanSu.xuatNS();
System.out.printf(“%7.1f”, luongThang);
}
}
C. class GiaoVien
{
float luongThang;
void nhapGV(  )
{
Scanner sc = new Scanner(System.in);
System.out.print(“Nhap Luong:”);
luongThang = sc.nextFloat(  );
}
void xuatGV(  )
{
System.out.printf(“%7.1f”, luongThang);
}
}
D. class GiaoVien extends NhanSu
{
float luongThang;
void nhapGV(  )
{
super.nhapNS();
Scanner sc = new Scanner(System.in);
System.out.print(“Nhap Luong:”);
luongThang = sc.nextFloat(  );
}
void xuatGV(  )
{
super.xuatNS();
System.out.printf(“%7.1f”, luongThang);
}
}
Trung tâm giáo dục thể chất và quốc phòng an ninh
Khoa kinh tế
Khoa đào tạo từ xa
Trung tâm đào tạo trực tuyến
Khoa đào tạo cơ bản
Khoa điện - điện tử
Khoa du lịch
Khoa Công nghệ thông tin
Viện Công nghệ sinh học và Công nghệ thực phẩm
Trung tâm đại học Mở Hà Nội tại Đà Nẵng
Khoa tiếng Trung Quốc
Khoa tạo dáng công nghiệp
Khoa tài chính ngân hàng
Khoa Tiếng anh
Khoa Luật

Bản tin HOU-TV số 07 năm 2026

Tuyển sinh đại học Mở Hà Nội - HOU

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.