java提示需要标识符是什么意思?求大神解答。急!!!! 5
importjava.io.*;publicclassperson1{Stringa="基础职业:";privateStringname;floatnum1;intstr...
import java.io.*;
public class person1
{
String a="基础职业:";
private String name;
float num1;
int str1;
BufferedReader buf;
buf=new BufferedReader(new InputStreamReader(System.in));
str1=buf.readLine();
num1=Integer.parseInt(str1);
class dn
{
String zhuangtai;
public void dn(String zt)
{
zhuangtai=zt;
}
public void show()
{
int c;
String str2;
BufferedReader cuf;
cuf=new BufferedReader(new InputStreamReader(System.in));
str2=cuf.readLine();
c=Integer.parseInt(str2);
if(c==1)
{
System.out.println("机械大师");
}
if(c==2)
{
System.out.println("重炮手");
}
}
}
public person1(String n)
{
name=n;
}
public void show1()
{
System.out.println(a+""+name);
System.out.println("转职:"+"1"+" "+"or"+" "+"2");
}
public void show2()
{
dn d=new d("二转");
System.out.println(zhuangtai+"转职:"+"1"+" "+"or"+" "+"2");
d.show();
}
public void or()
{
if(num1==1)
{
System.out.println("工程师");
}
if(num1==2)
{
System.out.println("圣士");
}
}
public static void main(String[] args)throws IOException
{
person1 p=new person1("学者");
p.show1();
p.or();
p.show2();
}
} 展开
public class person1
{
String a="基础职业:";
private String name;
float num1;
int str1;
BufferedReader buf;
buf=new BufferedReader(new InputStreamReader(System.in));
str1=buf.readLine();
num1=Integer.parseInt(str1);
class dn
{
String zhuangtai;
public void dn(String zt)
{
zhuangtai=zt;
}
public void show()
{
int c;
String str2;
BufferedReader cuf;
cuf=new BufferedReader(new InputStreamReader(System.in));
str2=cuf.readLine();
c=Integer.parseInt(str2);
if(c==1)
{
System.out.println("机械大师");
}
if(c==2)
{
System.out.println("重炮手");
}
}
}
public person1(String n)
{
name=n;
}
public void show1()
{
System.out.println(a+""+name);
System.out.println("转职:"+"1"+" "+"or"+" "+"2");
}
public void show2()
{
dn d=new d("二转");
System.out.println(zhuangtai+"转职:"+"1"+" "+"or"+" "+"2");
d.show();
}
public void or()
{
if(num1==1)
{
System.out.println("工程师");
}
if(num1==2)
{
System.out.println("圣士");
}
}
public static void main(String[] args)throws IOException
{
person1 p=new person1("学者");
p.show1();
p.or();
p.show2();
}
} 展开
3个回答
展开全部
float num1;
int str1;
BufferedReader buf;
这三个对象加上标示符(例如public 或则private )
int str1;
BufferedReader buf;
这三个对象加上标示符(例如public 或则private )
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把代码写规范了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询