java獲取內(nèi)存地址的數(shù)據(jù) 1.定義一個(gè)結(jié)構(gòu)體變量,起成員項(xiàng)包括員工號(hào),姓名,工齡,工資,輸入所需的具體數(shù)據(jù),然后輸出?
1.定義一個(gè)結(jié)構(gòu)體變量,起成員項(xiàng)包括員工號(hào),姓名,工齡,工資,輸入所需的具體數(shù)據(jù),然后輸出?用Java編寫(xiě),相對(duì)簡(jiǎn)單,定義一個(gè)employee對(duì)象。public class person{int nu
1.定義一個(gè)結(jié)構(gòu)體變量,起成員項(xiàng)包括員工號(hào),姓名,工齡,工資,輸入所需的具體數(shù)據(jù),然后輸出?
用Java編寫(xiě),相對(duì)簡(jiǎn)單,定義一個(gè)employee對(duì)象。
public class person{
int number
String name
雙薪,
int workYears
public static void main(String args[]){
person p=new petson()
scanner sc=new scanner(系統(tǒng)輸入)
系統(tǒng)輸出打?。ā闭?qǐng)輸入員工編號(hào)、姓名,工資和工齡順序“
p.number=sc.nextInt公司()
p.name=sc.nextString公司()
p.salary=nextDouble()
p.workYears=nextInt()系統(tǒng)輸出打?。ā皢T工信息如下,員工編號(hào):”p.number“,姓名:”p.name“,工資:”p.salary“,工齡:”p.workyears)]}