Topic: 编译信息,不解。(Thread.stop() has been deprecated) |
Print this page |
1.编译信息,不解。(Thread.stop() has been deprecated) | Copy to clipboard |
Posted by: kirk Posted on: 2003-05-04 09:48 Note: D:\process\Process.java uses or overrides a deprecated API. warning: xxx() in java.x.x has been deprecated 编译通过,运行时找不到main(); ???????????? 我用了 Thread.stop()方法,编译信息:Thread.stop()has been deprecated |
2.Re:编译信息,不解。 [Re: kirk] | Copy to clipboard |
Posted by: why Posted on: 2003-05-04 10:06 What Does Deprecation Mean? (from the Java Tutorial) You might have heard of the term "self-deprecating humor." It describes humor that minimizes one's own importance. Similarly, when a class or method is deprecated, it means that the class or method is no longer considered important. It is so unimportant, in fact, that it should no longer be used at all, as it might well cease to exist in the future. The need for deprecation comes about because as a class evolves, its API changes. Methods are renamed for consistency. New and better methods are added. Attributes change. But making such changes introduces a problem: You need to keep the old API around until people make the transition to the new one, but you don't want developers to continue programming to the old API. The ability to mark a class or method as "deprecated" solves the problem. Existing classes that use the old API continue to work, but the compiler can issue a warning when it finds references to deprecated items. Meanwhile, API documentation can warn the user against using the deprecated item and tell the user how to avoid doing so. To mark API as deprecated, the implementer of the API uses a special tag in doc comments: @deprecated. Do you need Chinese translation of this topic? 如何及何時不鼓勵使用 API Here's why thread.stop is deprecated: Why Are Thread.stop, Thread.suspend, Thread.resume and Runtime.runFinalizersOnExit Deprecated? 编译通过,运行时找不到main(); 是另一个问题,到底阁下的程式里有没有main()呢?贴上来看看吧! |
3.Re:编译信息,不解。 [Re: kirk] | Copy to clipboard |
Posted by: kirk Posted on: 2003-05-04 12:40 谢谢why! 只是太长了,是有main()方法的...... 可能是我的jdk设置也有问题。 |
4.Re:编译信息,不解。 [Re: kirk] | Copy to clipboard |
Posted by: why Posted on: 2003-05-04 13:03 kirk wrote: 先把整个错误信息贴上来吧! 按理和jdk设置无关的说 通常新手犯的错是像 class name 和 filename 不匹配(包括弄错大小写)、main 不是定义为 public static void main (String[] args) |
5.Re:编译信息,不解。 [Re: kirk] | Copy to clipboard |
Posted by: kirk Posted on: 2003-05-04 13:30 对了,我没有定义为public static void main (String[] args) 谢谢why了! 还有实例一个BufferedReader对象怎么实例啊:public BufferedReader(Reader in) 参数Reader in我试过很多Reader都不行。 |
6.Re:编译信息,不解。 [Re: kirk] | Copy to clipboard |
Posted by: why Posted on: 2003-05-04 13:47 kirk wrote: What're you trying to do? How did the Readers that your tired fail? InputStreamReader(System.in) & FileReader("fileToRead.txt") should work, at least. Did you catch exception when using BufferedReader... well, I'm not 100% sure it's required -- too lazy to check the API doc -- but I always have the proper try-catch constructions when using IO stuff. Frankly I don't understand 实例一个BufferedReader对象怎么实例 because of my limited Chinese. What's 实例 in English? 对象 is Object, isn't it? |
7.Re:编译信息,不解。 [Re: kirk] | Copy to clipboard |
Posted by: kirk Posted on: 2003-05-04 14:13 thank you! I want to read some strings from the comand lines(the program is running on MS-DOS of windows,not with graph by using any Swing and AWT package), The mean of 实例 is to construct a object of a class.Yes,对象 is Object. My English is not good(is very worse!)。My CET4 test has not passed,and I'm a student of Grade 3(3 years in school) of my University now! |
8.Re:编译信息,不解 -- read some strings from the comand lines [Re: kirk] | Copy to clipboard |
Posted by: why Posted on: 2003-05-08 01:53 I searched for BufferedReader on http://javaalmanac.com/ and found this: http://javaalmanac.com/egs/java.io/ReadFromStdIn.html?l=find e34. Reading Text from Standard Input try { |
9.Re:编译信息,不解。 [Re: kirk] | Copy to clipboard |
Posted by: floater Posted on: 2003-05-08 03:51 There is an article about how dangerous the method stop() is at Sun's site. If I were you, I wouldn't ignore this warning, although I am lazy most of the time, . |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |