mình làm cái này, không hiểu sao lại in ra cái a.get... rất kì lạ.
thanks các bác.
Mã:
import java.util.scanner;
public class bai12 {
public static void main(string[] args) {
hocsinh a = new hocsinh();
scanner nhap = new scanner(system.in);
int n;
system.out.print("so luong sinh vien la: ");
n=nhap.nextint();
for (int i = 0; i < n; i++) {
int j = i + 1;
{
system.out.println("sv thu " + j);}
a.getten(a.ten);
a.getlop(a.lop);
a.getdtb(a.dtb);
}
}
}
class hocsinh {
public string ten;
public string lop;
public float dtb;
scanner in = new scanner(system.in);
public void getten(string ten) {
system.out.print("nhap ten sinh vien: ");
ten = in.nextline();
}
public void getlop(string lop) {
system.out.print("nhap lop: ");
lop = in.nextline();
}
public void getdtb(float dtb) {
system.out.print("nhap diem trung binh: ");
dtb = in.nextfloat();
}
}
How to make a coconut leaf hat? How to make a coconut leaf hat? Making a coconut leaf hat can be a fun and creative project. Here's a simple guide to making one: Materials Needed: Fresh coconut...
Crafting Tradition: How to Make a Coconut Leaf Hat