Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~!
jasonwing27





发贴: 66
积分: 0
于 2005-09-18 14:56 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
import java.io.* ;
public class Jason {

  public static void main(String[] args) throws IOException {
    int conditionB = 0 ;
    String conditionAOne = "" ;
    String conditionATwo = "" ;

    BufferedReader in = new BufferedReader( new InputStreamReader (System.in) ) ;    
    
    Jason rw = new Jason() ;
    rw.condition() ;
    
  }

  public void condition(){
    System.out.println( "请输入A条件1:" ) ;
conditionAOne = in.readLine() ;
System.out.println( "请输入A条件2:" ) ;
conditionATwo = in.readLine() ;
    System.out.println( "请输入B条件:" ) ;
    conditionB = Integer.parseInt(in.readLine()) ;

    if( ((conditionAOne >= "a" && conditionAOne<="z") || (conditionAOne >= "A" && conditionAOne<="Z")) ||
      ((conditionATwo >= "a" && conditionATwo<="z") || (conditionATwo >= "A" && conditionATwo<="Z")) )
      
     System.out.println("r") ;
    else
System.out.println("w") ;

    if( conditionB >= "0" && conditionB <= "100" )
      System.out.println("r2") ;
    else
      System.out.println("w2") ;
  }

}




学java的朋友,请一起来投票让sun推出中文jdk文档!!!
作者 Re:写的程序出错了,想不通该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:jasonwing27]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2005-09-18 20:48 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
The comparison operators, i.e., ==, >=, >, <, etc., don't work with String, you may want to use String's equals() and compareTo() methods (and the variants).

You should have continued to use the topic 请教判断语句 to post this question.
As I mentioned in this post, you may have to do the comparison character-by-character.

知道 学的不好 就找本書好好讀讀,
如果真的看不懂,想不通,就不要再看,想通應否放棄學習編程--
人人各有專長,何必把時間浪費於不適合自己,力不從心的事情上?


why edited on 2005-09-18 20:51


为什么这个Applet不能在浏览器显示啊?
作者 Re:写的程序出错了,想不通该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:why]
ranchgirl



版主


发贴: 801
积分: 132
于 2005-09-18 22:49 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
why wrote:
如果真的看不懂,想不通,就不要再看,想通應否放棄學習編程--
人人各有專長,何必把時間浪費於不適合自己,力不從心的事情上?


I cannot agree more!!!

gongshi wrote:
In education, there is a famous saying:

"The question is not how smart you are, but how you are smart."

In Chinese, it probably means, "问题不在於你是否聪明,而是你在哪方面聪明。"

Finding out where and on what your talent is, that is very important and benificial to your life and future.

Not everyone can be a good programmer. However, everyone can be good on something you really good at.

Find that out, and smile!

Good luck to your future!

Copied from my post here
http://bbs.chinajavaworld.com/post/view?bid=20&id=660344&sty=1&tpg=1&age=0&ppg=1




Java应用者与<IDE/环境>
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:jasonwing27]
jasonwing27





发贴: 66
积分: 0
于 2005-09-18 23:47 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
问题儿童,如果你不想解答我的问题,你可以不说话,我是学的不好,但是我是在努力,这个又不是什么作业,难道我有问题就不能问吗?
如果是这个样子,这个论坛还开它干什么啊?
你会就可以鄙视别人吗?




Windows环境下的tomcat + apache配置(绝对实践操作版)
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:jasonwing27]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2005-09-19 00:50 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
jasonwing27 wrote:
问题儿童,如果你不想解答我的问题,你可以不说话,我是学的不好,但是我是在努力,这个又不是什么作业,难道我有问题就不能问吗?
如果是这个样子,这个论坛还开它干什么啊?
你会就可以鄙视别人吗?

提示已經在上面和"请教判断语句"給閣下。
閣下當然可以問,但把這一段code丟出來有甚麼意思?--除了讓大家知道閣下學得一塌糊塗之外... I'm serious.

如果閣下還是想不通,而又不肯好好讀讀書學好基礎,那麼
閣下根本不適合繼續編程!

不是鄙視,而是誠懇地勸閣下好好想一想努力的方向,世事往往徒勞無功的。
請記住gongshi引的那句話:问题不在於你是否聪明,而是你在哪方面聪明。

敲中文字實在辛苦...
I have reviewed your profile before I wrote so -- I did do some work before I made the suggestions.
You have been asking beginner's questions since last Sept, and I don't think your skills have improved -- you are still asking trivial questions that one could easily learn from any introductory book on Java.
Maybe you don't understand the hints I provided...


why edited on 2005-09-19 01:17


菜鸟请教,基本程序调试不通,急急急急急急!!!
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:why]
ranchgirl



版主


发贴: 801
积分: 132
于 2005-09-19 02:11 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
why wrote:
敲中文字實在辛苦...


Yes, I know...

苦口婆心, 真是热心人...

But, please remember this statement by someone else
http://bbs.chinajavaworld.com/post/view?bid=18&id=464233&sty=1&tpg=1&age=-1
"一个人改变自己都那么难,你还想改变别人?
Please ignore....


gongshi edited on 2005-09-19 02:14


致JAVA初学者+如何下手学JAVA
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:why]
liang





发贴: 19
积分: 0
于 2005-09-20 23:12 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
why wrote:
I have reviewed your profile before I wrote so -- I did do some work before I made the suggestions.
You have been asking beginner's questions since last Sept

不愧是元老,敬佩的说!




联想游戏(欢迎跟贴,哈)
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:jasonwing27]
jinger





发贴: 3
积分: 0
于 2005-09-21 09:26 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
敲中文字實在辛苦...
敲中英文字也實在辛苦...

靠你起挖 日语发音
意思是:
你好早安
呵呵
以后得向元老请教呀




Eclipse使用技巧
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:jasonwing27]
什么头





发贴: 2
积分: 0
于 2005-09-22 10:19 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
看起来像……javascript当然,如果你入行早,叫livescript我也没意见……



如何用JTable设置表头多行
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:jasonwing27]
wuyoubei1





发贴: 11
积分: 0
于 2005-09-22 16:08 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
所有的问题都自己解决了,还问你们干什么。发出来把错误给大家看,让众人共同提高,这难道不是开论坛的目的吗,编程只靠一个人的力量怎么行的通。



如何用JTable设置表头多行
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:jasonwing27]
wuyoubei1





发贴: 11
积分: 0
于 2005-09-22 16:12 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
敲中文字實在辛苦...

这网站是谁开的,找个不怕 “敲中文字實在辛苦...” 的人来解决问题,好不。




Eclipse使用技巧
作者 Re:写的程序出错了,想不同该怎么改,我学的不好,请高手帮忙!谢谢~! [Re:wuyoubei1]
bluecrystal





发贴: 2788991
积分: 48
于 2005-09-22 17:07 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
wuyoubei1 wrote:
敲中文字實在辛苦...

这网站是谁开的,找个不怕 “敲中文字實在辛苦...” 的人来解决问题,好不。


拜托,论坛本来就是一个没有谁强迫谁必须回答或者不回答的地方
你有权力发问,但别人也有选择不回答的权利
这里本来就是一个大家共享,交流的自由场所
没有强迫性哈

btw 你的程序代码里面,有如下几处错误:
1 main里面定义的conditionAOne、conditionATwo、conditionB怎么能直接在另外一个函数condition()里面用呢?如果你非要在这几个函数里面公用变量,那也得放在类里面吧,而且静态函数里面调用非静态成员变量也是有规定的,看书;
2 第二个,如why所说,java的字符串比较不能单纯的用><=之类的来完成,而应该用String这个类提供的函数;
。。。。。


bluecrystal edited on 2005-09-22 17:31

Just Software & Travel
-- 我的blog -- 技术点滴/经验分享

学java的朋友,请一起来投票让sun推出中文jdk文档!!!

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   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