-
06-17-2014, 07:00 AM #31Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
import java.util.scanner;
public class kethuademo {
public static void main(string[] args){
scanner nhapdl = new scanner(system.in);
sinhvien sv1 = new sinhvien();
giangvien gv1 = new giangvien();
system.out.println("nhập thông tin sinh viên: ");
sv1.input();
system.out.println("nhập tiền học phí sinh viên: ");
sv1.sethocphi(nhapdl.nextint());
sv1.output();
system.out.println("tiền học phí của sinh viên "+sv1.gethoten()+" là "+sv1.gethocphi()+" vnd");
system.out.println("nhập thông tin giảng viên: ");
gv1.input();
system.out.println("nhập tiền lương giảng viên: ");
gv1.setluong(nhapdl.nextint());
gv1.output();
system.out.println("tiền lương giảng viên "+gv1.gethoten()+" mỗi tháng "+gv1.getluong()+" vnd");
//system.out.println(" họ tên sinh viên: ");
//sv1.sethoten(nhapdl.nextline());
//system.out.println("nhập năm sinh sinh viên: ");
//sv1.setnamsinh(nhapdl.nextint());
//system.out.println("nhập mã thẻ sinh viên: ");
//sv1.setmathe (nhapdl.nextint());
}
}
class nhansu{
private string hoten;
private int namsinh;
private int mathe;
public void sethoten(string hoten){
this.hoten = hoten;
}
public string gethoten(){
return hoten;
}
public int getnamsinh() {
return namsinh;
}
public void setnamsinh(int namsinh) {
this.namsinh = namsinh;
}
public int getmathe() {
return mathe;
}
public void setmathe(int mathe) {
this.mathe = mathe;
}
public void input(){
scanner nhapdl2 = new scanner(system.in);
system.out.println("nhap vao ho ten: ");
sethoten(nhapdl2.nextline());
system.out.println("nhap vao nam sinh: ");
setnamsinh(nhapdl2.nextint());
system.out.println("nhập vào mã thẻ: ");
setmathe(nhapdl2.nextint());
}
public void output(){
system.out.println("họ và tên: "+gethoten());
system.out.println("năm sinh: "+getnamsinh());
system.out.println("mã thẻ: "+getmathe());
}
}
class sinhvien extends nhansu{
private int hocphi;
public int gethocphi(){
return hocphi;
}
public void sethocphi(int hocphi){
this.hocphi = hocphi;
}
}
class giangvien extends nhansu{
private int luong;
public void setluong(int luong){
this.luong = luong;
}
public int getluong(){
return luong;
}
}
class canbocapcao extends nhansu{
private int tientieu;
public int gettientieu(){
return tientieu;
}
public void settientieu(int tientieu){
this.tientieu = tientieu;
}
}
-
07-07-2014, 07:00 AM #32Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package main[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];public class [/color][color=#0000bb]unit16b [/color][color=#007700]{public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]agrs[/color][color=#007700]){[/color][color=#0000bb]students stus [/color][color=#007700]= new [/color][color=#0000bb]students[/color][color=#007700]();[/color][color=#0000bb]stus[/color][color=#007700].[/color][color=#0000bb]input[/color][color=#007700](); [/color][color=#0000bb]giangvien_gv gv_gv [/color][color=#007700]= new [/color][color=#0000bb]giangvien_gv[/color][color=#007700]();[/color][color=#0000bb]gv_gv[/color][color=#007700].[/color][color=#0000bb]input[/color][color=#007700](); [/color][color=#0000bb]giamdoc gd [/color][color=#007700]= new [/color][color=#0000bb]giamdoc[/color][color=#007700]();[/color][color=#0000bb]gd[/color][color=#007700].[/color][color=#0000bb]input[/color][color=#007700](); [/color][color=#0000bb]stus[/color][color=#007700].[/color][color=#0000bb]output[/color][color=#007700]();[/color][color=#0000bb]stus[/color][color=#007700].[/color][color=#0000bb]settiennophi[/color][color=#007700]([/color][color=#0000bb]6700000[/color][color=#007700]);[/color][color=#0000bb]gv_gv[/color][color=#007700].[/color][color=#0000bb]output[/color][color=#007700]();[/color][color=#0000bb]gv_gv[/color][color=#007700].[/color][color=#0000bb]setluongthang[/color][color=#007700]([/color][color=#0000bb]7000000[/color][color=#007700]);[/color][color=#0000bb]gd[/color][color=#007700].[/color][color=#0000bb]output[/color][color=#007700]();[/color][color=#0000bb]gd[/color][color=#007700].[/color][color=#0000bb]settientieu[/color][color=#007700]([/color][color=#0000bb]5000000[/color][color=#007700]);} }class [/color][color=#0000bb]infomation[/color][color=#007700]{private [/color][color=#0000bb]string hoten[/color][color=#007700];private [/color][color=#0000bb]int namsinh[/color][color=#007700];private [/color][color=#0000bb]string mathe[/color][color=#007700]; public [/color][color=#0000bb]string gethoten[/color][color=#007700]() {return [/color][color=#0000bb]hoten[/color][color=#007700];}public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700];}public [/color][color=#0000bb]int getnamsinh[/color][color=#007700]() {return [/color][color=#0000bb]namsinh[/color][color=#007700];}public [/color][color=#0000bb]void setnamsinh[/color][color=#007700]([/color][color=#0000bb]int namsinh[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]namsinh[/color][color=#007700];}public [/color][color=#0000bb]string getmathe[/color][color=#007700]() {return [/color][color=#0000bb]mathe[/color][color=#007700];}public [/color][color=#0000bb]void setmathe[/color][color=#007700]([/color][color=#0000bb]string mathe[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]mathe[/color][color=#007700];}public [/color][color=#0000bb]void input[/color][color=#007700](){[/color][color=#0000bb]scanner ip [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap thong tin: "[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ho ten: "[/color][color=#007700]);[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]ip[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]();[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam sinh: "[/color][color=#007700]);[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]ip[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]();[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ma the: "[/color][color=#007700]);[/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]ip[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]();}public [/color][color=#0000bb]void output[/color][color=#007700](){[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"thong tin: "[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ho ten: "[/color][color=#007700]+[/color][color=#0000bb]hoten[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam sinh: "[/color][color=#007700]+[/color][color=#0000bb]namsinh[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ma the: "[/color][color=#007700]+[/color][color=#0000bb]mathe[/color][color=#007700]);} }class [/color][color=#0000bb]students [/color][color=#007700]extends [/color][color=#0000bb]infomation[/color][color=#007700]{private [/color][color=#0000bb]long tiennophi[/color][color=#007700]; public [/color][color=#0000bb]long gettiennophi[/color][color=#007700]() {return [/color][color=#0000bb]tiennophi[/color][color=#007700];} public [/color][color=#0000bb]void settiennophi[/color][color=#007700]([/color][color=#0000bb]long tiennophi[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tiennophi [/color][color=#007700]= [/color][color=#0000bb]tiennophi[/color][color=#007700];}}class [/color][color=#0000bb]giangvien_gv [/color][color=#007700]extends [/color][color=#0000bb]infomation[/color][color=#007700]{private [/color][color=#0000bb]long luongthang[/color][color=#007700]; public [/color][color=#0000bb]long getluongthang[/color][color=#007700]() {return [/color][color=#0000bb]luongthang[/color][color=#007700];} public [/color][color=#0000bb]void setluongthang[/color][color=#007700]([/color][color=#0000bb]long luongthang[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]luongthang [/color][color=#007700]= [/color][color=#0000bb]luongthang[/color][color=#007700];} }class [/color][color=#0000bb]giamdoc [/color][color=#007700]extends [/color][color=#0000bb]infomation[/color][color=#007700]{private [/color][color=#0000bb]long tientieu[/color][color=#007700]; public [/color][color=#0000bb]long gettientieu[/color][color=#007700]() {return [/color][color=#0000bb]tientieu[/color][color=#007700];} public [/color][color=#0000bb]void settientieu[/color][color=#007700]([/color][color=#0000bb]long tientieu[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tientieu [/color][color=#007700]= [/color][color=#0000bb]tientieu[/color][color=#007700];}} [/color]
</div>
</div>
-
07-08-2014, 07:00 AM #33Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>b1 (move your mouse to reveal the content)</noscript>
b1 (open)
b1 (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package edu[/color][color=#007700].[/color][color=#0000bb]dragon[/color][color=#007700].[/color][color=#0000bb]oot[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; public class [/color][color=#0000bb]practiceinheritance [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]giangvien a [/color][color=#007700]= new [/color][color=#0000bb]giangvien[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]input[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]inputgiangvien[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]output[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]outputgiangvien[/color][color=#007700](); }} class [/color][color=#0000bb]nguoi[/color][color=#007700]{ private [/color][color=#0000bb]string hoten[/color][color=#007700]; private [/color][color=#0000bb]int namsinh[/color][color=#007700]; private [/color][color=#0000bb]string mathe[/color][color=#007700]; [/color][color=#0000bb]scanner in [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); public [/color][color=#0000bb]string gethoten[/color][color=#007700]() { return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]int getnamsinh[/color][color=#007700]() { return [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]void setnamsinh[/color][color=#007700]([/color][color=#0000bb]int namsinh[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]string getmathe[/color][color=#007700]() { return [/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]void setmathe[/color][color=#007700]([/color][color=#0000bb]string mathe[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]void input[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập họ tên:"[/color][color=#007700]); [/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập năm sinh:"[/color][color=#007700]); [/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]integer[/color][color=#007700].[/color][color=#0000bb]parseint[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập mã thẻ:"[/color][color=#007700]); [/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); } public [/color][color=#0000bb]void output[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"họ tên:"[/color][color=#007700]+[/color][color=#0000bb]hoten[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"năm sinh:"[/color][color=#007700]+[/color][color=#0000bb]namsinh[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"mã thẻ:"[/color][color=#007700]+[/color][color=#0000bb]mathe[/color][color=#007700]); }}class [/color][color=#0000bb]sinhvien [/color][color=#007700]extends [/color][color=#0000bb]nguoi[/color][color=#007700]{ private [/color][color=#0000bb]float tienhocphi[/color][color=#007700]; public [/color][color=#0000bb]float gettienhocphi[/color][color=#007700]() { return [/color][color=#0000bb]tienhocphi[/color][color=#007700]; } public [/color][color=#0000bb]void settienhocphi[/color][color=#007700]([/color][color=#0000bb]float tienhocphi[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienhocphi [/color][color=#007700]= [/color][color=#0000bb]tienhocphi[/color][color=#007700]; }} class [/color][color=#0000bb]giangvien [/color][color=#007700]extends [/color][color=#0000bb]nguoi[/color][color=#007700]{ private [/color][color=#0000bb]float tienluong[/color][color=#007700]; [/color][color=#0000bb]scanner in [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); public [/color][color=#0000bb]float gettienluong[/color][color=#007700]() { return [/color][color=#0000bb]tienluong[/color][color=#007700]; } public [/color][color=#0000bb]void settienluong[/color][color=#007700]([/color][color=#0000bb]float tienluong[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienluong [/color][color=#007700]= [/color][color=#0000bb]tienluong[/color][color=#007700]; } public [/color][color=#0000bb]void inputgiangvien[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập lương:"[/color][color=#007700]); [/color][color=#0000bb]tienluong [/color][color=#007700]= [/color][color=#0000bb]float[/color][color=#007700].[/color][color=#0000bb]parsefloat[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); } public [/color][color=#0000bb]void outputgiangvien[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"lương:"[/color][color=#007700]+[/color][color=#0000bb]tienluong[/color][color=#007700]); }} class [/color][color=#0000bb]giamdoc [/color][color=#007700]extends [/color][color=#0000bb]nguoi[/color][color=#007700]{ private [/color][color=#0000bb]float tientieu[/color][color=#007700]; public [/color][color=#0000bb]float gettientieu[/color][color=#007700]() { return [/color][color=#0000bb]tientieu[/color][color=#007700]; } public [/color][color=#0000bb]void settientieu[/color][color=#007700]([/color][color=#0000bb]float tientieu[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tientieu [/color][color=#007700]= [/color][color=#0000bb]tientieu[/color][color=#007700]; }}[/color]
</div>
</div>
-
09-09-2014, 07:00 AM #34Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>bài tập về nhà _ nhân sự (move your mouse to reveal the content)</noscript>
bài tập về nhà _ nhân sự (open)
bài tập về nhà _ nhân sự (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package baitapvenha[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];[/color][color=#ff8000]/** * bài 1: dùng tính kế thừa khai báo 3 class: class "sinh viên" gồm các thuộc * tính: họ tên, năm sinh, mã thẻ, tiền học phí còn nợ. class "giảng viên" gồm * các thuộc tính: họ tên, năm sinh, mã thẻ, tiền lương hàng tháng. class * "giám đốc" gồm các thuộc tính: họ tên, năm sinh, mã thẻ, tiền tiêu hàng * tháng. * * các thuộc tính để private, truy cập các thuộc tính sử dụng phương thức getter * và setter tạo 1 đối tượng giảng viên, giá trị nhập vào từ bàn phím, in thông * tin ra ngoài màn hình console */[/color][color=#007700]public class [/color][color=#0000bb]buoi16 [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]bai16_nhansu ns [/color][color=#007700]= new [/color][color=#0000bb]bai16_nhansu[/color][color=#007700](); [/color][color=#0000bb]giaovien16 a [/color][color=#007700]= new [/color][color=#0000bb]giaovien16[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap thong tin giao vien: "[/color][color=#007700]); [/color][color=#0000bb]ns[/color][color=#007700].[/color][color=#0000bb]nhapinfo[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]nhapinfo[/color][color=#007700](); [/color][color=#0000bb]ns[/color][color=#007700].[/color][color=#0000bb]xuatinfo[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]xuatinfo[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"
nhap thong tin sinh vien: "[/color][color=#007700]); [/color][color=#0000bb]sinhvien16 sv [/color][color=#007700]= new [/color][color=#0000bb]sinhvien16[/color][color=#007700](); [/color][color=#0000bb]sv[/color][color=#007700].[/color][color=#0000bb]nhapinfo[/color][color=#007700](); [/color][color=#0000bb]sv[/color][color=#007700].[/color][color=#0000bb]xuatinfo[/color][color=#007700](); }} class [/color][color=#0000bb]bai16_nhansu [/color][color=#007700]{ private [/color][color=#0000bb]string hoten[/color][color=#007700], [/color][color=#0000bb]mathe[/color][color=#007700]; private [/color][color=#0000bb]int namsinh[/color][color=#007700]; public [/color][color=#0000bb]string gethoten[/color][color=#007700]() { return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]string getmathe[/color][color=#007700]() { return [/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]void setmathe[/color][color=#007700]([/color][color=#0000bb]string mathe[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]int getnamsinh[/color][color=#007700]() { return [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]void setnamsinh[/color][color=#007700]([/color][color=#0000bb]int namsinh[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]void nhapinfo[/color][color=#007700]() { [/color][color=#0000bb]scanner sc [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"ho ten: "[/color][color=#007700]); [/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"ma the: "[/color][color=#007700]); [/color][color=#0000bb]setmathe[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nam sinh: "[/color][color=#007700]); [/color][color=#0000bb]setnamsinh[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); } public [/color][color=#0000bb]void xuatinfo[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#0000bb]gethoten[/color][color=#007700]() + [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]getmathe[/color][color=#007700]() + [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]getnamsinh[/color][color=#007700]()+ [/color][color=#dd0000]"\t"[/color][color=#007700]); }} class [/color][color=#0000bb]sinhvien16 [/color][color=#007700]extends [/color][color=#0000bb]bai16_nhansu [/color][color=#007700]{ private [/color][color=#0000bb]int tienhocphi[/color][color=#007700]; public [/color][color=#0000bb]int gettienhocphi[/color][color=#007700]() { return [/color][color=#0000bb]tienhocphi[/color][color=#007700]; } public [/color][color=#0000bb]void settienhocphi[/color][color=#007700]([/color][color=#0000bb]int tienhocphi[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienhocphi [/color][color=#007700]= [/color][color=#0000bb]tienhocphi[/color][color=#007700]; } public [/color][color=#0000bb]void nhapinfo[/color][color=#007700]() { [/color][color=#0000bb]scanner sc [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"ho ten : "[/color][color=#007700]); [/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"ma the : "[/color][color=#007700]); [/color][color=#0000bb]setmathe[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nam sinh: "[/color][color=#007700]); [/color][color=#0000bb]setnamsinh[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"tien hoc: "[/color][color=#007700]); [/color][color=#0000bb]settienhocphi[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); } public [/color][color=#0000bb]void xuatinfo[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#0000bb]gethoten[/color][color=#007700]() + [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]getmathe[/color][color=#007700]() + [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]getnamsinh[/color][color=#007700]()+ [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]gettienhocphi[/color][color=#007700]()); } } class [/color][color=#0000bb]giaovien16 [/color][color=#007700]extends [/color][color=#0000bb]bai16_nhansu [/color][color=#007700]{ private [/color][color=#0000bb]int tienluong[/color][color=#007700]; public [/color][color=#0000bb]int gettienluong[/color][color=#007700]() { return [/color][color=#0000bb]tienluong[/color][color=#007700]; } public [/color][color=#0000bb]void settienluong[/color][color=#007700]([/color][color=#0000bb]int tienluong[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienluong [/color][color=#007700]= [/color][color=#0000bb]tienluong[/color][color=#007700]; } public [/color][color=#0000bb]void nhapinfo[/color][color=#007700]() { [/color][color=#0000bb]scanner sc [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"luong: "[/color][color=#007700]); [/color][color=#0000bb]settienluong[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); } public [/color][color=#0000bb]void xuatinfo[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]gettienluong[/color][color=#007700]()); }} class [/color][color=#0000bb]giamdoc [/color][color=#007700]extends [/color][color=#0000bb]bai16_nhansu [/color][color=#007700]{ private [/color][color=#0000bb]int tientieu[/color][color=#007700]; public [/color][color=#0000bb]int gettientieu[/color][color=#007700]() { return [/color][color=#0000bb]tientieu[/color][color=#007700]; } public [/color][color=#0000bb]void settientieu[/color][color=#007700]([/color][color=#0000bb]int tientieu[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tientieu [/color][color=#007700]= [/color][color=#0000bb]tientieu[/color][color=#007700]; }}[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>tính kế thừa (move your mouse to reveal the content)</noscript>
tính kế thừa (open)
tính kế thừa (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package baitapvenha[/color][color=#007700]; public class [/color][color=#0000bb]buoi16_thuake [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]nhansu ns [/color][color=#007700]= new [/color][color=#0000bb]nhansu[/color][color=#007700](); [/color][color=#0000bb]ns[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#dd0000]"nguyen thanh binh"[/color][color=#007700]; [/color][color=#0000bb]ns[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]1986[/color][color=#007700]; [/color][color=#0000bb]ns[/color][color=#007700].[/color][color=#0000bb]quequan [/color][color=#007700]= [/color][color=#dd0000]"thai binh"[/color][color=#007700]; [/color][color=#0000bb]hocsinh hs [/color][color=#007700]= new [/color][color=#0000bb]hocsinh[/color][color=#007700](); [/color][color=#0000bb]hs[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#dd0000]"bbbbbb"[/color][color=#007700]; [/color][color=#0000bb]hs[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]1994[/color][color=#007700]; [/color][color=#0000bb]hs[/color][color=#007700].[/color][color=#0000bb]quequan [/color][color=#007700]= [/color][color=#dd0000]"hung yen"[/color][color=#007700]; [/color][color=#0000bb]hs[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]8.5f[/color][color=#007700]; [/color][color=#0000bb]giaovien gv [/color][color=#007700]= new [/color][color=#0000bb]giaovien[/color][color=#007700](); [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#dd0000]"aaaaaa"[/color][color=#007700]; [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]1992[/color][color=#007700]; [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]quequan [/color][color=#007700]= [/color][color=#dd0000]"nam dinh"[/color][color=#007700]; [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]luonghangthang [/color][color=#007700]= [/color][color=#0000bb]100000[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]ns[/color][color=#007700].[/color][color=#0000bb]hoten[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]ns[/color][color=#007700].[/color][color=#0000bb]namsinh[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]ns[/color][color=#007700].[/color][color=#0000bb]quequan[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]hs[/color][color=#007700].[/color][color=#0000bb]hoten[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]hs[/color][color=#007700].[/color][color=#0000bb]namsinh[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]hs[/color][color=#007700].[/color][color=#0000bb]quequan[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]hs[/color][color=#007700].[/color][color=#0000bb]diemtb[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]hoten[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]namsinh[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]quequan[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]luonghangthang[/color][color=#007700]); }} class [/color][color=#0000bb]nhansu [/color][color=#007700]{ public [/color][color=#0000bb]string hoten[/color][color=#007700], [/color][color=#0000bb]quequan[/color][color=#007700]; public [/color][color=#0000bb]int namsinh[/color][color=#007700];} class [/color][color=#0000bb]hocsinh [/color][color=#007700]extends [/color][color=#0000bb]nhansu[/color][color=#007700]{ public [/color][color=#0000bb]float diemtb[/color][color=#007700];} class [/color][color=#0000bb]giaovien [/color][color=#007700]extends [/color][color=#0000bb]nhansu[/color][color=#007700]{ public [/color][color=#0000bb]int luonghangthang[/color][color=#007700];}[/color]
</div>
</div>
-
10-09-2014, 07:00 AM #35Member
- Ngày tham gia
- Nov 2015
- Bài viết
- 51
Gửi bởi vjrus.ht
-
01-09-2015, 07:00 AM #36Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package lesson16[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].*; class [/color][color=#0000bb]information [/color][color=#007700]{ [/color][color=#0000bb]scanner scan01 [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); private [/color][color=#0000bb]string hoten[/color][color=#007700],[/color][color=#0000bb]mathe[/color][color=#007700]; private [/color][color=#0000bb]int namsinh[/color][color=#007700]; public [/color][color=#0000bb]string gethoten[/color][color=#007700]() { return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]string getmathe[/color][color=#007700]() { return [/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]int getnamsinh[/color][color=#007700]() { return [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]void setmathe[/color][color=#007700]([/color][color=#0000bb]string mathe[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]void setnamsinh[/color][color=#007700]([/color][color=#0000bb]int namsinh[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]void enter[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap ho ten : "[/color][color=#007700]); [/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]scan01[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap ma the : "[/color][color=#007700]); [/color][color=#0000bb]setmathe[/color][color=#007700]([/color][color=#0000bb]scan01[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); do{ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap nam sinh :"[/color][color=#007700]); [/color][color=#0000bb]setnamsinh[/color][color=#007700]([/color][color=#0000bb]scan01[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); if ([/color][color=#0000bb]getnamsinh[/color][color=#007700]()<[/color][color=#0000bb]0 [/color][color=#007700]){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam sinh khong duoc be hon 0. yeu cau nhap lai "[/color][color=#007700]); } }while([/color][color=#0000bb]getnamsinh[/color][color=#007700]()<[/color][color=#0000bb]0[/color][color=#007700]); } public [/color][color=#0000bb]void [/color][color=#007700]print() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ho ten : "[/color][color=#007700]+ [/color][color=#0000bb]gethoten[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ma the : "[/color][color=#007700]+ [/color][color=#0000bb]getmathe[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam sinh : "[/color][color=#007700]+ [/color][color=#0000bb]getnamsinh[/color][color=#007700]()); }}class [/color][color=#0000bb]sinhvien [/color][color=#007700]extends [/color][color=#0000bb]information [/color][color=#007700]{ private [/color][color=#0000bb]long tienno[/color][color=#007700]; public [/color][color=#0000bb]long gettienno[/color][color=#007700]() { return [/color][color=#0000bb]tienno[/color][color=#007700]; } public [/color][color=#0000bb]void settienno[/color][color=#007700]([/color][color=#0000bb]long tienno[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienno [/color][color=#007700]= [/color][color=#0000bb]tienno[/color][color=#007700]; } }class [/color][color=#0000bb]giangvien [/color][color=#007700]extends [/color][color=#0000bb]information [/color][color=#007700]{ private [/color][color=#0000bb]long tienluong[/color][color=#007700]; public [/color][color=#0000bb]long gettienluong[/color][color=#007700]() { return [/color][color=#0000bb]tienluong[/color][color=#007700]; } public [/color][color=#0000bb]void settienluong[/color][color=#007700]([/color][color=#0000bb]long tienluong[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienluong [/color][color=#007700]= [/color][color=#0000bb]tienluong[/color][color=#007700]; } public [/color][color=#0000bb]void enter[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap tien luong : "[/color][color=#007700]); [/color][color=#0000bb]settienluong[/color][color=#007700]([/color][color=#0000bb]scan01[/color][color=#007700].[/color][color=#0000bb]nextlong[/color][color=#007700]()) ; } public [/color][color=#0000bb]void [/color][color=#007700]print() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tien luong = " [/color][color=#007700]+ [/color][color=#0000bb]gettienluong[/color][color=#007700]()); } } class [/color][color=#0000bb]giamdoc [/color][color=#007700]extends [/color][color=#0000bb]information [/color][color=#007700]{ private [/color][color=#0000bb]long tientieu [/color][color=#007700]; public [/color][color=#0000bb]long gettientieu[/color][color=#007700]() { return [/color][color=#0000bb]tientieu[/color][color=#007700]; } public [/color][color=#0000bb]void settientieu[/color][color=#007700]([/color][color=#0000bb]long tientieu[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tientieu [/color][color=#007700]= [/color][color=#0000bb]tientieu[/color][color=#007700]; } }public class [/color][color=#0000bb]lesson16 [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args the command line arguments */ [/color][color=#007700]public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#ff8000]// todo code application logic here [/color][color=#0000bb]information inf [/color][color=#007700]= new [/color][color=#0000bb]information[/color][color=#007700](); [/color][color=#0000bb]giangvien gv [/color][color=#007700]= new [/color][color=#0000bb]giangvien[/color][color=#007700](); [/color][color=#0000bb]inf[/color][color=#007700].[/color][color=#0000bb]enter[/color][color=#007700](); [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]enter[/color][color=#007700](); [/color][color=#0000bb]inf[/color][color=#007700].print(); [/color][color=#0000bb]gv[/color][color=#007700].print(); } }[/color]
</div>
</div>
-
01-20-2015, 07:00 AM #37Junior Member
- Ngày tham gia
- May 2014
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type">
mong mọi người chỉ bảo thêm
thanks all )
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã:public class bai1_unit16 { public static void main(string[] args) { giangvien gv = new giangvien(); system.out.println("nhap thong tin giang vien:"); gv.inputp(); gv.inputg(); system.out.println("========================="); system.out.println("thong tin giang vien"); system.out.println("========================="); gv.showp(); gv.showg(); } } class person { private string hoten; private int namsinh; private string mathe; public string gethoten() { return hoten; } public void sethoten(string hoten) { this.hoten = hoten; } public int getnamsinh() { return namsinh; } public void setnamsinh(int namsinh) { this.namsinh = namsinh; } public string getmathe() { return mathe; } public void setmathe(string mathe) { this.mathe = mathe; } public void inputp() { scanner inputp = new scanner(system.in); system.out.println("nhap ten:"); hoten = inputp.nextline(); system.out.println("nhap nam sinh:"); namsinh = inputp.nextint(); /* cho nay ko hieu tai sao no ko cho nhap tham so mathe phai them dong inputp.nextline() moi nhap them dc danh de may bai sau tim hieu vay :)))) */ inputp.nextline(); system.out.println("nhap ma the:"); mathe = inputp.nextline(); } public void showp() { system.out.println("ho ten:" + gethoten()); system.out.println("nam sinh:" + getnamsinh()); system.out.println("ma the:" + getmathe()); } } class sinhvien extends person { private long tienno; public long gettienno() { return tienno; } public void settienno(long tienno) { this.tienno = tienno; } } class giangvien extends person { private long luong; public long getluong() { return luong; } public void setluong(long luong) { this.luong = luong; } public void inputg () { scanner inputg = new scanner(system.in); system.out.println("nhap tien luong hang thang:"); luong = inputg.nextint(); } public void showg() { system.out.println("tien luong thang:" + getluong()); } } class giamdoc extends person { private long tientieu; public long gettientieu() { return tientieu; } public void settientieu(long tientieu) { this.tientieu = tientieu; } }
</div>
</div>
-
02-07-2015, 07:00 AM #38Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>class main (move your mouse to reveal the content)</noscript>
class main (open)
class main (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/* * to change this template, choose tools | templates * and open the template in the editor. */[/color][color=#0000bb]package unit16[/color][color=#007700]; [/color][color=#ff8000]/** * * @author quanghuy */[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; public class [/color][color=#0000bb]unit16 [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args the command line arguments */ [/color][color=#007700]public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#ff8000]// todo code application logic here [/color][color=#0000bb]scanner input [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]giangvien a [/color][color=#007700]= new [/color][color=#0000bb]giangvien[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap ho ten giang vien: "[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap nam sinh: "[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setnamsinh[/color][color=#007700]([/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap ma the: "[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setmathe[/color][color=#007700]([/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap luong cua giang vien "[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setluong[/color][color=#007700]([/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"giang vien: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]()+[/color][color=#dd0000]" sinh nam: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getnamsinh[/color][color=#007700]()+[/color][color=#dd0000]" co ma the la: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getmathe[/color][color=#007700]()+[/color][color=#dd0000]" voi luong hang thang la: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getluong[/color][color=#007700]()); }}[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>class person (move your mouse to reveal the content)</noscript>
class person (open)
class person (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/* * to change this template, choose tools | templates * and open the template in the editor. */[/color][color=#0000bb]package unit16[/color][color=#007700]; [/color][color=#ff8000]/** * * @author quanghuy */[/color][color=#007700]public class [/color][color=#0000bb]person [/color][color=#007700]{ private [/color][color=#0000bb]string hoten[/color][color=#007700]; private [/color][color=#0000bb]int namsinh[/color][color=#007700]; private [/color][color=#0000bb]int mathe[/color][color=#007700]; public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]void setnamsinh[/color][color=#007700]([/color][color=#0000bb]int namsinh[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]void setmathe[/color][color=#007700]([/color][color=#0000bb]int mathe[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]string gethoten[/color][color=#007700](){ return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]int getnamsinh[/color][color=#007700](){ return [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]int getmathe[/color][color=#007700](){ return [/color][color=#0000bb]mathe[/color][color=#007700]; }}[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>sinhvien (move your mouse to reveal the content)</noscript>
sinhvien (open)
sinhvien (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/* * to change this template, choose tools | templates * and open the template in the editor. */[/color][color=#0000bb]package unit16[/color][color=#007700]; [/color][color=#ff8000]/** * * @author quanghuy */[/color][color=#007700]class [/color][color=#0000bb]sinhvien [/color][color=#007700]extends [/color][color=#0000bb]person [/color][color=#007700]{private [/color][color=#0000bb]double tienhocphi[/color][color=#007700]; public [/color][color=#0000bb]double gettienhocphi[/color][color=#007700]() { return [/color][color=#0000bb]tienhocphi[/color][color=#007700]; } public [/color][color=#0000bb]void settienhocphi[/color][color=#007700]([/color][color=#0000bb]double tienhocphi[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienhocphi [/color][color=#007700]= [/color][color=#0000bb]tienhocphi[/color][color=#007700]; }}[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>giangvien (move your mouse to reveal the content)</noscript>
giangvien (open)
giangvien (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/* * to change this template, choose tools | templates * and open the template in the editor. */[/color][color=#0000bb]package unit16[/color][color=#007700]; [/color][color=#ff8000]/** * * @author quanghuy */[/color][color=#007700]class [/color][color=#0000bb]giangvien [/color][color=#007700]extends [/color][color=#0000bb]person [/color][color=#007700]{ private [/color][color=#0000bb]int luong[/color][color=#007700]; public [/color][color=#0000bb]int getluong[/color][color=#007700]() { return [/color][color=#0000bb]luong[/color][color=#007700]; } public [/color][color=#0000bb]void setluong[/color][color=#007700]([/color][color=#0000bb]int luong[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]luong [/color][color=#007700]= [/color][color=#0000bb]luong[/color][color=#007700]; }}[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>giamdoc (move your mouse to reveal the content)</noscript>
giamdoc (open)
giamdoc (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/* * to change this template, choose tools | templates * and open the template in the editor. */[/color][color=#0000bb]package unit16[/color][color=#007700]; [/color][color=#ff8000]/** * * @author quanghuy */[/color][color=#007700]public class [/color][color=#0000bb]giamdoc [/color][color=#007700]extends [/color][color=#0000bb]person [/color][color=#007700]{ private [/color][color=#0000bb]int tientieu[/color][color=#007700]; public [/color][color=#0000bb]void settientieu[/color][color=#007700]([/color][color=#0000bb]int tientieu[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tientieu [/color][color=#007700]= [/color][color=#0000bb]tientieu[/color][color=#007700]; } public [/color][color=#0000bb]int gettientieu[/color][color=#007700]() { return [/color][color=#0000bb]tientieu[/color][color=#007700]; }}[/color]
</div>
</div>
-
02-11-2015, 07:00 AM #39Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>cho em nộp bài (move your mouse to reveal the content)</noscript>
cho em nộp bài (open)
cho em nộp bài (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>class nhân sự (move your mouse to reveal the content)</noscript>
class nhân sự (open)
class nhân sự (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package lesson16[/color][color=#007700]; public class [/color][color=#0000bb]nhansu [/color][color=#007700]{ private [/color][color=#0000bb]string hoten[/color][color=#007700];private [/color][color=#0000bb]float namsinh[/color][color=#007700];private [/color][color=#0000bb]double mathe[/color][color=#007700]; public [/color][color=#0000bb]string gethoten[/color][color=#007700]() {return [/color][color=#0000bb]hoten[/color][color=#007700];} public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700];} public [/color][color=#0000bb]float getnamsinh[/color][color=#007700]() {return [/color][color=#0000bb]namsinh[/color][color=#007700];} public [/color][color=#0000bb]void setnamsinh[/color][color=#007700]([/color][color=#0000bb]float namsinh[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]namsinh[/color][color=#007700];} public [/color][color=#0000bb]double getmathe[/color][color=#007700]() {return [/color][color=#0000bb]mathe[/color][color=#007700];} public [/color][color=#0000bb]void setmathe[/color][color=#007700]([/color][color=#0000bb]double mathe[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]mathe[/color][color=#007700];}}[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>class giảng viên (move your mouse to reveal the content)</noscript>
class giảng viên (open)
class giảng viên (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package lesson16[/color][color=#007700]; public class [/color][color=#0000bb]giangvien [/color][color=#007700]extends [/color][color=#0000bb]nhansu[/color][color=#007700]{private [/color][color=#0000bb]double luong[/color][color=#007700]; public [/color][color=#0000bb]double getluong[/color][color=#007700]() {return [/color][color=#0000bb]luong[/color][color=#007700];} public [/color][color=#0000bb]void setluong[/color][color=#007700]([/color][color=#0000bb]double luong[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]luong [/color][color=#007700]= [/color][color=#0000bb]luong[/color][color=#007700];} }[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>class sinh vien (move your mouse to reveal the content)</noscript>
class sinh vien (open)
class sinh vien (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package lesson16[/color][color=#007700]; public class [/color][color=#0000bb]sinhvien [/color][color=#007700]extends [/color][color=#0000bb]nhansu[/color][color=#007700]{ private [/color][color=#0000bb]double no[/color][color=#007700]; public [/color][color=#0000bb]double getno[/color][color=#007700]() {return [/color][color=#0000bb]no[/color][color=#007700];} public [/color][color=#0000bb]void setno[/color][color=#007700]([/color][color=#0000bb]double no[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]no [/color][color=#007700]= [/color][color=#0000bb]no[/color][color=#007700];} }[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>class giám đốc (move your mouse to reveal the content)</noscript>
class giám đốc (open)
class giám đốc (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package lesson16[/color][color=#007700]; public class [/color][color=#0000bb]giamdoc [/color][color=#007700]extends [/color][color=#0000bb]nhansu[/color][color=#007700]{ private [/color][color=#0000bb]double tientieu[/color][color=#007700]; public [/color][color=#0000bb]double gettientieu[/color][color=#007700]() {return [/color][color=#0000bb]tientieu[/color][color=#007700];} public [/color][color=#0000bb]void settientieu[/color][color=#007700]([/color][color=#0000bb]double tientieu[/color][color=#007700]) {[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tientieu [/color][color=#007700]= [/color][color=#0000bb]tientieu[/color][color=#007700];} }[/color]
</div>
</div>
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>main (move your mouse to reveal the content)</noscript>
main (open)
main (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package lesson16[/color][color=#007700]; [/color][color=#0000bb]import [/color][color=#007700]static [/color][color=#0000bb]java[/color][color=#007700].[/color][color=#0000bb]lang[/color][color=#007700].[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; public class [/color][color=#0000bb]truyvan [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]scanner input [/color][color=#007700]= new [/color][color=#0000bb]scanner [/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]giangvien gv [/color][color=#007700]= new [/color][color=#0000bb]giangvien[/color][color=#007700](); [/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ho ten giang vien: "[/color][color=#007700]);[/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam sinh: "[/color][color=#007700]);[/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]setnamsinh[/color][color=#007700]([/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); [/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ma the: "[/color][color=#007700]);[/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]setmathe[/color][color=#007700]([/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700]()); [/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"luong: "[/color][color=#007700]);[/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]setluong[/color][color=#007700]([/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700]()); [/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"giang vien " [/color][color=#007700]+ [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]());[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"sinh nam: " [/color][color=#007700]+ [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]getnamsinh[/color][color=#007700]());[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ma the: " [/color][color=#007700]+ [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]getmathe[/color][color=#007700]());[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"luong: " [/color][color=#007700]+ [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]getluong[/color][color=#007700]());} }[/color]
</div>
</div>
</blockquote></div>
</div>
</div>
-
03-10-2015, 07:00 AM #40Junior Member
- Ngày tham gia
- Jul 2014
- Bài viết
- 0
Mã nguồn PHP:[color=#000000]
import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; [/color][color=#ff8000]/** * created by whynotme on 09/03/2015. */[/color][color=#007700]class [/color][color=#0000bb]thongtin [/color][color=#007700]{ private [/color][color=#0000bb]string hoten[/color][color=#007700]; private [/color][color=#0000bb]int namsinh[/color][color=#007700]; private [/color][color=#0000bb]string mathe[/color][color=#007700]; public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]void setnamsinh[/color][color=#007700]([/color][color=#0000bb]int namsinh[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]void setmathe[/color][color=#007700]([/color][color=#0000bb]string mathe[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mathe [/color][color=#007700]= [/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]string gethoten[/color][color=#007700]() { return [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]int getnamsinh[/color][color=#007700]() { return [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]string getmathe[/color][color=#007700]() { return [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mathe[/color][color=#007700]; } public [/color][color=#0000bb]void input[/color][color=#007700]() { [/color][color=#0000bb]scanner sc [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap ho ten vao day :"[/color][color=#007700]); [/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap nam sinh vao day :"[/color][color=#007700]); [/color][color=#0000bb]setnamsinh[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); [/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap ma the vao day :"[/color][color=#007700]); [/color][color=#0000bb]setmathe[/color][color=#007700]([/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); } public [/color][color=#0000bb]void output[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ho ten : " [/color][color=#007700]+ [/color][color=#0000bb]gethoten[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam sinh : " [/color][color=#007700]+ [/color][color=#0000bb]getnamsinh[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ma the : " [/color][color=#007700]+ [/color][color=#0000bb]getmathe[/color][color=#007700]()); }} class [/color][color=#0000bb]sinhvien [/color][color=#007700]extends [/color][color=#0000bb]thongtin [/color][color=#007700]{ private [/color][color=#0000bb]int tienhocphi[/color][color=#007700]; public [/color][color=#0000bb]void settienhocphi[/color][color=#007700]([/color][color=#0000bb]int tienhocphi[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienhocphi [/color][color=#007700]= [/color][color=#0000bb]tienhocphi[/color][color=#007700]; } public [/color][color=#0000bb]int gettienhocphi[/color][color=#007700]() { return [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienhocphi[/color][color=#007700]; } public [/color][color=#0000bb]void inputsv[/color][color=#007700](){ [/color][color=#0000bb]scanner scsv [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap tien hoc phi"[/color][color=#007700]); [/color][color=#0000bb]settienhocphi[/color][color=#007700]([/color][color=#0000bb]scsv[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); } public [/color][color=#0000bb]void outputsv[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tien hoc phi :" [/color][color=#007700]+ [/color][color=#0000bb]gettienhocphi[/color][color=#007700]()); }} class [/color][color=#0000bb]giangvien [/color][color=#007700]extends [/color][color=#0000bb]thongtin [/color][color=#007700]{ private [/color][color=#0000bb]int tienluong[/color][color=#007700]; public [/color][color=#0000bb]void settienluong[/color][color=#007700]([/color][color=#0000bb]int tienhocphi[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienluong [/color][color=#007700]= [/color][color=#0000bb]tienhocphi[/color][color=#007700]; } public [/color][color=#0000bb]int gettienluong[/color][color=#007700]() { return [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tienluong[/color][color=#007700]; } public [/color][color=#0000bb]void inputgv[/color][color=#007700](){ [/color][color=#0000bb]scanner scsv [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap tien luong"[/color][color=#007700]); [/color][color=#0000bb]settienluong[/color][color=#007700]([/color][color=#0000bb]scsv[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); } public [/color][color=#0000bb]void outputgv[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tien luong :" [/color][color=#007700]+ [/color][color=#0000bb]gettienluong[/color][color=#007700]()); }} class [/color][color=#0000bb]giamdoc [/color][color=#007700]extends [/color][color=#0000bb]thongtin [/color][color=#007700]{ private [/color][color=#0000bb]int tientieuhangthang[/color][color=#007700]; public [/color][color=#0000bb]void settientieuhangthang[/color][color=#007700]([/color][color=#0000bb]int tienhocphi[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tientieuhangthang [/color][color=#007700]= [/color][color=#0000bb]tienhocphi[/color][color=#007700]; } public [/color][color=#0000bb]int gettientieuhangthang[/color][color=#007700]() { return [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tientieuhangthang[/color][color=#007700]; } public [/color][color=#0000bb]void inputgd[/color][color=#007700]() { [/color][color=#0000bb]scanner scsv [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap tien tieu hang thang"[/color][color=#007700]); [/color][color=#0000bb]settientieuhangthang[/color][color=#007700]([/color][color=#0000bb]scsv[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); } public [/color][color=#0000bb]void outputgd[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tien tieu hang thang :" [/color][color=#007700]+ [/color][color=#0000bb]gettientieuhangthang[/color][color=#007700]()); }}class [/color][color=#0000bb]information [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]scanner sc [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]sinhvien sv [/color][color=#007700]= new [/color][color=#0000bb]sinhvien[/color][color=#007700](); [/color][color=#0000bb]giangvien gv [/color][color=#007700]= new [/color][color=#0000bb]giangvien[/color][color=#007700](); [/color][color=#0000bb]giamdoc gd [/color][color=#007700]= new [/color][color=#0000bb]giamdoc[/color][color=#007700](); [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]input[/color][color=#007700](); [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]inputgv[/color][color=#007700](); [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]output[/color][color=#007700](); [/color][color=#0000bb]gv[/color][color=#007700].[/color][color=#0000bb]outputgv[/color][color=#007700](); }}[/color]
"căn do xuất tinh ngược này do lượng đường cao dẫn tới thương tổn dây thần kinh tại các cơ vòng khiến người bệnh bị xuất tinh ngược. thường ngày, khi xuất tinh thì cơ thắt cổ bọng đái đóng lại để...
Nguyên nhân và giải pháp cho tình trạng không xuất tinh ở phái mạnh?