import java.util.*;
public class PH5 { /**
 * @param args
 */
public static void main(String[] args) {
SendFlft sendflft=new SendFlft();
SendFlft sendflft1=new SendFlft();
Scanner input=new Scanner(System.in);
System.out.print("请输入会员号:");
int huiyuan=input.nextInt();
System.out.print("请输入会员积分:");
int score=input.nextInt();

if(score>=8000&&score<15000){

sendflft.shouji="诺基亚N73手机";

System.out.print("sendflft");
}else if(score>=15000){

sendflft1.diannao="苹果笔记本电脑";
System.out.print("sendflft1");
}else{
System.out.print("对不起,积分不够");
} }
使用面向对象的思想实现物品回赠.
不知道错在哪里了 晕

解决方案 »

  1.   

    Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
    SendFlft cannot be resolved to a type
    SendFlft cannot be resolved to a type
    SendFlft cannot be resolved to a type
    SendFlft cannot be resolved to a type at PH5.main(PH5.java:8)
    报错的信息
      

  2.   

    SendFlft cannot be resolved to a type :是没有找到SendFlft类,你看看是你是不是拼写有误呀??
      

  3.   

    import java.util.*; 
    public class PH5 {     public static void main(String[] args) { 
            SendFlft sendflft=new SendFlft(); 
            SendFlft sendflft1=new SendFlft(); 
            Scanner input=new Scanner(System.in); 
            System.out.print("请输入会员号:"); 
            int huiyuan=input.nextInt(); 
            System.out.print("请输入会员积分:"); 
            int score=input.nextInt(); 
            if(score>=8000&&score <15000){ 
                sendflft.shouji="诺基亚N73手机"; 
            System.out.print(sendflft.shouji); 
            }else if(score>=15000){ 
                sendflft.diannao="苹果笔记本电脑"; 
                System.out.print(sendflft.diannao); 
            }else{ 
            System.out.print("对不起,积分不够"); 
            }  
        }
    }
    class SendFlft {
    public String shouji=null;
    public String diannao=null;
    }
    应该满足楼主的条件,只是没有面向对象的优雅性,自己添加一些get() set()方法,程序会更漂亮