The method readLine() from the type DataInputStream is deprecated [问题点数:20分,结帖人KG071]

Bbs3
本版专家分:605
结帖率 98.41%
Bbs2
本版专家分:308
Bbs7
本版专家分:17905
Blank
蓝花 2010年3月 Java大版内专家分月排行榜第三
Bbs3
本版专家分:605
Bbs9
本版专家分:51612
Blank
蓝花 2010年5月 Java大版内专家分月排行榜第三
Bbs3
本版专家分:605
Bbs3
本版专家分:605
Bbs6
本版专家分:5451
Bbs7
本版专家分:12251
Bbs2
本版专家分:193
Bbs7
本版专家分:17905
Blank
蓝花 2010年3月 Java大版内专家分月排行榜第三
The method setBackgroundDrawable(Drawable) from the type View is deprecated求解
代码如下rnpackage com.example.helloandroid;rnrnimport android.app.Activity;rnimport android.os.Bundle;rnimport android.view.MotionEvent;rnimport android.view.View;rnimport android.view.View.OnTouchListener;rnimport android.widget.ImageButton;rnrnpublic class MainActivity extends Activity rnrn private ImageButton Ibtn;rnrn @Overridern public void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_main);rn Ibtn = (ImageButton)findViewById(R.id.imageBtn);rn Ibtn.setOnTouchListener(new OnTouchListener()rn @Overridern public boolean onTouch(View v, MotionEvent event)rn if(event.getAction() == MotionEvent.ACTION_DOWN)rn Ibtn.setBackgroundDrawable(getResources().getDrawable(R.drawable.press));rn rn else if(event.getAction() == MotionEvent.ACTION_UP)rn Ibtn.setBackgroundDrawable(getResources().getDrawable(R.drawable.nopress));rn rn return false;rn rn );rn rnrnrnrnrn其中setBackgroundDrawable函数中间打了一条横线,不能被用,为什么?rn
DataInputStream和BufferedReader的readLine方法
我正在调试一个proxy程序,源程序编译时除了提示一些<em>deprecated</em>方法外,一切正常。运行也十分稳定。rnrn其中就用到了DataInputStream的readLine()方法,源程序为;rnDataInputStream Din = new DataInputStream(SrvrSocket.getInputStream());rn这是一个从服务器端读入数据的语句,我按照惯例把它修改为rnBufferedReader Din= rn new BufferedReader(new InputStreamReader(SrvrSocket.getInputStream()));rnrn其他都不变,则编译时少了一个<em>deprecated</em>的提示,但是运行时客户端的网页显示不正常,有些显示不出,有些则格式不对。rnrn不知这两种方式读入的string有没有区别?既然源程序用的是DataInputStream,则相应的写入客户端的用的是DataOutputStream。这个我没有修改,我认为大家都是string应该没关系。不知是不是BufferedReader不能和DataOutputStream配套使用?rn
warning: readLine() in java.io.DataInputStream has been deprecated请问
rn warning: readLine() in java.io.DataInputStream has been <em>deprecated</em>rn 我传输的是二进制格式rn 该用哪个替换readLine()????rn 多谢了
C3P0错误:The type PoolConfig is deprecated
import com.mchange.v2.c3p0.ComboPooledDataSource;rnimport com.mchange.v2.c3p0.DataSources;rnimport com.mchange.v2.c3p0.PoolConfig;rnrn在创建C3P0的连接池工具rnPoolConfig pcfg = new PoolConfig();rn是报错 The <em>type</em> PoolConfig is <em>deprecated</em>rnrn请问是什么原因造成的啊?rn我已导入了c3p0包
很急的问题:调用DataInputStream下的readLine 不行?
我先声明了outgoing 为DataInputStream类,然后在try 语句中reture outgoing.readLine().为什么不行?rn这种错误一般于什么地方有关?
the method getcontextpath() from the type httpservletrequest refers to the missing type string
在做java项目开发的时候,jsp页面很容易报出这个错误。错误的原因很多,但是都和JRE有关。一般在导入项目的时候容易报出这个错误,主要因为JRE(jdk版本不一致)。解决方法:就是重新配置路径,配置你机器上安装的jdk。 右击该出错项目→ Build Path → Configure Build Path → 在 Libraries 选项下,会发现有个出错的jre Libraries,将其Rem
The method update(String, Object...) from the type JdbcTemplate refers to the missing type DataAcces
The <em>type</em> org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced <em>from</em> required .class files The <em>method</em> update(String, Object...) <em>from</em> the <em>type</em> JdbcTemplate refer
【已解决】The method xx from the type xx refers to the missing type List
这个问题真的是让我头大,搞了好长时间都没有解决,最后通过不断百度,最终还是解决了,下面总结一下网上的三个解决方案。 1. 将import删掉,重新导入。 重新导入后,可以发现错误立马消失了,但是一会儿还是回归之前的状态,不过有些人通过这种方式解决了错误。(没有能解决我的错误) 2. build path 全部remove再添加 以eclipse为例,右键项目 -&amp;gt; b...
The method getRealPath(String) from the type ServletRequest is deprecated
File tempFile = new File(fileName);// 构造临时对象       // String savePath=tempFile.getName();       // //返回上传文件在客户端的完整路径名称       // request.setAttribute(&quot;filename&quot;, savePath); //File file = new File(requ...
The method **() is undefined for the type
在类中定义了该方法 rn类型正确rn在jsp页面上引用 为什么提示这样的错误rn请指点!
The static method getCon() from the type PoolConnect should be accessed in a sta
请教各位大侠。我连接Mysql时用到了连接池。 在连接池的类中用到了static函数。然后Jsp页面中调用此函数时总出现:The static <em>method</em> getCon() <em>from</em> the <em>type</em> PoolConnect should be accessed in a static way 这个警告。rn  rn 下面是我的连接池的类:rn package javabean1; import java.sql.Connection; import javax.naming.Context; import javax.naming.InitialContext; import javax.sql.DataSource;   public class PoolConnect       public static Connection getCon()           Connection con = null;           try                Context context=new InitialContext();                DataSource  ds=(DataSource)context.lookup("java:/comp/env/jdbc/TestDB");                con=ds.getConnection();            catch (Exception e)                e.printStackTrace();                     return con;      rn  rn 下面是我调用语句:rn (页面中引用连接池的类)rn 调用类:rn Connection conn = pool.getCon();  rn  rn 虽然警告没有影响执行结果,但我实在搞不清楚上面的警告时怎么回事。希望有大侠能解释。谢谢rn  
select * into type from table
存储过程中使用 <em>type</em>接受*的数据,报错没有足够的值。不想改动<em>type</em>,如何解决?
The method getHibernateTemplate() is undefined for the type XX
[code=XML]rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.MySQLDialectrn truern rn rn rn rn com/entity/A.hbm.xmlrn com/entity/B.hbm.xmlrn com/entity/C.hbm.xmlrn rn rn rn rn com.entityrn rn rn rnrnrn rn rn rn rn rnrn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rnrn[/code]rnrnrnJAVA测试类获取dao保存数据都没有问题,使用页面保存在获取调用dao时就出现dao对象为空!rnrn rnrnpublic class DServer rn rn private BDAO dao;rn rn rn public BDAO getBDao() rn return dao;rn rnrnrn public void setDao(BDAO dao) rn this.dao = dao;rn rnrnrn public boolean save(C obj)rn System.out.println(dao);rn System.out.println(obj);rn dao.save(obj);rn rn return true;rn rnrnrnrn异常:rnThe <em>method</em> getHibernateTemplate() is undefined for the <em>type</em> DServer ??rn急rn
how to get chinese type method?
zen yang qie huan dao zhong wen shuru zhuangtai ?rnred hat 7.3linux
the method Text is not defined for the type Field
我们信息检索大作业是做一个小型搜索引擎,我在试着用ajax和lucene,在看电子书《征服ajax-lucene构建搜索引擎》,按照书上内容敲了程序,其中有两行代码如下:rndoc.add(Field.Text("contents", reader));rndoc.add(Field.Keyword("path",f.getAbsolutePath()));rnrn报错,说是the <em>method</em> Text is not defined for the <em>type</em> Field;rn the <em>method</em> Keyword is not defined for the <em>type</em> Field;rnrn由于还是菜鸟,请高手们赐教啊
ajax配置项中的typemethod
1. jQuery中ajax配置项中的使用<em>type</em>与<em>method</em>的区别 本质上两个配置项是没有区别的,区别在于两者出现的时间不同,<em>type</em>对于目前jQuery的版本全部兼容,也就是说 $.ajax({ <em>type</em>: 'POST', url: '/login', dataType: 'json',若出现跨域请求请使用'jsonp'
ajax 配置项typemethod的区别
<em>type</em> 和<em>method</em> 一样的含义 只是mthod是version1.9添加的, 所以版本1.9之前的使用<em>type</em>  之后的使用<em>method</em>
The method getTextContent() is undefined for the type Node
import org.w3c.dom.Node;rn为什么这里的node.getTextContent()方法在jdk下可以适用,当我把程序迁移到web项目下的时候总是提示这个方法不可用。是怎么回事那?
The method getSingleResult() is undefined for the type Query
关联的代码提取下rnrn rn 出现的错误rn
The method configure() is undefined for the type Configuration
Configuration config=new Configuration().configure();rn这是代码,为什么引包了还是出现标题的错误rn
deprecated conversion from string constant to 'char*'
std::map m = parseOptions("heap:dump,file:xxx.txt");rnrn函数定义如下:rnstd::map parseOptions(const char* options);rnrn为啥会报出 <em>deprecated</em> conversion <em>from</em> string constant to 'char*'?rn方法参数已经是 const 了啊。rnrn编译器是 gcc 4.2.1
The method getJspApplicationContext(ServletContext) is undefined for the type
项目之前都是好好的,运行正常,但不知啥原因,突然不能正常运行,所有访问都报这个错误码,其它项目可以正常运行,rn在网上找了一圈,都是说建立web项目时生成servlet-api.jar,jsp-api.jar与tomcat的包有冲突,比tomca版本低rn但我没有发现我的项目有重复的这些包,大家没有遇到这个问题rnrn2014-3-31 9:38:37 org.apache.jasper.compiler.TldLocationsCache tldScanJarrn信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.rn2014-3-31 9:38:39 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet [jsp] in context with path [/MobileHospital_bank] threw exception [Unable to compile class for JSP: rnrnAn error occurred at line: [36] in the generated java file: [D:\apache-tomcat-7.0.42\work\Catalina\localhost\test_project\org\apache\jsp\index_jsp.java]rnThe <em>method</em> getJspApplicationContext(ServletContext) is undefined for the <em>type</em> JspFactoryrnrnStacktrace:] with root causernorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: [36] in the generated java file: [D:\apache-tomcat-7.0.42\work\Catalina\localhost\test_project\org\apache\jsp\index_jsp.java]rnThe <em>method</em> getJspApplicationContext(ServletContext) is undefined for the <em>type</em> JspFactoryrnrnStacktrace:rn at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)rn at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)rn at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)rn at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)rn at java.lang.Thread.run(Thread.java:662)rn
The method getPartNum() is undefined for the type UserDaoImpl
[code=Java]严重: Servlet.service() for servlet jsp threw exceptionrnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 28 in the jsp file: /<em>method</em>.jsprnThe <em>method</em> getPartNum() is undefined for the <em>type</em> UserDaoImplrn25: rn26: rn27: rn28: tolNum:rn29: rn30: rnrnrnStacktrace:rn at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)rn at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)rn at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)rn at java.lang.Thread.run(Thread.java:619)[/code]rn我明明在UserDaoImpl中定义了getPartNum()的方法,但是为什么回出这样的错误呢?
这个程序为何会出现两处错误提示:The constructor Date(int,int,int) is deprecated 和 The method getYear() from the type Date is de
import java.applet.Applet;rnimport java.awt.*;rnimport java.util.*;rnpublic class UseAbstract extends Applet rnrnCommonEmployee ComEmp;rnManagerEmployee MgrEmp;rnprivate Label prompt1 = null;rnprivate TextField y1 = null;rnprivate TextField m1 = null;rnprivate TextField d1 = null;rnprivate TextField dd1 = null;rnprivate Label prompt2 = null;rnprivate TextField y2 = null;rnprivate TextField m2 = null;rnprivate TextField d2 = null;rnprivate TextField dd2 = null;rnrn/**rn* This is the default constructorrn*/rnpublic UseAbstract() rnsuper();rnrnrn/**rn* This <em>method</em> initializes thisrn* rn* @return voidrn*/rnpublic void init() rnprompt2 = new Label();rnprompt2.setText("主管的开始工作日期与休假天数:19");rnprompt2.setLocation(new java.awt.Point(90,49));rnprompt2.setSize(new java.awt.Dimension(209,23));rnprompt1 = new Label();rnprompt1.setBounds(new java.awt.Rectangle(90,15,208,23));rnprompt1.setText("雇员的开始工作日期与休假天数:19");rnthis.setLayout(null);rnthis.setSize(597, 200);rnthis.add(prompt1, null);rnthis.add(getY1(), null);rnthis.add(getM1(), null);rnthis.add(getD1(), null);rnthis.add(getDd1(), null);rnthis.add(prompt2, null);rnthis.add(getY2(), null);rnthis.add(getM2(), null);rnthis.add(getD2(), null);rnthis.add(getDd2(), null);rnrnrn/**rn* This <em>method</em> initializes y1 rn* rn* @return java.awt.TextField rn*/rnprivate TextField getY1() rnif (y1 == null) rny1 = new TextField();rny1.setBounds(new java.awt.Rectangle(311,15,50,23));rnrnreturn y1;rnrnrn/**rn* This <em>method</em> initializes m1 rn* rn* @return java.awt.TextField rn*/rnprivate TextField getM1() rnif (m1 == null) rnm1 = new TextField();rnm1.setLocation(new java.awt.Point(366,15));rnm1.setSize(new java.awt.Dimension(50,23));rnrnreturn m1;rnrnrn/**rn* This <em>method</em> initializes d1 rn* rn* @return java.awt.TextField rn*/rnprivate TextField getD1() rnif (d1 == null) rnd1 = new TextField();rnd1.setSize(new java.awt.Dimension(50,23));rnd1.setLocation(new java.awt.Point(421,15));rnrnreturn d1;rnrnrn/**rn* This <em>method</em> initializes dd1 rn* rn* @return java.awt.TextField rn*/rnprivate TextField getDd1() rnif (dd1 == null) rndd1 = new TextField();rndd1.setLocation(new java.awt.Point(479,15));rndd1.setSize(new java.awt.Dimension(50,23));rnrnreturn dd1;rnrnrn/**rn* This <em>method</em> initializes y2 rn* rn* @return java.awt.TextField rn*/rnprivate TextField getY2() rnif (y2 == null) rny2 = new TextField();rny2.setSize(new java.awt.Dimension(50,23));rny2.setLocation(new java.awt.Point(311,50));rnrnreturn y2;rnrnrn/**rn* This <em>method</em> initializes m2 rn* rn* @return java.awt.TextField rn*/rnprivate TextField getM2() rnif (m2 == null) rnm2 = new TextField();rnm2.setLocation(new java.awt.Point(366,50));rnm2.setSize(new java.awt.Dimension(50,23));rnrnreturn m2;rnrnrn/**rn* This <em>method</em> initializes d2 rn* rn* @return java.awt.TextField rn*/rnprivate TextField getD2() rnif (d2 == null) rnd2 = new TextField();rnd2.setSize(new java.awt.Dimension(50,23));rnd2.setLocation(new java.awt.Point(421,50));rnrnreturn d2;rnrnrn/**rn* This <em>method</em> initializes dd2 rn* rn* @return java.awt.TextField rn*/rnprivate TextField getDd2() rnif (dd2 == null) rndd2 = new TextField();rndd2.setSize(new java.awt.Dimension(50,23));rndd2.setLocation(new java.awt.Point(479,50));rnrnreturn dd2;rnrnrnpublic void paint(Graphics g)rnrnif(ComEmp.goVacation(Integer.parseInt(dd1.getText())))rng.drawString("This common Employee can enjoy vacation",20,80);rnelserng.drawString("What a pity,work more time first!",20,80);rnif(MgrEmp.goVacation(Integer.parseInt(dd2.getText())))rng.drawString("This Manager can enjoy vacation",20,100);rnelserng.drawString("Too long a vacation,reduce the days!",20,100);rnrnpublic boolean action(Event e,Object o)rnrnif(e.target==dd2)rnrnComEmp=new CommonEmployee(rnnew Date(Integer.parseInt(y1.getText()),rnInteger.parseInt(m1.getText()),rnInteger.parseInt(d1.getText())));rnMgrEmp=new ManagerEmployee(rnnew DateInteger.parseInt(y2.getText()),rnInteger.parseInt(m2.getText()),rnInteger.parseInt(d2.getText())));rn //The constructor Date(int,int,int) is <em>deprecated</em>rnrepaint();rnreturn true;rnrnrn // @jve:decl-index=0:visual-constraint="10,10"rnrnabstract class Employee1rnrnDate m_StartWorkDate;rnabstract boolean goVacation(int days);rnrnclass CommonEmployee extends Employee1rnrnstatic int m_MinWorkYears=3;rnCommonEmployee(Date swd)rnrnm_StartWorkDate=new Date(swd.getTime());rnrnboolean goVacation(int days)rnrnDate now=new Date();rnif(now.getYear()-m_StartWorkDate.getYear()>=3&&days<=60)rnreturn true;rnelse return false;rnrn rn
The method getActualTypeArguments() is undefined for the type ParameterizedType
public abstract class HibernateDaorn private Class clazz;rn protected HibernateDao() rn ParameterizedType <em>type</em>=(ParameterizedType)getClass().getGenericSuperclass();rn clazz=(Class)<em>type</em>.[color=#FF0000]getActualTypeArguments()[/color][0];rn rn rn红色部分报错 为什么啊?
DataInputStream
使用DataInputStream输入流会触发EOFException异常,如何处理以及避免异常的发生。
datainputstream
代码如下,请高手看看撒问题?rnimport java.awt.*;rnimport java.awt.event.*;rnimport java.io.*;rnimport java.net.Socket;rnimport java.net.UnknownHostException;rnrnimport org.omg.CORBA.DataInputStream;rnrnpublic class ChatClient extends Frame rn Socket s=null;rn DataOutputStream dao=null;rn DataInputStream dis=null;rn private boolean bconn=false;rn TextField tfTxt = new TextField();rnrn TextArea taContent = new TextArea();rnrn public static void main(String[] args) rn new ChatClient().launchFrame();rn rn rnrn public void launchFrame() rn this.setLocation(400, 300);rn this.setSize(300, 300);rn add(tfTxt, BorderLayout.SOUTH);rn add(taContent, BorderLayout.NORTH);rn pack();rn this.addWindowListener(new WindowAdapter() rnrn @Overridern public void windowClosing(WindowEvent e) rn disconnect();rn System.exit(0);rn rnrn );rn tfTxt.addActionListener(new TFlistener());rn this.setVisible(true);rn connect();rn rnrn public void connect()rn try rn s=new Socket("127.0.0.1",8888);rn dao=new DataOutputStream(s.getOutputStream());rn [color=#FF0000]dis=new DataInputStream(s.getInputStream());[/color]System.out.println("connectd!");rnrn bconn=true;rn catch (UnknownHostException e) rn rn e.printStackTrace();rn catch (IOException e) rn rn e.printStackTrace();rn rn rn rn public void disconnect()rn try rn dao.close();rn s.close();rn catch (IOException e) rn rn e.printStackTrace();rn rn rn rnrn private class TFlistener implements ActionListener rnrn public void actionPerformed(ActionEvent e) rn String str = tfTxt.getText().trim();rn taContent.setText(str);rn tfTxt.setText("");rn try rn rn dao.writeUTF(str);rn dao.flush();rn rn catch (IOException e1) rn rn e1.printStackTrace();rn rn rnrn rnrn红色部分报Cannot instantiate the <em>type</em> DataInputStream
The method getBytes() is undefined for the type Long
这种错误怎么解决,求大神指导
warning: deprecated conversion from string constant to ‘char*’|
warning: <em>deprecated</em> conversion <em>from</em> string constant to ‘char*’|rnrn成員函數共有兩个rnrnrnsetValue(string) 及 setValue(char*);rnrn調用時用 clazz.setValue("99999999999999999999999");rnrn就出現了上述警告rnrn问题:它优先自动調用 setValue(string) 不就行了?
关于datainputStream 中readline()方法返回类型的问题!!
请问从一问文件中读取一个空行,返回的是什么!可以用rnimport java.io.*;rnpublic class iotest rn public static void main(String[] args) rntry rn DataInputStream in =rn new DataInputStream(rn new BufferedInputStream(rn new FileInputStream(args[0])));rn String s, s2 = new String();rn while((s = in.readLine())!= null)rn rn //System.out.println(s);rn if (s=="") \\问题在这里 文件中为空行可以用这个比较马!!rn System.out.println("have null");rn //s2=s.substring(0,4);rn //System.out.println(s2+"two");rn //s=s+"two"; rn rn //s2 += s + "\n";rn rn // in.close();rn catch(Exception e) rn System.out.println(rn "End of stream encountered");rn rnrn
当DataInputStream 的readline方法不可用,怎样一行行读取数据?
奇怪,我的当DataInputStream.<em>readline</em>方法在jbuilder中输入"."自动弹出的帮助中是被横线划掉的。
注解 @Deprecated、@deprecated 的使用、说明
今天偶然在项目中注意到一个注解:@Deprecated 1. 说明: @Deprecated 表示此方法已废弃、暂时可用,但以后此类或方法都不会再更新、后期可能会删除,建议后来人不要调用此方法。 2. 用法: 此注解可用于类上、方法上、属性上。 通常在给定此注解后,应该在方法注释中同样说明:废弃此方法后的代替方法是哪个、处理原逻辑代替方案是什么 、本身不打算代替,而是直接清除的,则最好...
assignment from incompatible pointer type
请问大神这个怎么解决??谢谢了n代码如下:nn```n#includen#includenstruct student //xtudent 学籍;n int c; //长n int k; //宽n int g; //高n char name[9]; //姓名n struct stdent *next;n;n<em>type</em>def struct student student;nint main()nn int n;n while (scanf("%d", &n))n n if (n != -1) n int j;n student *p_head, *p_rail, *p_st;n p_head = (student *)malloc(sizeof(student));n p_rail = p_head;n int lfn[9]; //储存体积n char *lfnch[10]; //用于储存要找的名字n for (j = 0; j < n; j++)n n p_st = (student *)malloc(sizeof(student));n scanf("%d %d %d %s", &(p_st->c), &(p_st->k), &(p_st->g), p_st->name);n p_rail->next = p_st;n p_rail = p_st;n lfn[j] = (p_st->c)*(p_st->k)*(p_st->g); //把体积储存在数组中;n lfnch[j] = (p_st->name); //分别把名字储存在数组中;n n int min = lfn[0], max = lfn[0],pos1,pos2;n for (j = 1; j < n; j++) //找到体积最大最小并标记下标;n n if (min > lfn[j])n n min = lfn[j];n pos1 = j;n n else pos1 = 0;n if (max < lfn[j])n n max = lfn[j];n pos2 = j;n nn n printf("%s took clay <em>from</em> %s\n", lfnch[pos2], lfnch[pos1]);n min = 0, max = 0;n n elsen break;nn n return 0;nnn n```nnn![图片说明](https://img-ask.csdn.net/upload/201612/14/1481677234_102371.png)
initialization from incompatible pointer type
对应源码位置61行为:n59 // Sysfs definitions for hcsr04 classn60 static struct class_attribute hcsr04_class_attrs[] = n61 __ATTR(value, S_IRUGO | S_IWUSR, hcsr04_value_read, hcsr04_value_write),n62 __ATTR_NULL,n63 ;
type mismatch in value from map:
今天写了个教程程序,非常简单。就是从输入读数据(例如201235) 2012代表年份35代表某刻温度rn结果报错:rnjava.io.IOException: Type mismatch in value <em>from</em> map: expected org.apache.hadoop.io.LongWritable, recieved org.apache.hadoop.io.Textrn at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:850)rn at org.apache.hadoop.mapred.MapTask$NewOutputCollector.write(MapTask.java:541)rn at org.apache.hadoop.mapreduce.TaskInputOutputContext.write(TaskInputOutputContext.java:80)rn at org.apache.hadoop.mapreduce.Mapper.map(Mapper.java:124)rn at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)rn at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)rn at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)rn at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:177)rn我个人认为我的程序没有问题,mapper类型的指定也很正确,求指导:rn代码如下:rnimport java.io.IOException;rnimport java.util.Iterator;rnrnimport org.apache.hadoop.conf.Configured;rnimport org.apache.hadoop.fs.Path;rnimport org.apache.hadoop.io.LongWritable;rnimport org.apache.hadoop.mapred.OutputCollector;rnimport org.apache.hadoop.mapred.Reporter;rnimport org.apache.hadoop.mapreduce.Job;rnimport org.apache.hadoop.mapreduce.lib.input.FileInputFormat;rnimport org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;rnrnimport org.apache.hadoop.mapreduce.Reducer;rnrnimport org.apache.hadoop.io.Text;rnimport org.apache.hadoop.mapreduce.Mapper;rnimport org.apache.hadoop.util.Tool;rnimport org.apache.hadoop.util.ToolRunner;rnrnclass MaxTemperatureMapper extendsrn Mapper rn public void map(LongWritable key, Text value,rn OutputCollector output,rn Reporter reporter) throws IOException rn int k = Integer.parseInt(value.toString().substring(0, 4));rn int val = Integer.parseInt(value.toString().substring(4, 6));rn output.collect(new LongWritable(k), new LongWritable(val));rn rnrnrnclass MaxTemperatureReducer extendsrn Reducer rn public void reduce(LongWritable key, Iterator value,rn OutputCollector output,rn Reporter reporter) throws IOException, InterruptedException rn Long max = (long) Integer.MIN_VALUE;rn while (value.hasNext()) rn max = Math.max(max, value.next().get());rn rn output.collect(key, new LongWritable(max));rn rnrnrnpublic class MaxTemperatureDriver extends Configured implements Tool rn @Overridern public int run(String[] args) throws Exception rn Path in = new Path(args[0]);rn Path out = new Path(args[1]);rn Job job = null;rn job = new Job(getConf(), "Max Temperature");rn job.setJarByClass(MaxTemperatureDriver.class);rn FileInputFormat.addInputPath(job, in);rn FileOutputFormat.setOutputPath(job, out);rn job.setMapperClass(MaxTemperatureMapper.class);rn job.setReducerClass(MaxTemperatureReducer.class);rn job.setOutputKeyClass(LongWritable.class);rn job.setOutputValueClass(LongWritable.class);rn job.waitForCompletion(true);rn return 0;rn rnrn public static void main(String[] args) throws Exception rn int exitCode = ToolRunner.run(new MaxTemperatureDriver(), args);rn System.exit(exitCode);rn rnrn
readLine
warning: readLine() in java.io.DataInputStream has been <em>deprecated</em>rn            bet = Integer.parseInt(kbInput.readLine());rnrn在编译Java程序时遇到如上问题,是什么意思呢 rn我用的Java版本是1.3,例子是1.1版,有什么影响吗rnrnrnrn
readline
rn rnrnrn rn 20周年限定一卡通!可学Java全部课程,仅售799元(原价7016元),还送漫威正版授权机械键盘+CSDN 20周年限量版T恤+智能编程助手!rn rn rn 点此链接购买:rn rn rn rn rn rn https://edu.csdn.net/topic/teachercard?utm_source=jsk20xqyrnrn rn rn rn rnrn&nbsp;rnrn 本教程讲解的内容是python的基础知识,教程中包含了操作系统,python环境搭建,python的基本语法、类型和对象、流程控制、函数、函数式编程、面向对象、文件操作等内容。本教程由浅入深,贴近真实开发,完全为python新手量身定做,也适合老手用来巩固补充基础知识,查漏补缺。rn
the static method cannot hide instance method from object
为什么 父类如果有 proctected 的方法 假如 为 rnrn[code=Java]proctected void fo()[/code]rnrn子类 如果 覆盖fo()的rnrn子类的fo为什么不能是rnrn[code=Java]rnpublic static void fo()rnrnrn[/code]rnrn也就是 为什么不能用static方法覆盖 proctected 的方法rnrn说明原因/../.........谢谢
线程stop的时候,显示The method stop() is deprecated会有什么后果?
如下代码所示,在用stop结束线程时,stop被横线划掉了。而且报这个警告The <em>method</em> stop() <em>from</em> the <em>type</em> Thread is <em>deprecated</em>。会对线程的执行有影响吗?rnrn[code=Java]rn tran_input = new Thread(new ActTranIn());rn tran_input.start();rn /**执行SSLSocket接受数据的代码。。。省略**/rn tran_input.stop();rnrn class ActTranIn implements Runnable rn public void run() rn /**执行SSLSocket发送数据的代码。。。省略**/rn rn rn[/code]
Warning #: 368 : method getSeconds() in class java.util.Date has been deprecated
怎样解决?
The method getAttribute(String) in the type HttpSession is not applicable fo
The <em>method</em> getAttribute(String) in the <em>type</em> HttpSession is not applicable for the arguments (boolean)中getAttribute获取不到
奇怪的问题:The method a() is undefined for the type print
如题:[color=#FF0000]The <em>method</em> a() is undefined for the <em>type</em> print[/color]rn我把print.java放在页面中则正确rn=================test.jsp============rnrnrnrnrnrnrnrnrn============print.java===============rnpackage com.cjlu.tools;rnpublic class printrnrn rn public String a()rn rn return "CHEN";rn rnrnrnrn[color=#339966]--------------------------------------------------------------------rn以下内容为自动编辑的内容,并非楼主的发贴内容,此仅用于显示而已,并无任何其他特殊作用rn楼主【ch_space】截止到2008-08-04 15:03:25的历史汇总数据(不包括此帖):rn发帖的总数量:1 发帖的总分数:20 每贴平均分数:20 rn回帖的总数量:1 得分贴总数量:0 回帖的得分率:0% rn结贴的总数量:1 结贴的总分数:20 rn无满意结贴数:0 无满意结贴分:0 rn未结的帖子数:0 未结的总分数:0 rn结贴的百分比:100.00% 结分的百分比:100.00% rn无满意结贴率:0.00 % 无满意结分率:0.00 % rn敬礼![img=http://p.blog.csdn.net/images/p_blog_csdn_net/java2000_net/381633/o_medal1.gif][/img][/color]rn取消马甲机器人,请点这里:[url=http://www.java2000.net/mycsdn/robotStop.jsp?usern=ch_space][/url]
The method getDataSource(HttpServletRequest) is undefined for the type LoginAction
package com.struts.chaptertwo;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnimport org.apache.struts.action.Action;rnimport org.apache.struts.action.ActionForm;rnimport org.apache.struts.action.ActionForward;rnimport org.apache.struts.action.ActionMapping;rnrnimport javax.sql.DataSource;rnimport java.sql.Connection;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnrnpublic class LoginAction extends Actionrn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rn rn LoginActionForm loginActionForm=(LoginActionForm)form;rn String username=loginActionForm.getUsername();rn String password=loginActionForm.getPassword();rn rn rn rn DataSource ds=[color=#FF6600]getDataSource[/color](request);rn Connection conn=ds.getConnection();rn Statement stmt=conn.createStatement();rn String sqlStr="select * <em>from</em> loginuser where username='"+username+"' and password='"+password+"'";rn ResultSet rs=stmt.executeQuery(sqlStr);rn Boolean result=false;rn if(rs.next())rn rn result =true;rn rn rn elsern rn result=false;rn rn conn.close();rn rn if(result)rn return mapping.findForward("wellcome");rnrn elsern rn return mapping.findForward("wrong");rn rn rnrn
The method querySubCategory(int) is undefined for the type GoodsCatedao
该方法存在为什么报The <em>method</em> querySubCategory(int) is undefined for the <em>type</em> GoodsCatedao错误呢?rn具体错误:rn2010-7-7 18:24:22 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet default threw exceptionrnjava.lang.Error: Unresolved compilation problems: rn The <em>method</em> querySubCategory(int) is undefined for the <em>type</em> GoodsCatedaorn The <em>method</em> querySubCategory(int) is undefined for the <em>type</em> GoodsCatedaorn The <em>method</em> querySubCategory(int) is undefined for the <em>type</em> GoodsCatedaornrn at kaiqi.goods.actions.GoodsCateAction.searchJLExecute(GoodsCateAction.java:531)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvoc
问题:The method add(String, Component) in the type Container......
[color=#0000FF]程序1:[/color]rnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnrnpublic class Bounce rn rn public static void main(String[] args) rn EventQueue.invokeLater(new Runnable()rn rn public void run()rn rn JFrame frame=new BounceFrame();rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn frame.setVisible(true);rn rn rn );rnrn rnrnrnrnclass BounceFrame extends JFramernrn public BounceFrame()rn rn setSize(DEFAULT_WIDTH,DEFAULT_HEIGH);rn setTitle("Bounce");rn comp=new BallComponent();rn [color=#FF0000]add(comp,BorderLayout.CENTER);[/color]rn JPanel buttonPanel=new JPanel();rn addButton(buttonPanel,"Start",new ActionListener()rn rn public void actionPerformed(ActionEvent event)rn rn addBall();rn rn );rn addButton(buttonPanel,"Close",new ActionListener()rn rn public void actionPerformed(ActionEvent event)rn rn System.exit(0);rn rn );rn rn rn public void addButton(Container c, String title, ActionListener listener)rn rn JButton button=new JButton(title);rn c.add(button);rn button.addActionListener(listener);rn rn public void addBall()rn rn tryrn rn Ball ball=new Ball();rn comp.add(ball);rn for(int i=1;i<=STEPS;i++)rn rn [color=#FF0000]ball.move(comp.getBounds());rn comp.paint(comp.getGraphics());[/color] Thread.sleep(DELAY);rn rn catch(InterruptedException e)rn rn rn rn rn private BallComponent comp;rn public static final int DEFAULT_WIDTH=450;rn public static final int DEFAULT_HEIGH=350;rn public static final int STEPS=1000;rn public static final int DELAY=3;rnrn[color=#0000FF]程序2:[/color]rnimport java.awt.geom.Ellipse2D;rnimport java.awt.geom.Rectangle2D;rnrnrnpublic class Ball rnrn public void move(Rectangle2D bounds)rn rn x+=dx;rn y+=dy;rn if( x =bounds.getMaxX())rn rn x=bounds.getMaxX()-XSIZE;rn dx=-dx;rn rn if(y=bounds.getMaxY())rn rn y=bounds.getMaxY()-YSIZE;rn dy=-dy;rn rn rn public Ellipse2D getShape()rn rn return new Ellipse2D.Double(x,y,XSIZE,YSIZE);rn rnprivate static final int XSIZE=15;rnprivate static final int YSIZE=15;rn private double x=0;rn private double y=0;rn private double dx=1;rn private double dy=1;rn rnrn[color=#3366FF]程序3:[/color]rnrnimport java.awt.*;rnimport java.util.*;rnimport javax.swing.*;rnpublic class BallComponent rn public void add(Ball b)rn rn balls.add(b);rn rn public void paintComponent(Graphics g)rn rn [color=#FF0000]super.paintComponent(g);[/color] rn Graphics2D g2=(Graphics2D) g;rn for(Ball b : balls)rn rn g2.fill(b.getShape());rn rn rn rn private ArrayList balls=new ArrayList();rnrn在程序1中红色部分是有错误的,报错信息如下:rnThe <em>method</em> add(String, Component) in the <em>type</em> Container is not applicable for the arguments (BallComponent, String)rn The <em>method</em> getBounds() is undefined for the <em>type</em> BallComponentrn The <em>method</em> getGraphics() is undefined for the <em>type</em> BallComponentrn请问为什么会报着几个错误,该如何进行修改?rn在程序3中红色部分也是有错误的,不知道出错原因是什么?rn请高人帮忙解答一下,非常感谢。rn因为下面写不了了,只有在这儿写了,经过下面的修改后,再在程序1中加一行代码add(comp,BorderLayout.CENTER);就OK 了
The method wirte(String) is undefined for the type FileWriter
各位看官,帮忙看看,自己看了好久硬是没出来rnfw.write("\");theFloaters.play();");rnfw.wirte("\");theFloaters.addItem('followDiv2',1,'document.documentElement.clientHeight-458',\"");rn第一句不会报错 但是第二句会报错rn这个是什么原因啊~rn谢谢了!
The method addMouseListener(MouseListener) in the type Component is not applicab
[color=#FF0000]Exception in thread "main" java.lang.Error: Unresolved compilation problem: rn The <em>method</em> addMouseListener(MouseListener) in the <em>type</em> Component is not applicable for the arguments (Ex9_8_)rnrn at Ex9_8_.(Ex9_8_.java:10)rn at Ex9_8_.main(Ex9_8_.java:22)[/color]rnrn[code=Java]rnimport java.awt.event.*;rnimport javax.swing.*;rnrnpublic class Ex9_8_ rn JFrame f;rn public Ex9_8_()rn f = new JFrame();rn f.setSize( 300,150 );rn f.show();rn f.addMouseListener(this);rn f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn rn rn public void mousePressed(MouseEvent e)rn public void mouseReleased(MouseEvent e)rn public void mouseEntered(MouseEvent e)rn public void mouseExited(MouseEvent e)rn public void mouseClicked(MouseEvent e)rn f.setTitle( "点击坐标为(" + e.getX() + "," + e.getY() + ")" );rn rn public static void main( String args[] )rn new Ex9_8_();rn rnrnrn[/code]
rs.close();报错The method close() is undefined for the type Resultset?
跟着视频做个很简单的数据库连接和关闭,结果出现这个错误,网上找了一堆没跟我一样的。。。rn错误提示rnThe <em>method</em> close() is undefined for the <em>type</em> Resultsetrnrn代码如下rnrn```rnpackage com.zkz.magSystem.com;rnrnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.PreparedStatement;rnimport java.sql.SQLException;rnrnimport com.mysql.cj.protocol.Resultset;rnrnpublic class BaseDAO rn public static Connection getConnection() throws Exceptionrn rn Class.forName("com.mysql.jdbc.Driver");rn return DriverManager.getConnection("jdbc:mysql://localhost:3306/exam","root","12345");rn rn rn public static void close(Connection conn,PreparedStatement ps,Resultset rs)rn try rn if(rs != null) rs.close();rn if(ps != null) ps.close();rn if(conn !=null && !conn.isClosed()) conn.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rnrn```
The method getbean(String) is undefined for the type StuNewAddAction
package com.yourcompany.struts.action;rnimport java.util.List;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnimport org.apache.commons.beanutils.BeanUtils;rnimport org.apache.struts.action.Action;rnimport org.apache.struts.action.ActionForm;rnimport org.apache.struts.action.ActionForward;rnimport org.apache.struts.action.ActionMapping;rnrnrnimport com.yourcompany.struts.form.StuNewAddForm;rnimport com.yourcompany.struts.form.StuNewForm;rnimport com.yourcompany.struts.model.StuNew;rnimport com.yourcompany.struts.service.StuNewManager;rnrnpublic class StuNewAddAction extends Actionrn rn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response)rn throws Exception rn rn String <em>method</em> =request.getParameter("<em>method</em>");rn System.out.println("<em>method</em>====stu=====" + <em>method</em>);rn rn if(<em>method</em>.equals("query"))rn return query(mapping, form, request, response);rn if(<em>method</em>.equals("add"))rn return add(mapping,form,request,response);rn if(<em>method</em>.equals("save"))rn return save(mapping,form,request,response); rn rn return null;rn rnrn rnrn private ActionForward save(ActionMapping mapping, ActionForm form, rn HttpServletRequest request, HttpServletResponse response) rn throws Exceptionrn StuNewAddForm mf =(StuNewAddForm)form;rn StuNew stuNew =new StuNew();rn BeanUtils.copyProperties(stuNew,mf);rn rn StuNewManager bm =(StuNewManager) getbean("stuNewManager");rn [color=#FF0000]这里报错 The <em>method</em> getbean(String) is undefined for the <em>type</em> StuNewAddAction[/color]rn return null;rn rnrnrnrn /** rn * 学生信息小窗口rn * Method execute "query" 显示页面rn * @param mappingrn * @param formrn * @param requestrn * @param responsern * @return ActionForward 返回页面rn */rn // 显示rn private ActionForward add(ActionMapping mapping, ActionForm form, rn HttpServletRequest request, HttpServletResponse response) throws Exceptionrn System.out.println("<em>method</em>====add=====" );rn return query(mapping, form, request, response);rn rnrn private ActionForward query(ActionMapping mapping, ActionForm form, rn HttpServletRequest request, HttpServletResponse response) throws Exceptionrn rn return mapping.findForward("StuNewAddPage");rn rnrnrnrnrnrnrn[color=#FF0000]这个错误该怎么办啊??我是在Action里写的rnrn下面是我的WEB.xml[/color]rnrnrnrnrn rn actionrn rn org.apache.struts.action.ActionServletrn rn rn configrn /WEB-INF/struts-wdy.xmlrn rn rn debugrn 3rn rn rn detailrn 3rn rn 0rn rn rn actionrn *.dorn rn rn rn /WEB-INF/c.tldrn /WEB-INF/c.tldrn rn rn /WEB-INF/cinko.tldrn /WEB-INF/cinko.tldrn rn rn /tags/ecsidern /WEB-INF/ecside.tldrn rn rn /WEB-INF/fmt.tldrn /WEB-INF/fmt.tldrn rn rn /tags/ecrn rn /WEB-INF/extremecomponents.tldrn rn rn rn /tags/jsrn /WEB-INF/jsrn rn rn /WEB-INF/css.jsprn /WEB-INF/css.jsprn rn rn /tags/struts-beanrn /WEB-INF/struts-bean.tldrn rnrn rn /tags/struts-htmlrn /WEB-INF/struts-html.tldrn rnrn rn /tags/struts-logicrn /WEB-INF/struts-logic.tldrn rn rn /tags/struts-tilesrn /WEB-INF/struts-tiles.tldrn rn rn rn rnrnrn
The method add(string) in the type ArrayList is not applicable for the a
rnimport java.util.ArrayList;rnrnpublic class APP2 rnrn public static void main(String[] args) rn ArrayList list = new ArrayList();rn list.add("SE");rn list.add("EE");rn list.add("ME");rn list.add("SE");rn list.add("EE");rn list.remove("SE");rn System.out.print(list);rn rnrnrnrn为什么add这里显示The <em>method</em> add(string) in the <em>type</em> ArrayList is not applicable for the arguments (String)rn编译错误,求解
The method getItemNo() is undefined for the type Item怎么解决!!
The <em>method</em> getItemNo() is undefined for the <em>type</em> Item怎么解决rnpublic class ItemDao4OracleImpl implements ItemDao rnrn public void addItem(Connection conn, Item item) rn String sql="insert into t_items(item_no,itme_category_id,item_unit_id,item_name,spec,pattern)";rn sql+=" values(?,?,?,?,?,?)";rn PreparedStatement pstmt= null;rn tryrn pstmt = conn.prepareStatement(sql);rn pstmt.setString(1, item.[color=#FF0000]getItemNo[/color]());rn pstmt.setString(2, item.getIte[color=#FF0000][/color]mName());rn pstmt.setString(3, item.get[color=#FF0000][/color]Spec());rn pstmt.setString(4, item.getPa[color=#FF0000][/color]ttern());rn pstmt.setString(5, item.getItemC[color=#FF0000][/color]ategory().getId());rn pstmt.setString(6, item.getItemUnit().ge[color=#FF0000][/color]tId());rn为什么显示:The <em>method</em> getItemNo() is undefined for the <em>type</em> Item?rnItem 类里我已经定义了:rnprivate String itemNo;rnprivate String itemName;rnprivate String spec;rnprivate String pttern;rnprivate ItemCategory itemCategory;rnprivate ItemUnit itemUnit;
The method getSumByNum(String) is undefined for the type CardInfoDao
[code=Java]org.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 439 in the jsp file: /index.jsprnThe <em>method</em> getSumByNum(String) is undefined for the <em>type</em> CardInfoDaorn436: PayInfo payInfo1=(PayInfo)payInfos1.get(i);rn437: eSum = Integer.parseInt(payInfo1.getCardNum().substring(10,12));rn438: int moneySum = 0;rn439: moneySum = cid1.getSumByNum(payInfo1.getCardNum());rn440: %>rn441: rn442: rnrnrnStacktrace:rn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)[/code]rn有getSumByNum这个方法,public int getSumByNum(String cardNum)rnrn上文中有定义CardInfoDao cid1 = new CardInfoDao();rnrnpayInfo1.getCardNum()返回的是String。rnrn请高手帮忙看一下会是哪里的问题,在线等。。。
错误:The method getParemeter(String) is undefined for the type HttpServletRequest
(1)功能:采用JSP + Servlet 实现网络磁盘rn(2)Servlet、JSP调用关系:rn DiskServlet.java 显示跟磁盘目录rn DirServlet.java 显示该目录下得文件以及文件夹rn ReadServlet.java 读取文件中的内容rn rn create.jsp 创建新文件/文件夹 输入页面rn WriteServlet.java 创建新的文件/文件夹rn(3)问题:rn在DirServlet.java中有创建文件的链接:rn out.println("[" + "创建文件/文件夹]");rn //file.getAbsolutePath()为取得当前的目录rn在create.jsp中读取传入的path参数rnrn rnrn在MyEclipse8.5、Tomcat_6.0.35部署好之后访问“创建文件的链接”(即create.jsp) 报错:rnrnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 5 in the jsp file: /create.jsprnThe <em>method</em> getParemeter(String) is undefined for the <em>type</em> HttpServletRequestrn2: rn3: rn7: rn8: rnrnrnStacktrace:rn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnrequest对象的getParameter(String)方法没有定义呢?该如何解决呢?rn
问题~the method setCharacterEncoding(string) is undefined for the type HttpServletResponse
package com.shop.filter;rnrnimport java.io.IOException;rnrnimport javax.servlet.Filter;rnimport javax.servlet.FilterChain;rnimport javax.servlet.FilterConfig;rnimport javax.servlet.ServletException;rnimport javax.servlet.ServletRequest;rnimport javax.servlet.ServletResponse;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnpublic class CharFilter implements Filterrnrn public void init(FilterConfig arg0) throws ServletException rn // TODO Auto-generated <em>method</em> stubrn rn rnrn public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException rn HttpServletRequest hr=(HttpServletRequest)arg0;rn HttpServletResponse hrs=(HttpServletResponse)arg1;rn hr.setCharacterEncoding("gb2312");rn[color=#FF0000] hrs.setCharacterEncoding("gb2312");[/color]rn rn arg2.doFilter(arg0,arg1);rnrn rnrn public void destroy() rn // TODO Auto-generated <em>method</em> stubrn rn rnrn
The method prevous() is undefined for the type ResultSet 错误信息
------------------------出现这样的 错误信息----------------------------------45: %> rn46: rn47: rn-------------------------------m * n 的代码--------------------------------------rn源程序rn rn rn rn rn rn rn
关于$.ajax 方法中typemethod
我看到网上很多ajax方法里面都有<em>type</em>属性,用于设定get,post等请求类型,rn然而我在官网查API(http://api.jquery.com/jquery.ajax/)时并没有找到这个<em>type</em>属性,rn相应的我找到了一个<em>method</em>属性用于设定请求类型,rn我的问题是rn是不是<em>type</em>属性过时了?rn<em>type</em>和<em>method</em>属性有什么区别
A PRP type method for systems of monotone equations
In this paper, we propose an algorithm for solving systems of monotone equations. The <em>method</em> is a combination of the well-known PRP <em>method</em> and the hyperplane projection <em>method</em>. We prove that the proposed <em>method</em> is globally convergent if the equation is monotone and Lipschitz continuous without any differentiability requirement on the equation. Preliminary numerical results show that the proposed <em>method</em> is promising.
jsp中type=post和method=post什么区别?
jsp中<em>type</em>=post和<em>method</em>=post什么区别?
The method getParametersValues(String) is undefined for the type HttpServletRequest
while(rs.next())rn %>rn rn >rn rn rn rn rn rn ).trim();rn这2行代码执行的时候报错:rnThe <em>method</em> getParametersValues(String) is undefined for the <em>type</em> HttpServletRequestrn方法未定义......rn什么意思 大家解释一下什么原因啊!rn
Jquery.ajax()中的参数typemethod的区别
官方文档给出: <em>type</em> (default: ‘GET’) Type: String An alias for <em>method</em>. You should use <em>type</em> if you’re using versions of jQuery prior to 1.9.0. 即<em>type</em>和<em>method</em>是一样。只不过是1.9.0版本出的<em>method</em> 估计是让程序员更好记,更符合习惯吧。(个人也是认为meth...
The method screenshot(int, int) is undefined for the type Surface
下载的截屏代码,下面这行代码出错:rnmScreenBitmap = Surface.[color=#FF0000]screenshot[/color]((int) dims[0], (int) dims[1]);rn提示:rnThe <em>method</em> screenshot(int, int) is undefined for the <em>type</em> Surfacernrn还有rnimport android.hardware.CameraSound;rnimport android.os.ServiceManager;rnimport android.os.SystemProperties;rn这三行语句也出错,提示rnThe import android.hardware.CameraSound cannot be resolvedrnrn这是什么原因造成的?是因为API版本不同吗?
如何解决The method getIdcard() is undefined for the type String
这事封装对象的代码rnpackage cn.itcast.domain;rnrnpublic class Student rnrn private String idcard;rn private String examid;rn private String name;rn private String location;rn private double grade;rn rn rn public String getIdcard() rn return idcard;rn rn public void setIdcard(String idcard) rn this.idcard = idcard;rn rn public String getExamid() rn return examid;rn rn public void setExamid(String examid) rn this.examid = examid;rn rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn public String getLocation() rn return location;rn rn public void setLocation(String location) rn this.location = location;rn rn public double getGrade() rn return grade;rn rn public void setGrade(double grade) rn this.grade = grade;rn rn rnrn这事操作代码rnimport cn.itcast.utils.XmlUtils;rnrnpublic class StudentDao rnrnrn public void add(String s)rn rn try rn Document document = XmlUtils.getDocument();rn rn //创建封装学生信息的标签rn Element student_tag = document.createElement("student"); rn student_tag.setAttribute("idcard", s.getIdcard());rn student_tag.setAttribute("examid", s.getExamid()); rn rn catch (Exception e) rn throw new RuntimeException(e);rn rn rn rnrn这里的getIdcard()和getExamid()方法会出现The <em>method</em> getIdcard() is undefined for the <em>type</em> String的错误啊!
the method setOnKeyListener in the type View is not a applicable for the argumen
package com.paad.todolist;rnrnimport java.util.ArrayList;rnrnimport android.app.Activity;rnimport android.os.Bundle;rnimport android.widget.ArrayAdapter;rnimport android.widget.EditText;rnimport android.widget.ListView;rnrnpublic class ToDoList extends Activity rn /** Called when the activity is first created. */rn @Overridern public void onCreate(Bundle icicle) rn //填充你的Viewrn //super.onCreate(icicle);rn setContentView(R.layout.main);rn rn //获得对UI widgets的引用rn ListView myListView = (ListView)findViewById(R.id.myListVIew);rn final EditText myEditText = (EditText)findViewById(R.id.myEditText);rn rn //创建待办事项ArrayListrn final ArrayListtodoItems = new ArrayList();rn //创建array Adapter来将数组绑定到listviewrn final ArrayAdapter aa;rn aa = new ArrayAdapter(this,rn android.R.layout.simple_list_item_1,rn todoItems);rn //把arrayadapter和listview绑定rn myListView.setAdapter(aa);rn rn myEditText.setOnKeyListener(new OnKeyListener()rn public boolean onKey(View v, int keyCode, KeyEvent event)rn if(event.getAction() == KeyEvent.ACTION_DOWN)rn if(keyCode == KeyEvent.KEYCODE_DPAD_CENTER)rn rn todoItems.add(0, myEditText.getText().toString());rn aa.notifyDataSetChanged();rn myEditText.setText("");rn return true;rn rn return false;rn rn );rn rnrnrn本人新手,按照书上的第一个todo_list进行编程,但是在myEditText.setOnKeyListener中报错,报错内容为:the <em>method</em> setOnKeyListener in the <em>type</em> View is not a applicable for the argumentsrnrn请高手指点!
急!!the method getTextContent() is undefined for the type Element
package dom;rn/**rn * parse xml filern * @author Administratorrn *rn */rnimport javax.xml.parsers.*;rnimport org.w3c.dom.*;rnrnpublic class ParseXMLByDom rn rn //get document object by parse filern public Document getDocumentByFile()throws Exceptionrn DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();rn DocumentBuilder db=dbf.newDocumentBuilder();rn Document doc=db.parse("student.xml");rn return doc;rn rn //parse xml filern public void parseXMLFile(Document doc)throws Exceptionrn //获得student元素的ID属性值rn getStudentAttrValue(doc);rn //获得student 的ID=101的子元素文本的内容rn //getChildEleText(doc);rn rn public void getStudentAttrValue(Document doc)rn NodeList nodeLst=doc.getElementsByTagName("student");rn int len=nodeLst.getLength();rn for(int i=0;i"+text+"");rn rn rn rn /**rn * @param argsrn */rn public static void main(String[] args) rn ParseXMLByDom parseXML=new ParseXMLByDom();rn tryrn parseXML.getStudentAttrValue(parseXML.getDocumentByFile());rn catch(Exception ex)rn ex.printStackTrace();rn rnrn rnrnrn 为什么String text=childEle.getTextContent();报错呢??怎么解决啊??
The method list(String, Object[]) is ambiguous for the type BaseHibernateDao
@Overridern public List listAll(int pn, int pageSize) rn return list(HQL_LIST_ALL, pn, pageSize);rn rn rn @Overridern public List pre(PK pk, int pn, int pageSize) rn if(pk == null) rn return list(HQL_LIST_ALL, pn, pageSize);rn rn //倒序,重排rn List result = list(HQL_OPTIMIZE_PRE_LIST_ALL, 1, pageSize, pk);rn Collections.reverse(result);rn return result;rn rn @Overridern public List next(PK pk, int pn, int pageSize) rn if(pk == null) rn return list(HQL_LIST_ALL, pn, pageSize);rn rn return list(HQL_OPTIMIZE_NEXT_LIST_ALL, 1, pageSize, pk);rn rnrn @Overridern public void flush() rn getSession().flush();rn rnrn @Overridern public void clear() rn getSession().clear();rn rnrn protected long getIdResult(String hql, Object... paramlist) rn long result = -1;rn List list = list(hql, paramlist);rn if (list != null && list.size() > 0) rn return ((Number) list.get(0)).longValue();rn rn return result;rn rnrn protected List listSelf(final String hql, final int pn, final int pageSize, final Object... paramlist) rn return this. list(hql, pn, pageSize, paramlist);rn rnrnrn /**rn * for inrn */rn @SuppressWarnings("unchecked")rn protected List listWithIn(final String hql,final int start, final int length, final Map> map, final Object... paramlist) rn Query query = getSession().createQuery(hql);rn setParameters(query, paramlist);rn for (Entry> e : map.entrySet()) rn query.setParameterList(e.getKey(), e.getValue());rn rn if (start > -1 && length > -1) rn query.setMaxResults(length);rn if (start != 0) rn query.setFirstResult(start);rn rn rn List results = query.list();rn return results;rn rnrn @SuppressWarnings("unchecked")rn protected List list(final String hql, final int pn, final int pageSize, final Object... paramlist) rn Query query = getSession().createQuery(hql);rn setParameters(query, paramlist);rn if (pn > -1 && pageSize > -1) rn query.setMaxResults(pageSize);rn int start = PageUtil.getPageStart(pn, pageSize);rn if (start != 0) rn query.setFirstResult(start);rn rn rn if (pn < 0) rn query.setFirstResult(0);rn rn List results = query.list();rn return results;rn rn
The method getParmaeter(String) is undefined for the type HttpServletRequest
rnrnrnrnrnrnrnrnrnrnrnrnrn rn 注册检查rnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrn rn rn 用户注册rn rn rn rn rn rn rn rnrnrnrnrn rn rn rn rn rn  rn rn rn rn rn rn rn  rn rn rn rn rn *用 户 名: rn 用户名大于4小于20个字符rnrn rn *密 码:rn rn rn 密码大于6小于20个字符rnrn rn *重复密码: rn 必须与上面一致rnrn rn *电子邮箱: rnrnE-MAIL必须符合规则rnrn *性 别:rn 男 女rn 性别不能为空rnrnrn rn *QQ号码: rn rn qq不能为空rnrn rn *问 题:rn rnrnrn rn *答 案:rn rnrnrn rn 个人介绍:rn rnrn rn 看不清楚换一张rn rn rn rn 验证码:rn rn rn rnrnrnrn rn rn  rn rn rn rn rn rn rn  rn rn rn rn rn rnrnrn
The method createStmt(Connection) in the type DB is not applicable for the argum
这个错误到底怎么解决,完全摸不透,求高手解答
The method executeUpdate(String) is undefined for the type DataBase
问题如下:rnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 70 in the jsp file: /JavaBeanTest/Vote.jsprnThe <em>method</em> executeUpdate(String) is undefined for the <em>type</em> DataBasern67: ++count;rn68: //鏇存敼鏁版嵁搴撳唴瀹�rn69: String s1 = "update vote set count = " + count + " where id = " + s;rn70: int n = DataBase.executeUpdate(s1 );rn71: if ( n > 0)rn72: rn73: out.print( "鎶曠エ鎴愬姛!!");rnrnrnStacktrace:rn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:95)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:367)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:345)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:342)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:722)rnrnrn我的JSP页面:rn 0)rn rn out.print( "投票成功!!");rn rn rn %>rnDataBase类:rnrnrn/*数据库连接类*/rnpackage com.db;rnimport java.sql.*;rnrnpublic class DataBase rn private static Connection con = null;rn private static Statement st = null;rn private static ResultSet rs = null;rn rn /*建立桥接器函数*/rn private static void forName()rn rn tryrn rn Class.forName("com.mysql.jdbc.Driver");rn rn catch (ClassNotFoundException e) rn rn e.printStackTrace();rn rn rn rn public static ResultSet executeQuery(String str)rn rn rn //建立桥接器rn forName();rn try rn rn //建立连接rn con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test1", "root", "");rn //建立SQL对象rn st = con.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);rn //执行查询rn rs = st.executeQuery(str);rn rn catch (SQLException e) rn rn e.printStackTrace();rn rn return rs;rn rn rn public static int executeUpdate(String str)rn rn int n = 0;rn //建立桥接器rn forName();rn try rn rn //建立连接rn con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test1", "root", "");rn //建立SQL对象rn st = con.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);rn //执行查询rn n = st.executeUpdate(str);rn rn catch (SQLException e) rn rn e.printStackTrace();rn rn return n;rn rnrnrn
Error:The method equlas(String) is undefined for the type String
///////////////rn// 代码如下rn///////////////rnrnrnrnrnrnrnrnrnrnrnrnrnrnrn rn create.jsprnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn///////////////////////rn// 下面是错误信息:rn//////////////////////*rnAn error occurred at line: 68 in the jsp file: /create.jsprnGenerated servlet error:rnThe <em>method</em> equlas(String) is undefined for the <em>type</em> Stringrn/////////////////////*/rn// JDK1.5 + Tomcat 5.5rn
The method addBatch(String) is undefined for the type String
String.addBatch(sql1);报错rn这是 DAOTest类rn[code=java]rnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnrnpublic class DAOTest rn Connection conn;rn Statement stmt;rn ResultSet rs;rn public Connection getConn() rn return conn;rn rn public Statement getStmt() rn return stmt;rn rn public ResultSet getRs() rn return rs;rn rn public DAOTest(Connection conn) rn this.conn=conn;rn try rn stmt=conn.createStatement();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn public void createTable() throws SQLException rn stmt.executeUpdate("drop table if exists 'jdbc_test'");rn String sql="create table jdbc_test(id int,name varchar(100))";rn stmt.executeUpdate(sql);rn System.out.println("jdbc_test表建立完成");rn rn public void insert() throws SQLExceptionrn String sql1="insert into jdbc_test values(1,'tom')";rn String sql2="insert into jdbc_test values(2,'张三')";rn String sql3="insert into jdbc_test values(3,'999')";rn String.addBatch(sql1);rn String.addBatch(sql2);rn String.addBatch(sql3);rn rn int[] results=stmt.executeBatch();rn for(int i=0;i
怎么声明type library里的method
初学delphi,我的控件里有个没有参数的函数function getFile : string; safecall;rn怎么在<em>type</em> library里设置这个函数的<em>method</em>啊(关键是“parameters那个属性页怎么设置”)rn望高手指教。
About the return type of invoke method in InvocationHandler
The return <em>type</em> of Proxy should be Object, when i ni debug mode, i see that the return <em>type</em> value is null, strange wasn't it? I still can call <em>method</em> in the interface, who can tell me why? And is that also legal when it return Exception?rnI do a project using hivemind, using Interceptor. When i Call Proxy, it returns the "com.sun.jdi.InvocationException occurred invoking <em>method</em>", is that legal?
Deprecated 标签
在什么情况下应该使用Deprecated? 大家来讨论一下
treatment flow from idl data method
treatment flow <em>from</em> idl data <em>method</em> self use ............
select 1.00*IRF1 method from dual
报这个错 ORA-00900: invalid SQL statementrnrnrn想问一下 <em>method</em>在oracle是什么 查找不到 是需要添加什么吗
DataInputStream的问题
想从键盘输入一个long类型的整数,用DataInputStream,他的构造函数要一个InputStream的参数,我应该用哪种InputStream的子类?rnrn从键盘上读入各种java的基本类型数据,有什么方法?
DataInputStream 问题?
我现在用这种方法rnbyte[] byteforsend = new byte[length];rndataOutputStream.write(bytehead);rndataOutputStream.write(byteforsend);rn把byte数组放入dataOutputStream中rn现在想用datainputStream流中方法取出,并且转换成字符串形式,不知道应该做?rn
DataInputStream DataOutputStream
我想利用对数据流的操作来实现对各种类型的数据与byte[]之间的转换rn问题在于DataInputStream(InputStream in) DataOutputStream(OutputStream out)rn中的in,out如何得到
A threshold selection method from gray-level histogram
OTSU自适应阈值分割法的原理原始论文 有点年头了,但是清晰度没问题
ByteArrayInputStream DataInputStream
在从字节流中读取数据时可以使用如下方式rnbyte[] rec1;rnbyte[] rec2;rnByteArrayInputStream bais1=new ByteArrayInputStream(rec1);rnDataInputStream dis1=new DataInputStream(bais1);rnString name1=dis1.readUTF();rnByteArrayInputStream bais2=new ByteArrayInputStream(rec2);rnDataInputStream dis2=new DataInputStream(bais2);rnString name2=dis2.readUTF();rn能不能只使用一个ByteArrayInputStream bais和DataInputStream dis完成对两个字节数组的读取,rn向J2ME大侠请教高效读写数据的方法。
关于DataInputStream
完全不懂这个类,它的raadInt之类的方法读出的结果和我文件里的内容完全不一样。我不知道这个类是用来干什么的,请哪位大虾能解释一下啊。。最好详细点啊。。。。。。。。
DataInputStream和DataOutputStream
先向test.txt中写了一个float类型的变量和一个double类型的变量rn[code=java]rn DataOutputStream dos = new DataOutputStream(new FileOutputStream("e:\\test.txt"));rn dos.writeFloat(3.14F);rn dos.writeDouble(3.1415926);rn dos.close();rn[/code]rnrn然后用输入流去读取rn[code=java]rn DataInputStream dis = new DataInputStream(new FileInputStream("e:\\test.txt"));rn float f = dis.readFloat();rn double d = dis.readDouble();rn dis.close();rn System.out.println(f);rn System.out.println(d);rn[/code]rnrn运行结果是rn1.4757395E20rn-32.570000082271015rnrn为什么和我保存的数值不一样???
DataInputStream的问题!
先看下代码:rnrnFileInputStream fin = new FileInputStream("D:/utf.txt");rnDataInputStream in = new DataInputStream(fin); rnbyte content[] = new byte[10];rnin.read(content, 0, 10);rnrn很简单的程序,但是每次执行in的方法的时候总是提示java.io.EOFException,为什么?这里只是初始化了一下啊,根本就没有读过,怎么会出现EOF呢?
DataInputStream的readUTF()
public static void main(String[] args) throws Exceptionrnrn byte b[]="哈哈123".getBytes();rn DataInputStream dis1=new DataInputStream(new ByteArrayInputStream(b));rn tryrn rn System.out.println(dis1.readUTF());rn rn catch(EOFException ex)rn rn ex.printStackTrace();rn rnrnrnrn想不明白,为何老报:rnrnjava.io.EOFExceptionrn at java.io.DataInputStream.readFully(DataInputStream.java:268)rn at java.io.DataInputStream.readUTF(DataInputStream.java:639)rn at java.io.DataInputStream.readUTF(DataInputStream.java:610)rn at net.TSocket1.main(TSocket1.java:22)rnrn
DataInputStream的用法
"java大数据培训学校全套教材"系列课程由750集视频构成,基本就 是1)时下流行的java培训学校主流内部教材,2)和市面上培训学校的通 行的课程体系几乎一样。所以这套课程都能自己学下来,等于上了培训学 校一次,完全可以找个java工程师的工作了。rn 本门课程为"java大数据培训学校全套教材"系列课程的第九篇,通过学习字节流,字符流等相关概念,让大家对IO流编程打下好的基础。
DataOutputStream与DataInputStream
DataOutputStream.writeUTF(a1)rnDataOutputStream.writeUTF(a2)rnDataOutputStream.writeUTF(a3)rnrnrn_a1= DataInputStream.readUTF()rn_a2= DataInputStream.readUTF()rn_a3= DataInputStream.readUTF()rnrnrnrn是不是只要对应的顺序是对的 则_a1 就取得的是a1 _a2是a2的值rn是不是rnrn不管a1 a2是多长的stringrnrn???rnrn那么如果中间有个writeInt了??rnrn实现的机制是什么?????
计算机应用基础教程~第2章中文Widows操作系统下载
计算机应用基础教程~第2章中文Widows操作系统 相关下载链接:[url=//download.csdn.net/download/bigbt123/2412998?utm_source=bbsseo]//download.csdn.net/download/bigbt123/2412998?utm_source=bbsseo[/url]
Fieldtest基本用法下载
详细介绍了fieldtest各个项目的意义,基站测试的的好帮手 相关下载链接:[url=//download.csdn.net/download/libmind/3224546?utm_source=bbsseo]//download.csdn.net/download/libmind/3224546?utm_source=bbsseo[/url]
PhoneGap中文API下载
PhoneGap中文API 相关下载链接:[url=//download.csdn.net/download/dcopyboy88/7610641?utm_source=bbsseo]//download.csdn.net/download/dcopyboy88/7610641?utm_source=bbsseo[/url]
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数
我们是很有底线的