Java题目,求大神帮忙看看怎么修改,一直有两处错误? 10C

package tf1703;

import java.awt.Color;
import java.awt.Graphics;

//import Tank.Direction;

public class Tank {
public int x,y,w,h;

Enum Direction{L,LU,U,RU,R,RD,D,LD,STOP};
public Direction dir=Direction.U;

public Tank(int x,int y,int w,int h,Direction dir) {
    this.x=x;
    this.y=y;
    this.w=w;
    this.h=h;
    this.dir=dir;
}

public void draw(Graphics g) {
    g.setColor(Color.green);
    g.fillOval(x,y,w,h);
    switch(this.dir) {
    case U:
        g.setColor(Color.black);
        g.drawLine(x+w/2, y+h/2, x+w/2, y-10);
        break;
    case LU:
        g.setColor(Color.black);
        g.drawLine(x+w/2, y+h/2, x, y);
        break;
    case L:
        g.setColor(Color.black);
        g.drawLine(x+w/2, y+h/2, x-10, y+h/2);
        break;
    case LD:
        g.setColor(Color.black);
        g.drawLine(x+w/2, y+h/2, x, y+h);
        break;
    case D:
        g.setColor(Color.black);
        g.drawLine(x+w/2, y+h/2, x+w/2, y+h+10);
        break;
    case RD:
        g.setColor(Color.black);
        g.drawLine(x+w/2, y+h/2, x+w, y+h);
        break;
    case R:
        g.setColor(Color.black);
        g.drawLine(x+w/2, y+h/2, x+w+10, y+h/2);
        break;
    case RU:
        g.setColor(Color.black);
        g.drawLine(x+w/2, y+h/2, x+w, y);
        break;
    }
}

}

package tf1703;

import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import tf1703.Tank.Direction;

public class TFrame extends Frame{
public int frameX=100;
public int frameY=100;
public int frameH=800;
public int frameW=1200;

public Tank myTank=null;

public TFrame() {
    this.setBounds(frameX,frameY,frameW,frameH);
    this.setBackground(Color.pink);

    this.myTank=new Tank(200,200,100,100,Tank.Direction.RU);

    this.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(-1);
        }
    });

    this.addKeyListener(new KeyAdapter() {
        public void keyPressed(KeyEvent e) {

            if(e.getKeyCode()==KeyEvent.VK_A) {
                System.out.println("你按了A");
                myTank.dir=Direction.L;
                myTank.x=myTank.x-10;

            }else if(e.getKeyCode()==KeyEvent.VK_S) {
                System.out.println("你按了S");
                myTank.dir=Direction.D;
                myTank.y=myTank.y+10;
            }
            else if(e.getKeyCode()==KeyEvent.VK_D) {
                System.out.println("你按了D");
                myTank.dir=Direction.R;
                myTank.x=myTank.x+10;
            }

            else if(e.getKeyCode()==KeyEvent.VK_W) {
                System.out.println("你按了W");
                myTank.dir=Direction.U;
                myTank.y=myTank.y-10;
            }
            repaint();
        }

    });



    this.setVisible(true);

}

public void paint(Graphics g) {
    this.myTank.draw(g);


}

public static void main(String[] args) {

    new TFrame();

}

}

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The import tf1703.Tank.Direction cannot be resolved
Cannot make a static reference to the non-static field Tank.Direction
Direction cannot be resolved to a type
Direction cannot be resolved to a variable
Direction cannot be resolved to a type
Direction cannot be resolved to a variable
Direction cannot be resolved to a type
Direction cannot be resolved to a variable
Direction cannot be resolved to a type
Direction cannot be resolved to a variable

at tf1703.TFrame.<init>(TFrame.java:9)
at tf1703.TFrame.main(TFrame.java:86)

3个回答

在Tank.Direction的定义前添加static,如:
static Enum Direction{L,LU,U,RU,R,RD,D,LD,STOP};

weixin_43436017
weixin_43436017 改了后还是一样报错呀
11 个月之前 回复

Enum Direction{L,LU,U,RU,R,RD,D,LD,STOP}; 这个你应该单独在 包里面新建一个 class文件,, enum类型。 再放入那几个值。
图片说明

whandwho
大川里的小川人 回复weixin_43436017: 传了图片了。
11 个月之前 回复
whandwho
大川里的小川人 回复weixin_43436017: 传了图片了
11 个月之前 回复
weixin_43436017
weixin_43436017 没法建,您可以截下屏让我看一下吗
11 个月之前 回复
weixin_43436017
weixin_43436017 哦哦,那文件名写什么
11 个月之前 回复

提示 tf1703.Tank.Direction包没找到,这个包可能没有成功引入,重新clean下项目试试

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求大神帮忙看看修改修改
做个导出功能rn当点击导出rn1.在服务器端创建个文件.exclern2,.将数据库出来的数据集 rn3.客户端 将此文件下载 并删除服务器端的文件rn以下是创建文件rnimport java.io.BufferedReader;rnimport java.io.File;rnimport java.io.IOException;rnrnpublic class CreatFile rn rn public static BufferedReader bufread;rn rn //指定文件路径和名称rn private static String path = "G:\\ls\\" + 2+ ".xls";rn private static File filename = new File(path);rn private static String readStr ="";rnrnrn /** *//**rn * 创建文本文件.rn * @throws IOException rn * rn */rn public static void creatTxtFile() throws IOExceptionrn if (!filename.exists()) rn filename.createNewFile();rn System.err.println(filename + "已创建!");rn rn rnrn
帮忙看看错误怎么修改
[code=php]$pagecount)rnrn $pageno=$pagecount; //当前页数大于总页数时显示总页数rnrn$startno=($pageno-1)*$pagesize; //每页从第几条数据开始显示rn$sql="select * from yx_books where ".$_POST['seltype']." like ('%".$_POST['coun']."%') order by id desc limit $startno,$pagesize";rn$rs=mysqli_query($link,$sql);rn?>[img=https://img-bbs.csdn.net/upload/201705/25/1495712842_419056.png][/img][/code]
求大神帮忙 看看!!
Fatal error: Call to a member function recordcount() on a non-object in C:\Users\Administrator\Desktop\oecsm\Apache2\htdocs\classes\user.class.php on line 34rnrnrn项目更改数据库之后就报这个错!
求大神帮忙,!看看
/* 题目:一球从100米高度自由落下,rn * 每次落地后反跳回原高度的一半;rn * 再落下,求它在 第N次落地时,共经过多少米?rn * 第N次反弹多高?(将处理写到方法中,rn * 并且方法需要带一个参数,该参数表示第N次落地)rn */import java.util.Scanner;rnpublic class Test3 rnrn rn public static double method(int k)rn rn double sum=100;rn double h=100;rn for(int i=1;i<=k;i++)rn rn sum+=h/2*2;rn h=h/2;rn rn return sum;rn rn rn rnrn public static void main(String[] args)rn rn Scanner scanner=new Scanner(System.in);rn System.out.println("请输入第N次数:");rn int n=scanner.nextInt();rn double y=method(n);rn System.out.println(y);rnrn rn rn rn rn rn rnrn我的方案不行!求大神帮忙!rn
求大神帮忙看看
public static void main(String[] args)rn System.out.println(getFormatNum("0.000",1.2224));rn System.out.println(getFormatNum("0.000",1.2225));rn System.out.println(getFormatNum("0.000",1.2226));rn System.out.println(getFormatNum("0.000",0.2224));rn System.out.println(getFormatNum("0.000",0.2225));rn System.out.println(getFormatNum("0.000",0.2226));rn System.out.println(getFormatNum("0.000",2.4924));rn System.out.println(getFormatNum("0.000",2.4925));rn System.out.println(getFormatNum("0.000",2.4926));rn rn rn public static Double getFormatNum(String pattren,Double data)rn String reStr = "";rn reStr = new java.text.DecimalFormat(pattren).format(data); rn return Double.parseDouble(reStr);rn rn为什么执行结果会是rn1.222rn1.222rn1.223rn0.222rn0.223rn0.223rn2.492rn2.493rn2.493rn当个位为1时并没有按照四舍五入的规则执行
求大神帮忙修改
//【2】任意输入一个由不超过100个小写英文字母组成的字符串。rn//(1)分别统计各字母出现的个数,按英文字母表的顺序分行显示。若该字母出现字数为0,则不必显示。rn[color=#FF0000]//(2)按照出现次数由大到小排序,在一行内依次显示各字母,次数为0的不显示。[/color][color=#FF0000]排序后字母变了,怎么改。[/color]rnrn#includern#includernrnvoid tongji(char str[], int result1[])rnrn int i=0;rn while(str[i]!= '\0')rn rn if ( str[i]>='a' && str[i]<='z')rn rn result1[str[i]-'a']++;rn rn i++;rn rnrnrnvoid sort(int a[],int n)rnrn int k,j;rn for (j=1;j0)rn rn printf("%c的次数: %5d\n", 'a'+i,result[i]); rn rn rnrn sort(result,i);rnrn [color=#FF0000]for (i=0; i<26; i++)rn rn if(result[i]>0)rn rn printf("%c的次数: %5d\n", 'a'+i,result[i]); rn rn rn [/color]rn return 0;rn
求大神帮忙看看~
";rn $datanum = mysqli_num_rows($result);rn echo "共有".$totalnum."条留言,每页".$pagesize."条,共".$totalpage."页。 ";rn for( $i = 1; $i <= $totalpage; $i++)rn echo "[".$i."] ";rn rn echo " ";rn 43 $query = "select * from message order by addtime desc limit $begin,$pagesize";rn 44 $result = mysqli_query($link,$query);rn 45 $datanum = mysqli_num_rows($result);rn for( $i = 1; $i <= $datanum; $i++)//$datanum???rn $info = mysqli_fetch_array($result);rn echo " ".$row['author']."rn ".$row['addtime']."rn ".$row['content']."";rn rn mysqli_close($link)rn ?>rnrnrnrnrnrnrnrnwamp报错:Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\wamp64\www\message\ceshi1.php on line 45rnrn $datanum = mysqli_num_rows($result);也就是这一行错误,跪求~
求大神帮忙看看!!!
>>> a = [1, 2]rn>>> b = arn>>> print b.append(3)rnNonernrnrnrn我查看了 a 和b的id, 是一样的 rnprint b 也确实显示出 【1, 2】rnrn为什么 调用append()方法打印出来是None。rnrn是赋值只是把值赋值过去,列表的方法不能调用?
求大神帮忙看看这个错误
0 0x105dbf342 __assert_rtn + 144n1 0x105dfa2c6 archive::File::makeObjectFileForMember(archive::File::Entry const*) const + 1138n2 0x105df9c74 archive::File::justInTimeforEachAtom(char const*, ld::File::AtomHandler&) const + 122n3 0x105e12a75 ld::tool::InputFiles::searchLibraries(char const*, bool, bool, bool, ld::File::AtomHandler&) const + 265n4 0x105e1bdb8 ld::tool::Resolver::resolveUndefines() + 160n5 0x105e1e117 ld::tool::Resolver::resolve() + 79n6 0x105dc0060 main + 812n7 0x7fff928705ad start + 1nA linker snapshot was created at:n /tmp/yuefei-2016-00-04-174524.ld-snapshotnld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-253.9/src/ld/parsers/archive_file.cpp, line 355.nclang: error: linker command failed with exit code 1 (use -v to see invocation)
sql建表错误,求大神帮忙看看
drop table if exists t_progress_display;nn/*==============================================================*/n/* Table: t_progress_display */n/*==============================================================*/ncreate table t_progress_displayn(n id national varchar(32) not null,n create_time datetime default NULL comment '创建时间',n create_user varchar(32) default NULL comment '创建人',n update_time datetime default NULL comment '修改时间',n update_user varchar(32) default NULL comment '修改人',n institutions varchar(32) comment '所属驻外机构',n prj_id national varchar(32) comment '工程编码',n prj_name varchar(512) comment '工程名称',n post_sub_name varchar(512) comment '分指',n part_name varchar(512) comment '标段',n Item_name national varchar(120) comment '分项名称',n finish_fact national int,n plan_prj national int,n unit national varchar(10) comment '工程量单位',n finish_month_f int comment '本月完成比例',n plan_prj_month int comment '本月计划',n total_start int comment '开工累计',n total_percent double comment '累计完成比例',n total_year int comment '本年累计',n plan_prj_year int comment '本年计划',n name national varchar(120) comment '名称',n plan_start_date date comment '计划开始日期',n plan_end_date date comment '计划结束时间',n start_date date comment '实际开始时间',n end_date date comment '实际结束时间',n state int default 0,n primary key (id)n);n![图片说明](https://img-ask.csdn.net/upload/201701/17/1484636558_705713.png)
求大神们帮忙看看错误在哪
use warnings;use strict;open(INFILE, &quot;/Users/lizeshuo/Desktop/test2.txt&quot;) ||   die &quot;Cannot open the newfile: $!\n&quot;;open(OUTFILE, &quot;&amp;gt;test3.txt&quot;) ||   die &quot;Cannot open the newfile: $!\n&quot;;my @a;while (...
求大神帮忙看看,这个是什么错误
[code=text]07-26 18:13:19.311: E/StrictMode(13027): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.rn07-26 18:13:19.311: E/StrictMode(13027): java.lang.Throwable: Explicit termination method 'release' not calledrn07-26 18:13:19.311: E/StrictMode(13027): at dalvik.system.CloseGuard.open(CloseGuard.java:184)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.Surface.(Surface.java:294)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.SurfaceView.(SurfaceView.java:96)rn07-26 18:13:19.311: E/StrictMode(13027): at java.lang.reflect.Constructor.constructNative(Native Method)rn07-26 18:13:19.311: E/StrictMode(13027): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.createView(LayoutInflater.java:587)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:643)rn07-26 18:13:19.311: E/StrictMode(13027): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)rn07-26 18:13:19.311: E/StrictMode(13027): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)rn07-26 18:13:19.311: E/StrictMode(13027): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)rn07-26 18:13:19.311: E/StrictMode(13027): at android.app.Activity.setContentView(Activity.java:1881)rn07-26 18:13:19.311: E/StrictMode(13027): at com.thinkerx.kshow.zxing.MipcaActivityCapture.onCreate(MipcaActivityCapture.java:47)rn07-26 18:13:19.311: E/StrictMode(13027): at android.app.Activity.performCreate(Activity.java:5104)rn07-26 18:13:19.311: E/StrictMode(13027): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)rn07-26 18:13:19.311: E/StrictMode(13027): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)rn07-26 18:13:19.311: E/StrictMode(13027): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)rn07-26 18:13:19.311: E/StrictMode(13027): at android.app.ActivityThread.access$600(ActivityThread.java:141)rn07-26 18:13:19.311: E/StrictMode(13027): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)rn07-26 18:13:19.311: E/StrictMode(13027): at android.os.Handler.dispatchMessage(Handler.java:99)rn07-26 18:13:19.311: E/StrictMode(13027): at android.os.Looper.loop(Looper.java:137)rn07-26 18:13:19.311: E/StrictMode(13027): at android.app.ActivityThread.main(ActivityThread.java:5041)rn07-26 18:13:19.311: E/StrictMode(13027): at java.lang.reflect.Method.invokeNative(Native Method)rn07-26 18:13:19.311: E/StrictMode(13027): at java.lang.reflect.Method.invoke(Method.java:511)rn07-26 18:13:19.311: E/StrictMode(13027): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)rn07-26 18:13:19.311: E/StrictMode(13027): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)rn07-26 18:13:19.311: E/StrictMode(13027): at dalvik.system.NativeStart.main(Native Method)rn[/code]rnrn调用扫描二维码,从拍照界面返回到原来界面时,动一下就报错,求人帮忙看看这个什么错误,为何在平板上报错,在我的手机上却能正常运行
求大神帮忙看看 是哪里的错误
[img=https://img-bbs.csdn.net/upload/201511/18/1447814960_170082.png][/img]
spring 路径错误,求大神帮忙看看
idea里面报错No mapping found for HTTP request with URI [/owl_studio_account_transaction/user/loginwithphonenum.do] in DispatcherServlet with name 'spring'rn页面报错rnHTTP Status 404 -rnrntype Status reportrnrnmessagernrndescription The requested resource is not available.rnrnApache Tomcat/7.0.70rn这是哪里出了什么问题啊rnweb.xml如下:rnrn springrn org.springframework.web.servlet.DispatcherServletrn rn contextConfigLocationrn classpath:conf/*.xmlrn rn 1rn rn rn springrn *.dorn
java.lang.ClassNotFoundException: com.chat.common.User错误,求大神帮忙看看
public ChatServer()rn rn try rn System.out.println("我是服务器在8888监听...");rn ServerSocket ss=new ServerSocket(8888);rn while(true)rn rn Socket s=ss.accept();rn rn //接受客户发来的信息rn ObjectInputStream ois=new ObjectInputStream(s.getInputStream());rn //User u=(User)ois.readObject();rn Object o = ois.readObject();rn System.out.println(o.getClass());rn User u = (User) o;rn System.out.println("服务器接收到的ID:"+u.getUserId()+" 密码:"+u.getPasswd());rn Message m=new Message();rn ObjectOutputStream oos=new ObjectOutputStream(s.getOutputStream());rn if(u.getPasswd().equals("123456"))rn rn rn m.setMesType("1");rn oos.writeObject(m);rn rn elsern m.setMesType("2");rn oos.writeObject(m);rn //关闭连接rn s.close();rn rn rn rn rnrnrnpublic boolean sendLoginInfoToServer(Object o)rn rn boolean b=false;rn try rn System.out.println("正在连接...");rn Socket s=new Socket("127.0.0.1",8888);rn ObjectOutputStream oos=new ObjectOutputStream(s.getOutputStream());rn User u = (User) o;rn oos.writeObject(u);rn rn ObjectInputStream ois=new ObjectInputStream(s.getInputStream());rn rn Message ms=(Message)ois.readObject();rn if(ms.getMesType().equals("1"))rn rn b=true;rn rn rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finallyrn rn rn return b;rn rnrnrnpublic class User implements Serializablern private static final long serialVersionUID = 511142319526449270L;rn private String userId;rn private String passwd;rn public String getUserId() rn return userId;rn rn public void setUserId(String userId) rn this.userId = userId;rn rn public String getPasswd() rn return passwd;rn rn public void setPasswd(String passwd) rn this.passwd = passwd;rn rnrnpublic class Message implements java.io.Serializablern rn private String mesType;rnrn public String getMesType() rn return mesType;rn rnrn public void setMesType(String mesType) rn this.mesType = mesType;rn rnrn调用rn private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) rn // TODO add your handling code here:rn System.out.println("OK");rn// new ChatFriendList();rn// this.dispose();rn if(evt.getSource()==jButton2)rn rn ChatClientUser chatClientUser=new ChatClientUser();rn User u=new User();rn u.setUserId(jTextField1.getText().trim());rn u.setPasswd(new String(jPasswordField1.getPassword()));rn //chatClientUser.checkUser(u);rn if(chatClientUser.checkUser(u))rn rn new ChatFriendList();rn //关闭登陆界面rn this.dispose();rn elsern JOptionPane.showMessageDialog(this,"用户名或密码错误!");rn rn rn rnrn错误rnjava.lang.ClassNotFoundException: com.chat.common.Userrn at java.net.URLClassLoader$1.run(URLClassLoader.java:200)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:188)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:307)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:252)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn at java.lang.Class.forName0(Native Method)rn at java.lang.Class.forName(Class.java:247)rn at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)rn at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)rn at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)rn at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)rn at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)rn at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)rn at com.chat.server.model.ChatServer.(ChatServer.java:23)rn at com.chat.server.view.ServerFrame.jb1ActionPerformed(ServerFrame.java:75)rn at com.chat.server.view.ServerFrame.access$0(ServerFrame.java:71)rn at com.chat.server.view.ServerFrame$1.actionPerformed(ServerFrame.java:41)rn at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)rn at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)rn at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)rn at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)rn at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)rn at java.awt.Component.processMouseEvent(Component.java:6216)rn at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)rn at java.awt.Component.processEvent(Component.java:5981)rn at java.awt.Container.processEvent(Container.java:2041)rn at java.awt.Component.dispatchEventImpl(Component.java:4583)rn at java.awt.Container.dispatchEventImpl(Container.java:2099)rn at java.awt.Component.dispatchEvent(Component.java:4413)rn at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)rn at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)rn at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)rn at java.awt.Container.dispatchEventImpl(Container.java:2085)rn at java.awt.Window.dispatchEventImpl(Window.java:2475)rn at java.awt.Component.dispatchEvent(Component.java:4413)rn at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)rn at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)rn at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)rn at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)rn at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)rn at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)rn at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
求就帮忙,一直有错误
rn [code=vb] Private Sub AddFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddFile.Clickrnrn Dim pGxDlg As IGxDialogrn Dim pSelObjects As IEnumGxObjectrn Dim pGxFilter As IGxObjectFilterrnrn '对话框用于打开数据集,即所打开的数据类型为“GxFilterDatasets”,当然还有其它类型,请参考帮助。rn pGxFilter = New GxFilterDatasetsrn pGxDlg = New GxDialogrn pGxDlg.ObjectFilter = pGxFilterrn '这里只允许单选,不可以同时选择多个数据集rn pGxDlg.AllowMultiSelect = Falsern '对话框的标题rn pGxDlg.Title = "打开数据集"rn If pGxDlg.DoModalOpen(SceneCtrl.hWnd, pSelObjects) Thenrn 'pGxDataset为所选中的数据集rn Dim pGxDataset As IGxDatasetrn pGxDataset = pSelObjects.Nextrn '若未选中数据集,则退出rn If pGxDataset Is Nothing Then Exit Subrn Dim pDataset As esriGeoDatabase.IDatasetrn pDataset = pGxDataset.Datasetrn '打开的数据类型为Shapefile或FeatureClassrn If (TypeOf pDataset Is IFeatureClass) Thenrn Dim pFeatLayer As IFeatureLayerrn pFeatLayer = New FeatureLayerrn pFeatLayer.FeatureClass = pDatasetrn pFeatLayer.Name = pDataset.Namern SceneCtrl.Scene.AddLayer(pFeatLayer)rn End Ifrn '打开的数据类型为TINDatasetrn If (TypeOf pDataset Is ITin) Thenrn Dim pTinLayer As ITinLayerrn pTinLayer = New TinLayerrn pTinLayer.Dataset = pDatasetrn pTinLayer.Name = pDataset.Namern SceneCtrl.Scene.AddLayer(pTinLayer)rn End Ifrn '打开的数据类型为RasterDatasetrn If (TypeOf pDataset Is IRasterDataset) Thenrn Dim pRSLayer As IRasterLayerrn pRSLayer = New RasterLayerrn pRSLayer.CreateFromDataset(pDataset)rn pRSLayer.Name = pDataset.Namern SceneCtrl.Scene.AddLayer(pRSLayer)rn End Ifrn Elsern MsgBox("未选择数据打开!")rn Exit Subrn End Ifrn End SubrnrnEnd Class[/code]rn
求帮忙看看,怎么一直报错
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="cityTest.aspx.cs" Inherits="DTcms.Web.admin.city.cityTest" %>rnrnrnrnrnrn 城市rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rnrnrn
求大神帮忙看看运行maven install错误怎么解决
[code=java][ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: 1 problem was encountered while building the effective model for org.apache.maven.plugins:maven-clean-plugin:2.5rn[ERROR] [FATAL] Non-parseable POM C:\Users\lenovo\.m2\repository\org\apache\maven\maven-parent\21\maven-parent-21.pom: entity reference names can not start with character '&' (position: START_TAG seen ...Firefox\') > -1; var isSafari = userAgent.indexOf(\'Safari\') > -1 &&... @3:114) @ C:\Users\lenovo\.m2\repository\org\apache\maven\maven-parent\21\maven-parent-21.pom, line 3, column 114[/code]rn如题 感觉好像是maven版本不对啊
求大神帮忙看看怎么错了
#include n#includenconst double PI = 3.14;nmain() nn ndouble r,h,C1,Sa,Sb,Va,Vb;nscanf("%lf%lf",&r,&h);nC1=2*PI*r;nSa=PI*r*r;nSb=4*PI*r*r;nVa=4.0/3*PI*r*r*r;nVb=PI*r*r*h;nprintf("C1=%.2lf\nSa=%.2lf\nSb=%.2lf\nVa=%.2lf\nVb=%.2lf\n",C1,Sa,Sb,Va,Vb);nnnn return 0;![图片](https://img-ask.csdn.net/upload/201510/30/1446167990_902483.png)![图片](https://img-ask.csdn.net/upload/201510/30/1446167995_432707.png)
帮忙看看程序中的错误怎么修改~~~~
class BookManagernrn int max=5;rn Book[] booklist;rn int i,j;rn String note;rn public void BookManage()rn rn booklist=new Book[max];rn i=-1;rn j=0;rn rn public void addBook(String isbn,String bname,String bauthor,String bpulisher,double bprice)rn rn i++;rn if(i>=max)rn note="存书量超过预定值,不能再添加了!";rn elsern rn booklist[i]=new Book(isbn,bname,bauthor,boublisher,bprice);rn j=1;rn rn rn public void searchBook(String bookname)rn rn for(j=0;j
我小白一只,求大神帮忙看看什么地方有错误,一直打印不出来
package com.jk5;rnrnimport java.util.Scanner;rnrn/*3.(20)定义Checked方法,参数为字符串,rn分别统计出字符串中,英文字母、空格、数字和其它字符的个数打印到控制台。*/rnpublic class Test1 rnpublic static void Checked(String s) rn String str=null;rn rn int zimu=0;rn int shuzi=0;rn int kong=0;rn int others=0;rn char[] ch=str.toCharArray();rn for (int i = 0; i < ch.length; i++) rn if (Character.isLetter(ch[i])) rn zimu++;rn else if (Character.isDigit(ch[i])) rn shuzi++;rn else if (Character.isSpaceChar(ch[i])) rn kong++;rn else rn others++;rn rn rn System.out.println("字母的个数"+zimu);rn System.out.println("数字的个数"+zimu);rn System.out.println("空格的个数"+zimu);rn System.out.println("其他的个数"+zimu);rnrnpublic static void main(String[] args) rn Scanner sc=new Scanner(System.in);rn String s = sc.nextLine();rn Checked(s);rnrnrn
帮忙看看怎么修改、、
弹出来的内容如何以层的方式输出,就像163邮箱那样rnrnrnrn rn rn 无标题文档rn rnrnrnrn rn rn 标记为rn rn 已读rn 未读rn 置顶邮件rn 取消置顶rn 标为红色rn rn rnrn rnrn
帮忙看看怎么修改,
严重: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/,J2EEApplication=none,J2EEServer=nonern2012-4-4 12:51:33 org.apache.catalina.startup.HostConfig deployDirectoryrn严重: Error deploying web application directory ROOTrnjava.lang.UnsupportedClassVersionError: Bad version number in .class filern at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(Unknown Source)rn at java.security.SecureClassLoader.defineClass(Unknown Source)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:108)rn at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:58)rn at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)rn at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1064)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4238)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:448)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
求大神看看错误原因!!!
程序类名叫LogCleanJob,我按照命令hadoop jar运行报错,网上说是classpath的问题,可是我的classpath没问题,jar包也都导入了![图片说明](https://img-ask.csdn.net/upload/201612/09/1481280991_365812.png)
求各位大神帮忙看看
用c写的一个关于把视频转换成图片的程序,但是一直显示不出来,然后出现下面这个rn“delect.exe”: 已加载“E:\my projects\delect\Debug\delect.exe”,已加载符号。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\ntdll.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\kernel32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\KernelBase.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\system\highgui100.dll”,Cannot find or open the PDB filern“delect.exe”: 已加载“C:\Windows\system\cxcore100.dll”,Cannot find or open the PDB filern“delect.exe”: 已加载“C:\Windows\SysWOW64\user32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\gdi32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\lpk.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\usp10.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\msvcrt.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\advapi32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\sechost.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\rpcrt4.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\sspicli.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\cryptbase.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\system\libguide40.dll”,未使用调试信息生成二进制文件。rn“delect.exe”: 已加载“C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18837_none_ec86b8d6858ec0bc\comctl32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\avifil32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\winmm.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\ole32.dll”,已加载符号。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\msacm32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\msvfw32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\shell32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\shlwapi.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\avicap32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\version.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\msvcr100d.dll”,已加载符号。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\imm32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\msctf.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\uxtheme.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\clbcatq.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\oleaut32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\apphelp.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\SogouPY.ime”,Cannot find or open the PDB filern“delect.exe”: 已加载“C:\Windows\SysWOW64\msimg32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\ws2_32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\nsi.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\oleacc.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\ntmarta.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\Wldap32.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\dwmapi.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“E:\sougou\SogouInput\Components\PicFace\1.0.0.1272\PicFace.dll”,Cannot find or open the PDB filern“delect.exe”: 已加载“E:\sougou\SogouInput\7.5.0.5674\Resource.dll”,未使用调试信息生成二进制文件。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\profapi.dll”,已加载符号(去除源信息)。rn“delect.exe”: 已加载“C:\Windows\SysWOW64\psapi.dll”,已加载符号(去除源信息)。rn线程 'Win32 线程' (0xa08) 已退出,返回值为 0 (0x0)。rn线程 'Win32 线程' (0x29a0) 已退出,返回值为 0 (0x0)。rn线程 'Win32 线程' (0x16e4) 已退出,返回值为 0 (0x0)。rn线程 'Win32 线程' (0x24f4) 已退出,返回值为 0 (0x0)。rn线程 'Win32 线程' (0x2abc) 已退出,返回值为 0 (0x0)。rn程序“[9916] delect.exe: 本机”已退出,返回值为 0 (0x0)。rn
matlab 求大神帮忙看看
[img=https://img-bbs.csdn.net/upload/201804/21/1524307765_259653.png][/img]rnrn如何用matlab实现
求大神帮忙修改代码
有些长,我放在百度网盘了,http://pan.baidu.com/share/link?shareid=447115&uk=1644645282rnrn我菜鸟一个,所以写的有些乱,运行结果老提示rn“无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用”,rn但我想应该不是win32 错误写成console的问题,应该是我代码的问题,java转成c++的,请指点
求大神帮忙看看内联汇编
有一个gcc下AT$T格式的内联汇编函数,就几行,要转到windows下masm格式的,实现的是rncompare-and-swap的一个基本操作,求大神帮忙看看,感激不尽!!rnrninline bool CAS(long *ptr, long oldv, long newv) rn rn unsigned char ret;rn /* Note that sete sets a 'byte' not the word */rn __asm__ __volatile__ ( // AT&T assemblyrn " lock\n"rn " cmpxchgq %2,%1\n"rn " sete %0\n"rn : "=q" (ret), "=m" (*ptr)rn : "r" (newv), "m" (*ptr), "a" (oldv)rn : "memory");rn return ret;rn rn
求各位大神帮忙看看~!
各位大哥好,我现在在一家五星级酒店实习,做系统维护工作。他们那个客房电脑系统是用的网吧的系统,现在就是老是出现卡频,自动死机重启,还有就是自动断网重启 ,我们让做系统的来看了的,他们说要限制那个上传和下载的速度。可是改了之后比以前还不如了,我们纠结了半天,都没有弄明白到底是哪里出问题了,哪位大哥能帮忙解决哈!
求高手,大神帮忙看看.....
我做一个struts2的下载,但是,弹不出保存的对话框,整了很久都没有效果,一看,才知道,[img=https://img-bbs.csdn.net/upload/201310/27/1382864710_718899.jpg][/img]rn就是Content-Disposition:返回为空。rnrn我的struts配置是:rnrn rn rn downloadFilern $mimeTypern attachment;filename="$fileName" rn 100000rn rnrnrn代码如下:rnpublic String getFileName()rn try rn return new String(fileName.getBytes(), "ISO8859-1");rn catch (UnsupportedEncodingException e) rn e.printStackTrace();rn return this.fileName;rn rnrnpublic void setFileName(String fileName) rn try rn this.fileName = new String(fileName.getBytes("ISO-8859-1"),"UTF-8");rn catch (UnsupportedEncodingException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn public String download()rn mimeType = context.getMimeType(fileName);rn return "success";rn rn public InputStream getDownloadFile() throws UnsupportedEncodingExceptionrn rn String path = "/file/";rn // 取得目录文件流返回。rn inStream = context.getResourceAsStream(path+fileName);rn return inStream; rn rnrn求各位能给看看是什么情况,谢谢了。rnrnrn
求大神进来帮忙看看
输入gsettings set com.canonical.Unity.launcher launcher-position Bottom 报错 怎么也调整不到下面。输入以上命令就出错
求大神帮忙 诡异错误
我用keil编程 在proteus上仿真 一个串口的小程序 有个按键接到外部中断0 代码如下:rn#include rnrntypedef unsigned char uchar;rntypedef unsigned int uint;rnrn //数据输入按键rnrnbit start ; //编码开始标志rnrnrn/******INT0初始化函数******/rnvoid init_int0()rnrn EX0 = 1; //允许外部中断0rn IT0 = 1; //INT0低电平触发rn EA = 1; //允许总中断rnrnvoid delay1ms()rnrn uchar i,j;rn for(i=0;i<24;i++)rn for(j=248; j>0; j--);rnrnrnrn/******初始化串口******/rnvoid init_serial()rnrn SCON = 0x50; //SCON: serail mode 1, 8-bit UART, enable ucvrrn TMOD = (TMOD & 0x0f) | 0x20;rn PCON |= 0x80;rn TH1 = 0xFA; //Baud:9600 fosc=11.0592MHzrn TL1 = TH1;rnrn IE |= 0x90; //Enable Serial Interruptrn TR1 = 1; //timer 1 runrn rnrnrnvoid send_char(uchar ch) //向串口发送一个字符rnrn SBUF = ch;rn while(0 == TI);rn TI = 0;rnrnrnvoid send_string(uchar *str) rnrn while(*str)rn send_char(*str++);rn rnrnrn/******编码程序******/rnvoid encode()rn rn send_char(49);rn send_char(49);rn rnrn/******INT0中断服务程序******/rnvoid int0_isr() interrupt 0rn rn EX0 = 0;delay1ms(); delay1ms(); delay1ms();rn send_char(48);send_string("hello");rn delay1ms();delay1ms(); delay1ms(); start = 1;rnrnvoid main()rnrn init_serial();rn init_int0(); //初始化外部中断0rn while(1)rn if(1 == start)rn start = 0;rn rn EX0 = 1;rn rn rn rn rnrn但是如果我在rnif(1 == start)rn start = 0;rn rn EX0 = 1;rn rn rn中括号里加一句send_char(48);或者send_string("hello");按按键串口就只输出一次 再按没反应不输出了 而且send_string("hello");还会乱码 但是不加 程序运行完全正确
帮忙看看,怎样修改错误
Compiler Error Message: BC30203: Expected an identifier.rnrnSource Error:rnLine 11: End classrnLine 12: public class datatypesrnLine 13: Public Function SayHello() As StringrnLine 14: Return "Hello World!"rnLine 15: End Functionrn rnrnrn<%@ WebService language="vb" class=dataservice%>rnImports systemrnImports system.datarnImports system.data.sqlclientrnImports system.web.servicesrnrnPublic class dataservicern public functionGetcolor() As DataSetrn Dim myconnection As sqlconnection=New sqlconnection("server=localhost;uid=sa;pwd=;database=aspx")rn Dim mycommand1 As sqldatasetcommand=New sqldatasetcommand("select* from bbs_sort",myconnection)rn Dim mycommand2 As sqldatasetcommand=New sqldatasetcommand("select * from bbs_root",myconnection)rn Dim ds As New datasetrn mycommand1.filldataset(ds,"bbs_sort")rn mycommand2.filldataset(ds,"bbs_root")rn return dsrn end functionrn Public funtionPutcolor(ds as dataset) as Integerrn Return ds.tables(0).Rows.countrn End functionrnend class
java题目,求!!!
Exam类 考试类rn属性: 若干学生 一张考卷rn提示:学生采用HashSet存放rnrnPaper类 考卷类 rn属性:若干试题rn提示:试题采用HashMap存放,key为String,表示题号,rnvalue为试题对象rnrnStudent类 学生类rn属性:姓名 一张答卷 一张考卷rnrnQuestion类 试题类rn属性:题号 题目描述 若干选项 正确答案rn提示:若干选项用ArrayListrnrnAnswerSheet类 答卷类rn属性:每道题的答案 rn提示:答卷中每道题的答案用HashMap存放,key为String,rn表示题号,value为学生的答案rnrnrn问题:为Exam类添加一个方法,用来为所有学生判卷,rn并打印成绩排名(名次、姓名)
求大神看看怎么配置
某宝买的源码,貌似信息没给全。错误提示如下[img=https://img-bbs.csdn.net/upload/201806/05/1528132096_930607.png][/img][img=https://img-bbs.csdn.net/upload/201806/05/1528132237_183473.jpg][/img]
求大神帮忙。一直没搞明白怎么错了
求各位大神指导一下怎么错了,然后如何去改? 谢谢了rn1. Your PhoneNumber class has and only has 3 int variables in its data field (please do not add any other data variables):rnrn int areacode;rn int number;rn int ext;rnrn2. Your PhoneNumber class has 4 constructors with the specifications as below:rnrn if no argument is given, all data fieds (areacode, number, ext) are initialized to zero;rn if one int argument is given, the constructor initializes number by using this argument, and set default areacode to 216, and default ext to 0.rn if three int arguments are given, initialize areacode, number, ext accordingly.rn if one String argument "xxx-xxxxxxx" is given, where the first three characters are numbers and the last 7 characters are either numbers or letters, e.g., "800-GOFEDEX", convert the String to numbers and initialize the data field accordingly. Note the ext should be initialized to 0.rnrnYour program can assume the String is delimited by "-". If the character is a letter, your program should convernt it to a number according to the key pad standard. If the character is neither a number nor a letter, your contrustor will output an error message and initialize the data fileds to zeros.rnHint: given a String, you may use charAt(index) method to extract the character one by one. The decoding method that converts a letter to the corresponding number is provided. In addition, you may find the following methods useful:rnrn Character.isLetterOrDigit(char c): returns either true or false.rnrn Character.isDigit(char c): returns either true or false.rnrn String.valueOf(char digit): convert a character to a String.rnrn String.valueOf(int number): convert an int to a String.rnrn Integer.parseInt(String str): convert a String to an int.rnrn3. Your PhoneNumber provides a method equals() which compares the current object to another PhoneNumber object.rn4. Your PhoneNumber provides a method toString() which outputs a String format of the object.rnrnrnrn[code=java]public class phonenumberrn private int areacode;rn private int number;rn private int ext;rnrn phonenumber()rn areacode=0;rn number=0;rn ext=0;rn rnrn phonenumber(int newnumber)rn areacode=216;rn newnumber=number;rn ext=0;rn rn phonenumber(int newareacode, int newnumber, int newext)rn newareacode=areacode;rn newnumber=number;rn newext=ext;rn rnrn phonenumber(String newnumber)rn ext=0;rn String[] str=newnumber.split("-");rn StringBuilder nun=new StringBuilder();rn for(int i=0; i<7; i++)rn char c=str[1].charAt(i);rn if (!((c <=90 && c>=65)||(c>=48 && c<=57)))rn invalid=true;rn return;rn rn if(c<=90 && c>=65)rn nun.append(decode(c));rn elsern nun.append(c);rn rn number=Integer.parseInt(nun.toString());rn areacode=Integer.parseInt(str[0]);rnrnrnrn rnprivate String decode(char c)rn switch (c)rn case 'A': case 'B': case 'C': return "2";rn case 'D': case 'E': case 'F': return "3";rn case 'G': case 'H': case 'I': return "4";rn case 'J': case 'K': case 'L': return "5";rn case 'M': case 'N': case 'O': return "6";rn case 'P': case 'Q': case 'R': case 'S': return "7";rn case 'T': case 'U': case 'V': return "8";rn case 'W': case 'X': case 'Y': case 'Z': return "9";rn default:return "";rn rnpublic boolean equals(phonenumber pn)rn return (areacode==pn.areacode && number==pn.number && ext==pn.ext);rnrnpublic String toString()rn if(ext==0)rn return areacode+"-"+number;rn elsern return areacode+"-"+number+" ext "+ext;rn rnrn[/code]rnrnrn[code=java]public class phone rn public static void main (String[] args) rnrn phonenumber mynumber = new phonenumber("800-GOFEDEX");rn System.out.println("the number is: " + mynumber);rnrn phonenumber mynumber2 = new phonenumber("800-46FEDEX");rn System.out.println("the number is: " + mynumber2);rnrn phonenumber mynumber3 = new phonenumber("800-&*(^&%@");rn System.out.println("the number is: " + mynumber3);rnrn mynumber = new phonenumber(800, 1234567, 123);rn System.out.println("the number is: " + mynumber);rnrn mynumber2 = new phonenumber(7654321);rn System.out.println("the number is: " + mynumber2);rnrn if (mynumber.equals(mynumber2))rn System.out.println("mynumber and mynumber2 are the same");rn elsern System.out.println("mynumber and mynumber2 are different");rnrn mynumber = new phonenumber();rn System.out.println("the number is: " + mynumber);rnrn rn[/code]
有大神在吗,求帮忙
比如类似一件商品他有颜色,尺码的多种,我用Repeater查询出来显示在页面,点击后右下角出现小红色勾勾,这个我能实现,可是比如一件衣服本来有39码,40码,41码,40码卖完,可是要显示在页面上,不过要禁止他点击
线程中通迅有两处错误,如何修改?
主要是线程间的通迅,检测rn程序是七拼八凑的,这样能否实现还是未知rn请大家帮我看下现在的错误,谢谢rnrn第一处 : error C2440: 'type cast' : cannot convert from 'class CString' to 'long'rn No user-defined-conversion operator available that can perform this conversion, or the operator cannot be calledrn第二处 : error C2664: 'send' : cannot convert parameter 2 from 'long' to 'const char *'rn Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style castrnrn[code=C/C++]#define WM_USERMSG WM_USER+101rnint OpenSocket(CString SendData)rnrn HANDLE hThread;rn unsigned int ThreadID=0;rnrn DWORD AIExitCode;rn if(ThreadID!=0)//看看线程是否是第一次建立rn rn GetExitCodeThread(hThread,&AIExitCode);//捕捉线程rn if(AIExitCode==STILL_ACTIVE)rn //如果线程存在,就不需要建立新线程rn PostThreadMessage(ThreadID,WM_USERMSG,0,(LPARAM)SendData); //第一处错rn return 0; //发送完成后返回rn rn rn m_hEvent=CreateEvent(NULL,FALSE,FALSE,"socketdll");rn hThread = (HANDLE)_beginthreadex(NULL,0,NewThread,0,0,&ThreadID);rn if(hThread == 0)rn rn //printf("start thread failed,errno:%d\n",::GetLastError());rn CloseHandle(m_hEvent);rn return 1;rn rn Sleep(10);rn WaitForSingleObject(m_hEvent,INFINITE);rn CloseHandle(m_hEvent);rn return 0;rnrnrnstatic unsigned WINAPI NewThread(void *arg)rnrn if(SocketClose || StartEnv())rn return 0;rnrn sockClient=socket(AF_INET,SOCK_STREAM,0);rnrn SOCKADDR_IN addrSrv;rn addrSrv.sin_addr.S_un.S_addr=inet_addr(QSerAddress);rn addrSrv.sin_family=AF_INET;rn addrSrv.sin_port=htons(QSerPort);rn if(INVALID_SOCKET == connect(sockClient,(SOCKADDR*)&addrSrv,sizeof(SOCKADDR)))rn rn closesocket(sockClient);rn WSACleanup();rn return 0;rn rnrn int buflen = 0; rn setsockopt(sockClient,SOL_SOCKET,SO_SNDBUF,(const char*)&buflen,sizeof(buflen));rn MSG msg;rn PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);rn if(!SetEvent(m_hEvent)) //set thread start event rn rn return 1;rn rnrn while (1)rn rn if(GetMessage(&msg,0,0,0)) //get msg from message queuern rn switch(msg.message)rn rn case WM_USERMSG:rn if(0 > send(sockClient,msg.lParam,strlen(msg.lParam)+1,0))//第二处错rn rn Sleep(10);rn send(sockClient,msg.lParam,strlen(msg.lParam)+1,0);rn rn break;rn rn rn Sleep(100);rn rnrn closesocket(sockClient);rn WSACleanup();rn return 1;rnrn[/code]
帮忙看看这短程序的两处错误!
程序段是这样的:rnERROR 1: iUsername->GetText(iUsernameBuf);//从编辑框接收用户输入的用户名和密码rn iPassword->GetText(iPasswordBuf);rn rn //iUsernameBuf.Append(_L("bbbb"));rn //iPasswordBuf.Append(_L("1234"));rn rn TBuf8 username;rn TBuf8 password;rnrn username.Copy(iUsernameBuf);rn password.Copy(iPasswordBuf);rnrn //iLoginRequest是 LOGINREQUEST 型的成员变量rn TPckg pckgOfLoginRequest(iLoginRequest);rnrnERROR 2: pckgOfLoginRequest.Append(username.Ptr(), 8);rn pckgOfLoginRequest.Append(password.Ptr(), 6);rnrn ... ...rnrn两个ERROR的地方程序运行的时候都会退出。rn我要做的事是,接收用户从编辑框中输入的信息,打成通讯包文,发送到服务器校验。rn包文接口是:rntypedef structrn char username[8];rn char password[6];rnLOGINREQUEST;rnrnERROR 1: 从编辑框接收数据,不是这样写的吗? (iUsernameBuf 是 TBuf16 ,iUsername是 CEikEdwin *) 这里为什么会异常退出呢?rnrnERROR 2: 后来我把 GetText这两句注释掉,直接给 iUsernameBuf赋值(iUsername.Append(_L("bbbb")),然后到 ERROR 2 的地方又退出了。rn我是想把得到的username、password赋值到相应的LOGINREQUEST包的username、password中rn可是描述符返回的指针都是const指针,不能修改数据rn所以我只有用rnpckgOfLoginRequest.Append(username.Ptr(), 8);rnusername.Ptr()返回username描述符的数据指针,然后我追加8个长度的数据到LOGINREQUEST中rn这样为什么会有问题呢?rn有什么其他方法可以达到我的目的?rnrn rn
看看这个错误怎么修改?
#includern#includern#includern#includern#includernusing namespace std;rnint main()rnrn typedef pair child;rn typedef vector children;rn typedef string surname;rn map family;rn family["a"].push_back("a1");rn family["b"].push_back("b1");rn family["b"].push_back("b2");rn family["c"].push_back("c1");rn family["c"].push_back("c2");rn family["c"].push_back("c3");rn family["d"].push_back("d1");rn family["d"].push_back("d2");rn family["d"].push_back("d3");rn family["d"].push_back("d4");rn family["e"].push_back("e1");rn family["e"].push_back("e2");rn family["e"].push_back("e3");rn family["f"].push_back("f1");rn family["f"].push_back("f2");rn family["g"].push_back("g1");rn family["a"].push_back(make_pair(string("a1"),string("01/02")));rn family["b"].push_back(make_pair(string("b1"),string("02/02")));rn family["b"].push_back(make_pair(string("b2"),string("03/03")));rn family["c"].push_back(make_pair(string("c1"),string("04/04")));rn family["c"].push_back(make_pair(string("c2"),string("05/05")));rn family["c"].push_back(make_pair(string("c3"),string("06/06")));rn map::iterator mi;rn children::iterator vi;rn string s;rn for(mi=family.begin();mi!=family.end();++mi)rn rn s=mi->first;rn cout<second.begin();vi!=mi->second.end();++vi)rn cout<first<<"\t"<second<>name;rn while(!name.empty())rn rn cout<>name;rn rn rn return 0;rnC:\Documents and Settings\Administrator\my.cpp(53) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'struct std::pair,class std::allocator >,clrnass std::basic_string,class std::allocator > >' (or there is no acceptable conversion)rn执行 cl.exe 时出错.rn这个错误怎么办?rn报错:
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview