barriers / 阅读 / 详情

7.He was ____ with what he longed for eventually. A.awarded B.rewarded C.praised D.encouraged

2023-08-25 07:58:48
共1条回复
苏州马小云

这道题选B

这道题应该考的是 award 与reward 的辨析.

首先,award 为及物动词 vt.意思是:

1.授予,给予[(+to)][O1]

Phil was awarded the top prize.

菲尔获得头奖.

2.判给[(+to)][O1]

The judge awarded him $1000 as damages.

法官判给他损害赔偿金一千元.

其次,reward 为及物动词

意思为:1.报答,报偿;酬谢;奖励[(+with/for)][O1]

Winners will be rewarded a trip to England.

优胜者将获得去英国旅游的奖赏.

2.报应;惩罚(坏人或坏事)[(+for)]

He will sooner or later be rewarded for his wicked conduct.

他的恶行迟早会受到报应.

所以此句应该翻译为:最终,他得到了他一直以来渴望的作为奖励.

句式为:be reward with 报答,报偿;酬谢;奖励

以上仅为个人见解 如有不对请见谅.

相关推荐

rewarded是什么意思

rewarded是奖励;奖赏;给以报酬rewarded在英语中代表‘的过去式和过去分词、奖赏"的意思,其中文解释还有"酬谢"的意思,在线读音是[riu02c8wu0254:did],在英语中以名词出现较多。例句:1.He did, and was well rewarded。他做到了,也获得了赏赐。2.You should be rewarded for that。你该因此获得奖赏。3.Will be rewarded with prizes。会得到奖品。4.Yet, they are rewarded and considered to be respectable。然而他们得到的回报 被认为是可敬的。5.They rewarded his bravery with a gift。他们赏赐他的英勇。6.Baylor rewarded to you these are levy。这些是征贝勒赏赐给你们的。7. Sensibility and obedience are not always rewarded。敏感和服从不总有回报。8. Naturally, your loyalty will be rewarded。当然,各位的忠诚会得到报酬。9. You shall be rewarded in heaven!神会奖励你们的。
2023-08-19 23:55:291

翻译rewarded

奖励
2023-08-19 23:55:582

in the end he was rewarded for his perseverance.这里的rewarded 加ed是表示被动语态吗?

把副词handsomely先去掉,比较好理解:hewasrewardedforhisefforts.rewardfor表示作为……的酬谢这里既是被动态berewardedfor也是过去式was的用法,所以要加ed大意:他因为他的努力而获得奖赏。
2023-08-19 23:56:203

be+rewarded+for是什么意思

be desirable for 意思是是可取的,可行的。例句:1、Though not recommended, this can be desirable for specific situations. 虽然不推荐,但是在一些特定的情况下这是可行的。2、For this reason, it"s desirable for the storage system as a whole to understand where duplication occurs. 由于这一原因,存储系统从整体上理解复制发生在哪里是很可取的。3、That would, in my view, also be very desirable for both China and the world. 在我看来,这对中国乃至世界都是十分可取的。4、To have more leverage in Greece it would be highly desirable for China. 中国要想在希腊取得更大的影响力,比雷埃夫斯港就将是非常重要的。5、It is desirable for more amateur astronomers to build this relatively simple instrument. 它吸引了越来越多的业余天文学家去制作这种相对简单的仪器。desirable 英[du026au02c8zau026au0259ru0259bl] 美[du026au02c8zau026aru0259bu0259l] adj. 可取的; 令人满意的; 值得拥有的; 性感的; n. 称心如意的人[东西]; [例句]Prolonged negotiation was not desirable.拖长了的谈判并不是大家所想要的。
2023-08-19 23:56:512

be rewarded with是什么意思

be rewarded with得到…的奖赏; 例句:1.Use these steps for both days and you will be rewarded with over twenty days of easy family meals. 按照以下步骤进行两天的工作,你就能有二十几天不必为家人的三餐费心了。2.To encourage them to grow these reflective crops, farmers could be rewarded with carbon credits. 我们可以通过“碳奖赏”之类的方式让农民更乐于种植高反射率作物。
2023-08-19 23:56:591

改错题用英语怎么说

问题一:改错用英语怎么说 collect mistakes 问题二:改错题用英语怎么说。英语学霸帮忙啊。 楼上透着一股纯正的有道词典味道 correct the problem 就这样 你可能已经解答,但还是采纳一下 问题三:高考英语新题型改错题英语怎么说 The entrance of the new type English error correction problem 满意请采纳 问题四:高中英语改错题 为什么这里的the不用改成a,怎么翻译 right thing 应该指前面提到的事情,特指 真相,要说the truth 问题五:怎么做英语改错题? 高中英语改错题如何做! 改错是有规律可循的: 名词错误的可能 (1)名词单复数 只有这1种可能,而且到现在的改错,场场必考!名词单复数分规则和不规则,一定要记牢! 形容词错误的可能 (1)意思颠倒,要改成反义词 这个错错每次改错题目都有,所以看到错的句子有形容词,先上下文看看,有没有意思反了 (2)词性错误 2个形容词在一起,那肯定有一个是修饰另外一个的,所以要改成副词 介词错误的可能性 (1)固定短语的搭配问题,不如key to,answerto, be faced with等 这个错错每次改错题目都有,所以看到错的句子有介词,先看左右,有没有搭配错误、连词错误的可能性 (1)承上启下的错误 有时候,表示递进的,但题目中给出even if,所以要把if去掉;有时表原因的,但题目中是therefore,所以要改成because。。这样的错误也时常出现,但不是每次出现 (2)非限制性宾语从句只能由which引导,题目中很会用that来误倒 代词错误的可能性 (1)代词与先行词不一致 前面说了是单数,后面用了them,所以要改成it。这类的错误也经常发生 动词错误的可能性 (重点!) (1)时态错误 明明文章在说过去的事情,但用了个is,所以要改成was 这个错错每次改错题目都有,所以看到错的句子有动词,先看上下,有没有时态问题 (2)主谓不一致 they was doing …… 这样的错误,找不出么,6级也别考了 (3)非谓语动词提前形式的错误 viewed……,they were doing…… 像这样的情况,viewed就要改成viewing 如果后面是it,前面是ing形式,也要注意的 (4)平行结构错误 前面连着2句都是to做什么,to做什么and do什么,这时候就要在这个do前加to 如果是to doing,就要改成to do 以上这些错误在考试中占6-7分左右,可以一定要抓住,后面的分数就难拿了 另类错误 (1)易混淆的词 比如:His persistence was awarded when the car finallystarted 中间的awarded是错误的,应该改成rewarded (2)从上下文来看,应该改动的词 一般发生在名词的身上!!比如前面说美国人吃饭的习惯,后面写了chinese,那就要改成American (3)固定词组用错一个,造成意思完全改变 比如:It also takes rise to a blurring of the distinctionbetween science and technology 要把takes 改成 gives 这样的难点错误,解决方法是,能改则改,不能改确定哪个词错,骗2个0。5分 总的评注:做改错题一定要具有一双“慧眼”。重要的不是自己会运用一个语法点或知识点,而是能够识别出错误的用法,以审查的眼光去面对每一个改错题。这就需要掌握必要的答题步骤和技巧。 答题步骤: 1、一般来说,做题时千万不要拿起来就改。先花一、两分钟从头到尾通读全文,对文章大致内容有所了解,做到心中有数。 2、然后把重点放在有错误项的标题号行,寻找较容易辩认的语法错误,如主谓不一致、时态、语态使用错误、非谓语动词错误等等。 3、如果错行中不存在上述明显错误,则应查看是否有词语搭配错误,易混词错误、词性错误等等细节错误。 4、如果错行中既不存在语法错误,也不存在词汇错误,则从整体上查看上下文意思是否连贯,连接词是否使用正确,是否有逻辑混乱的现象,如否定句误用成肯定句造成句意不通等。注意:有时没有错项的行......>>
2023-08-19 23:57:231

一道英语语法题(>-

reward sb with sth填 with
2023-08-19 23:57:327

“丰厚的报酬”英语如何说?

a sumptuous reward
2023-08-19 23:57:515

be rewarded with be rewarded for区别

be rewarded with 只能跟sth.作宾语;而 be rewarded for 可以跟sth.或sb.作宾语
2023-08-19 23:59:051

be rewarded with be rewarded for区别

be rewarded with 只能跟sth.作宾语;而 be rewarded for 可以跟sth.或sb.作宾语
2023-08-19 23:59:141

good is rewarded with good

好人有好报. Give cake and ale to perfect soul. 好心未必有好报. The road to hell is paved with good intention. 这种观点认为世上有一套道德体系,善有善报恶有恶报(b乔治F.威尔) the sense that there is a moral economy in the world,that good is rewarded and evil is punished(bGeorge F.Will) 这种观点认为世上有一套道德体系,善有善报恶有恶报(乔治F.威尔) the sense that there is a moral economy in the world,that good is rewarded and evil is punished(George F.Will) 不用谢.善有善报,上次你也帮助过我. That"s all right.One good turn deserves another.Last time you helped me. 善有善报. One good turn deserves another. 善有善报. Do well and have well. 恶有恶报,善有善报. Bad deeds,as well as good,may redound on the doer. 善有善报,恶有恶报. Bad deeds,as well as good,may rebound upon the doer. [谚]发什么声音,有什么回声(善有善报,恶有恶报). As the call,so the echo.
2023-08-19 23:59:221

求翻译!谢谢!

延迟不是FORGETTING故事 THERE是与的一个湿软的垄沟围拢的一个老豪宅是的a吊桥,但是很少让下来:-不是所有的客人are好人。 在屋顶下是射击的漏洞through和倾吐在开水甚至在的溶解的主角下the敌人,应该他接近。 在房子里面屋子是高的very和有射线天花板,并且那是非常有用的considering烟巨大成交玫瑰色从chimney火木头大,潮湿的日志闷燃了的地方。 在the围住骑士的垂悬的图片装甲和骄傲的夫人的in华美的礼服; 最庄严所有走关于alive. 她告诉了Meta Mogen; 她是的女主人house,对她属于城堡。 Towards晚上强盗来了; 他们杀害了三她的people并且围场狗和的附属的夫人Meta由链子的kennel,而他们自己做了在的好欢呼the大厅和喝了酒和好强麦酒出于她的cellar. meta夫人现在是在链子,她不可能甚而bark. But lo! 仆人一个秘密强盗approached她; 他们不能看它,否则他们会have杀害了他。 " Meta Mogen夫人, “说家伙,仍然“做您记住how我的父亲,当您的丈夫活,必须乘坐on木马? 您为他祈祷了,但是它是没有好, he是乘坐,直到他的肢体被麻痹了; 但是您窃取了对他的down,因为我现在窃取给您,您你自己投入了一点在他也许把支持的他的每一只脚, 之下的stonesnobody看见了它,或者他们假装不看它,为了您是then年轻客气的女主人。 我的父亲告诉了我此, and我未忘记它! 现在我将解救您, Meta夫人Mogen! “ Then他们从槽枥里面拉马并且岔开了获得朋友协助的in雨和风。 "因而小服务对做老人富有地是rewarded! “Mogen说阶。 延迟的 "不忘记, “家伙说。 垂悬了The强盗。 There是一个老豪宅,它仍然是那里; 它没有对Meta Mogen,它夫人的belong属于另一老高尚的family. We现在是在当前时间。 太阳是光亮的在塔的gilt瘤,小的树木繁茂的海岛说谎象在水的bouquets和野生天鹅游泳围绕他们。 In庭院生长玫瑰; 房子的女主人是她自己the最美好的玫瑰花瓣,她放光充满喜悦,好喜悦 deeds : 然而,没做在宽世界,但是在她的心脏, and什么被保存那里没有被忘记。 延迟不是forgetting!
2023-08-19 23:59:315

his efforts were reward with success

答案:C 翻译:他的努力得到了成功的回报. 1.enjoy“喜欢/享受”,句意不通,排除B; receive意思是“收到/接待”,句意同样不通,排除D. 2.award做动词时,意思是“奖励/授予”,而reward准确意思是“酬谢/奖赏/报答”. 此题答案以C reward最佳. 3.两者还有一个区别如下: award sb sth = award sth to sb; reward sth to sb for (doing) sth = reward sb with sth for (doing) sth
2023-08-20 00:00:181

we shall be rewarded by the satisfaction that finding them brings. 这个brings是怎么回事

名词,译为他们所带来的东西
2023-08-20 00:00:264

be rewarded with .如何造句?谢谢。

你好,很高兴在这里回答你的问题:. Some believe that, since childhood, we are rewarded with food for being good. 一些人认为,从小我们就以食物作为奖励。
2023-08-20 00:00:341

Good deeds are rewarded with kindness_2000字

Because the ant fell into the river and was in danger, the big bird gave the ant a *** all kindness of wood, in exchange for the big bird to be safe in the difficult place. This is called good deeds and good rewards. There is a boy, in his hunger and cold, no one to help the situation, he desperate to the street to the last home for help. At this time, he fot that he was standing in front of the door to beg. Did not expect the girl said: you wait a moment, she handed the boy towel, let him dry the rain wet hair, and handed him a cup of hot milk. A few years later, the boy became a famous doctor. Once, he was surprised to find that a patient to be operated on was actually the angel, but the medical operation cost was beyond her affordability. The doctor immediately operated in person. After the operation was successful, the girl opened the medical bill and could not help crying. Medical expenses - a cup of hot milk. It never occurred to the girl that a *** all act of kindness many years ago turned out to be the bill to save her life. This can‘t help but remind me of the story about the shipbuilder and the shipowner. A *** all act of kindness of the boatman received gratitude and reward from the shipowner. Of course, good deeds and good rewards are beeen o people. There are also many people who do good deeds but can not get good rewards. Can"t help the old lady, let a person feel cold, why do their good behavior can‘t get return and affirmation, but let people sue in court? The “mind my own business” victims are not grateful to those who are desperate to save themselves, but are indifferent. If everyone does not have a sense of gratitude, who dares to do good things if it goes on like this for a long time? Good deeds and good retribution, first of all, es from the kindness of one side, but also from the gratitude of the other side. Without this gratitude, it is very difficult to have a good reward. The good deeds emphasized here are not material thanks. Those who do good deeds often need a kind of affirmation from the heart. With these affirmations, good deeds will be recycled again, and goodness will begin to pass on. The world will not bee indifferent and cold-blooded. Life is like wine, or strong, or fragrant, because good deeds and good rewards, it bees mellow; life is like a song, or high, or low, because it is good at good retribution, it bees melodious; life is picturesque, or bright, or elegant, because it is good at repaying, it bees beautiful. Being good at repaying is related to the harmonious society and the *** ooth realization of the Chinese dream. Let"s start philanthropy, let‘s leverage the Chinese dream! Let"s start good report, let‘s realize the Chinese dream!
2023-08-20 00:00:431

The local government _________ him the prize for his bravery. A.rewarded B.awarded C.won

B 试题分析:考察动词词义辨析。reward是报酬,回报,酬劳,就是某人做了一件事就可以拿到相应的报酬。而award是奖励,通常用作奖项等,比如Oscar Award;win赢得比赛,竞赛等;present呈现;句意:当地政府因为他的勇敢而奖励了他这个奖。故B正确。点评:对于动词词义辨析题目,首先可以从句意着手,看懂句意是解答此类题目的关键,其次四个选项的意思也要了如指掌。这对于平时学生的学习仔细度提出了要求,学生在平时的学习中要勤积累,多记忆,多查字典,以便在考试时能够迅速准确的答出。
2023-08-20 00:00:501

reward sth for sb 对吗?

不对reward主动句中常见搭配:reward sb.for sth.意思是:因为...而奖赏例如:People should be rewarded for special effort.人们特别出了力应得到奖赏.reward sb.with sth.是用...作为奖赏例如:They rewarded the winners with gifts of fruit and flowerw.他们送水果和鲜花来犒赏优胜者.
2023-08-20 00:00:581

问一句英语翻译及时采纳不要机器翻译 Do people feel rewarded when t

人们在给予的时候觉得有奖励回报感,到底是因为他们对受赠者的快乐感同身受,还是说他们因此觉得自己很慷慨而自信心增强,因而有助于情绪变好?
2023-08-20 00:02:102

关于善良的英语谚语

以下例举关于善良的英语谚语:1、Gentlemen nourish virtue by virtue, while villains nourish wealth by evil.君子以善养德,小人以恶养财。2、The heart is good, the virtue is great; there must be patience, everything is done.心有善,德乃大;必有忍,事乃成。3、A good dye in the heart is immortal. A hundred lights shine brightly, a thousand miles open.一善染心,万劫不朽。百灯旷照,千里通明。4、In ancient and modern times, there is nothing but doing good to accumulate virtue.古今世家大族,无非行善积德。5、A small good turn into a great blessing, a small evil turn into a great disaster.积小善成大福,积小恶成大祸。6、Evil is no greater than self-indulgence, good is no greater than self-discipline.恶莫大于纵己之欲,善莫大于律己之心。7、Forgive others with love, discipline yourself with reason, and help others with kindness.以情恕人,以理律己,以善助人。8、After watching people do good, discussing gains and losses only increases right and wrong.观人行善之后而议得失,只增是非。9、Good deeds are rewarded unexpectedly, and natural dreams are reassuring.行善不期获报,自然梦稳心安。10、They praise the good with all their hearts, but abandon the evil with all their hearts.尽心为善万人扬,有心作恶众人弃。
2023-08-20 00:02:191

急求一篇英语作文,劳动与收获

Some people say that life is a tea shall sun glow, the breeze was blowing when the clear sip; cup lamp was among the most compatible bride ray lingering fragrance. Some people say that life is intoxicating liquor shall be sough cold drink volume hit the dust when the wind, which reflects peripheral vision of the sweet and hot flashes with only the best flavor. Often, hi tea, when those who would lament the thunder storm of life and ruthless, Lok spirits in the wind when you fell in love with life Xuri dull. ?
2023-08-20 00:02:462

nlce什么意思?

i打成l 了吧nice 你不知道?好的
2023-08-20 00:02:574

Rome wasn’t built in a day. Work harder and practice more. Your hardworking will be rewarded by Go

罗马不是一天建成的,工作努力并更多练习,你的努力总有一天上帝会回报给你的,上帝对每个人都是很公平的
2023-08-20 00:03:315

Java 调 cmd 怎么控制该进程结束

期待大侠解决!
2023-08-19 23:59:002

QT5.3.2 + windows waitForReadyRead()函数为什么失效?

如果不能,那么为什么QT官方又说5.2以后的版本能运行于安卓和IOS?如果不能,那么为什么QT官方又说5.2以后的版本能运行于安卓和IOS?
2023-08-19 23:59:091

iwaitedforthewindtowaitforyou中文是什么

我等着风等着你
2023-08-19 23:59:1811

whomlwaitfor是什么意思

我在等谁
2023-08-19 23:59:462

待定什么意思

等待确定
2023-08-19 23:59:554

waitforfatherspresents的中文怎么说?

Wait for father"s presents.中文意思是:等待父亲的礼物。
2023-08-20 00:00:182

如何在Java中执行其它程序

在编写Java程序时,有时候需要在Java程序中执行另外一个程序。1、启动程序Java提供了两种方法用来启动其它程序:(1)使用Runtime的exec()方法(2)使用ProcessBuilder的start()方法不管在哪种操作系统下,程序具有基本类似的一些属性。一个程序启动后就程序操作系统的一个进程,进程在执行的时候有自己的环境变量、有自己的工作目录。Runtime和ProcessBuilder提供了不同的方式来启动程序,设置启动参数、环境变量和工作目录。能够在Java中执行的外部程序,必须是一个实际存在的可执行文件,对于shell下的内嵌命令是不能直接执行的。采用Runtime的exec执行程序时,首先要使用Runtime的静态方法得到一个Runtime,然后调用Runtime的exec方法。可以将要执行的外部程序和启动参数、环境变量、工作目录作为参数传递给exec方法,该方法执行后返回一个Process代表所执行的程序。Runtime有六个exec方法,其中两个的定义为:public Process exec(String[] cmdarray, String[] envp, File dir)public Process exec(String command, String[] envp, File dir)cmdarray和command为要执行的命令,可以将命令和参数作为一个字符串command传递给exec()方法,也可以将命令和参数一个一个的方在数组cmdarray里传递给exec()方法。envp为环境变量,以name=value的形式放在数组中。dir为工作目录。可以不要dir参数,或者不要envp和dir参数,这样就多出了其它4个exec()方法。如果没有dir参数或者为null,那么新启动的进程就继承当前java进程的工作目录。如果没有envp参数或者为null,那么新启动的进程就继承当前java进程的环境变量。也可以使用ProcessBuilder类启动一个新的程序,该类是后来添加到JDK中的,而且被推荐使用。通过构造函数设置要执行的命令以及参数,或者也可以通过command()方法获取命令信息后在进行设置。通过directory(File directory) 方法设置工作目录,通过environment()获取环境变量信息来修改环境变量。在使用ProcessBuilder构造函数创建一个新实例,设置环境变量、工作目录后,可以通过start()方法来启动新程序,与Runtime的exec()方法一样,该方法返回一个Process对象代表启动的程序。ProcessBuilder与Runtime.exec()方法的不同在于ProcessBuilder提供了redirectErrorStream(boolean redirectErrorStream) 方法,该方法用来将进程的错误输出重定向到标准输出里。即可以将错误输出都将与标准输出合并。2、Process不管通过那种方法启动进程后,都会返回一个Process类的实例代表启动的进程,该实例可用来控制进程并获得相关信息。Process 类提供了执行从进程输入、执行输出到进程、等待进程完成、检查进程的退出状态以及销毁(杀掉)进程的方法:(1) void destroy()杀掉子进程。一般情况下,该方法并不能杀掉已经启动的进程,不用为好。(2) int exitValue()返回子进程的出口值。只有启动的进程执行完成、或者由于异常退出后,exitValue()方法才会有正常的返回值,否则抛出异常。(3)InputStream getErrorStream()获取子进程的错误流。如果错误输出被重定向,则不能从该流中读取错误输出。(4)InputStream getInputStream()获取子进程的输入流。可以从该流中读取进程的标准输出。(5)OutputStream getOutputStream()获取子进程的输出流。写入到该流中的数据作为进程的标准输入。(6) int waitFor()导致当前线程等待,如有必要,一直要等到由该 Process 对象表示的进程已经终止。通过该类提供的方法,可以实现与启动的进程之间通信,达到交互的目的。3、从标准输出和错误输出流读取信息从启动其他程序的Java进程看,已启动的其他程序输出就是一个普通的输入流,可以通过getInputStream()和getErrorStream来获取。对于一般输出文本的进程来说,可以将InputStream封装成BufferedReader,然后就可以一行一行的对进程的标准输出进行处理。4、举例(1)Runtime.exec()import java.io.BufferedReader;import java.io.File;import java.io.InputStreamReader;public class Test1 {public static void main(String[] args) {try {Process p = null;String line = null;BufferedReader stdout = null;//list the files and directorys under C:p = Runtime.getRuntime().exec("CMD.exe /C dir", null, new File("C:\"));stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));while ((line = stdout.readLine()) != null) {System.out.println(line);}stdout.close();//echo the value of NAMEp = Runtime.getRuntime().exec("CMD.exe /C echo %NAME%", new String[] {"NAME=TEST"}); stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));while ((line = stdout.readLine()) != null) {System.out.println(line);}stdout.close();} catch (Exception e) {e.printStackTrace();}}(2)ProcessBuilderimport java.io.BufferedReader;import java.io.File;import java.io.InputStreamReader;import java.util.ArrayList;import java.util.List;public class Test2 {public static void main(String[] args) {try {List list = new ArrayList();ProcessBuilder pb = null;Process p = null;String line = null;BufferedReader stdout = null;//list the files and directorys under C:list.add("CMD.EXE");list.add("/C");list.add("dir");pb = new ProcessBuilder(list);pb.directory(new File("C:\"));p = pb.start();stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));while ((line = stdout.readLine()) != null) {System.out.println(line);}stdout.close();//echo the value of NAMEpb = new ProcessBuilder();mand(new String[] {"CMD.exe", "/C", "echo %NAME%"});pb.environment().put("NAME", "TEST");p = pb.start();stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));while ((line = stdout.readLine()) != null) {System.out.println(line);}stdout.close();} catch (Exception e) {e.printStackTrace();}}}5、获取进程的返回值通常,一个程序/进程在执行结束后会向操作系统返回一个整数值,0一般代表执行成功,非0表示执行出现问题。有两种方式可以用来获取进程的返回值。一是利用waitFor(),该方法是阻塞的,执导进程执行完成后再返回。该方法返回一个代表进程返回值的整数值。另一个方法是调用exitValue()方法,该方法是非阻塞的,调用立即返回。但是如果进程没有执行完成,则抛出异常。6、阻塞的问题由Process代表的进程在某些平台上有时候并不能很好的工作,特别是在对代表进程的标准输入流、输出流和错误输出进行操作时,如果使用不慎,有可能导致进程阻塞,甚至死锁。如果将以上事例中的从标准输出重读取信息的语句修改为从错误输出流中读取:stdout = new BufferedReader(new InputStreamReader(p.getErrorStream()));那么程序将发生阻塞,不能执行完成,而是hang在那里。当进程启动后,就会打开标准输出流和错误输出流准备输出,当进程结束时,就会关闭他们。在以上例子中,错误输出流没有数据要输出,标准输出流中有数据输出。由于标准输出流中的数据没有被读取,进程就不会结束,错误输出流也就不会被关闭,因此在调用readLine()方法时,整个程序就会被阻塞。为了解决这个问题,可以根据输出的实际先后,先读取标准输出流,然后读取错误输出流。但是,很多时候不能很明确的知道输出的先后,特别是要操作标准输入的时候,情况就会更为复杂。这时候可以采用线程来对标准输出、错误输出和标准输入进行分别处理,根据他们之间在业务逻辑上的关系决定读取那个流或者写入数据。针对标准输出流和错误输出流所造成的问题,可以使用ProcessBuilder的redirectErrorStream()方法将他们合二为一,这时候只要读取标准输出的数据就可以了。当在程序中使用Process的waitFor()方法时,特别是在读取之前调用waitFor()方法时,也有可能造成阻塞。可以用线程的方法来解决这个问题,也可以在读取数据后,调用waitFor()方法等待程序结束。总之,解决阻塞的方法应该有两种:(1)使用ProcessBuilder类,利用redirectErrorStream方法将标准输出流和错误输出流合二为一,在用start()方法启动进程后,先从标准输出中读取数据,然后调用waitFor()方法等待进程结束。如:import java.io.BufferedReader;import java.io.File;import java.io.InputStreamReader;import java.util.ArrayList;import java.util.List;public class Test3 {public static void main(String[] args) {try {List list = new ArrayList();ProcessBuilder pb = null;Process p = null;String line = null;BufferedReader stdout = null;//list the files and directorys under C:list.add("CMD.EXE");list.add("/C");list.add("dir");pb = new ProcessBuilder(list);pb.directory(new File("C:\"));//merge the error output with the standard outputpb.redirectErrorStream(true);p = pb.start();//read the standard outputstdout = new BufferedReader(new InputStreamReader(p.getInputStream()));while ((line = stdout.readLine()) != null) {System.out.println(line);}int ret = p.waitFor();System.out.println("the return code is " + ret);stdout.close();} catch (Exception e) {e.printStackTrace();}}}(2)使用线程import java.util.*;import java.io.*;class StreamWatch extends Thread {InputStream is;String type;List output = new ArrayList();boolean debug = false;StreamWatch(InputStream is, String type) {this(is, type, false);}StreamWatch(InputStream is, String type, boolean debug) {this.is = is;this.type = type;this.debug = debug;}public void run() {try {PrintWriter pw = null;InputStreamReader isr = new InputStreamReader(is);BufferedReader br = new BufferedReader(isr);String line = null;while ((line = br.readLine()) != null) {output.add(line);if (debug)System.out.println(type + ">" + line);}if (pw != null)pw.flush();} catch (IOException ioe) {ioe.printStackTrace();}}public List getOutput() {return output;}}public class Test5 {public static void main(String args[]) {try {List list = new ArrayList();ProcessBuilder pb = null;Process p = null;// list the files and directorys under C:list.add("CMD.EXE");list.add("/C");list.add("dir");pb = new ProcessBuilder(list);pb.directory(new File("C:\"));p = pb.start();// process error and output messageStreamWatch errorWatch = new StreamWatch(p.getErrorStream(),"ERROR");StreamWatch outputWatch = new StreamWatch(p.getInputStream(),"OUTPUT");// start to watcherrorWatch.start();outputWatch.start();//wait for exitint exitVal = p.waitFor();//print the content from ERROR and OUTPUTSystem.out.println("ERROR: " + errorWatch.getOutput());System.out.println("OUTPUT: " + outputWatch.getOutput());System.out.println("the return code is " + exitVal);} catch (Throwable t) {t.printStackTrace();}}}7、在Java中执行Java程序执行一个Java程序的关键在于:(1)知道JAVA虚拟机的位置,即java.exe或者java的路径(2)知道要执行的java程序的位置(3)知道该程序所依赖的其他类的位置举一个例子,一目了然。(1)待执行的Java类public class MyTest {public static void main(String[] args) {System.out.println("OUTPUT one");System.out.println("OUTPUT two");System.err.println("ERROR 1");System.err.println("ERROR 2"); for(int i = 0; i < args.length; i++){System.out.printf("args[%d] = %s.", i, args[i]);}}}(2)执行该类的程序import java.util.*;import java.io.*;class StreamWatch extends Thread {InputStream is;String type;List output = new ArrayList();boolean debug = false;StreamWatch(InputStream is, String type) {this(is, type, false);}StreamWatch(InputStream is, String type, boolean debug) {this.is = is;this.type = type;this.debug = debug;}public void run() {try {PrintWriter pw = null;InputStreamReader isr = new InputStreamReader(is);BufferedReader br = new BufferedReader(isr);String line = null;while ((line = br.readLine()) != null) {output.add(line);if (debug)System.out.println(type + ">" + line);}if (pw != null)pw.flush();} catch (IOException ioe) {ioe.printStackTrace();}}public List getOutput() {return output;}}public class Test6 {public static void main(String args[]) {try {List list = new ArrayList();ProcessBuilder pb = null;Process p = null;String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";String classpath = System.getProperty("java.class.path");// list the files and directorys under C:list.add(java);list.add("-classpath");list.add(classpath);list.add(MyTest.class.getName());list.add("hello");list.add("world");list.add("good better best");pb = new ProcessBuilder(list);p = pb.start();System.out.println(mand());// process error and output messageStreamWatch errorWatch = new StreamWatch(p.getErrorStream(),"ERROR");StreamWatch outputWatch = new StreamWatch(p.getInputStream(),"OUTPUT");// start to watcherrorWatch.start();outputWatch.start();//wait for exitint exitVal = p.waitFor();//print the content from ERROR and OUTPUTSystem.out.println("ERROR: " + errorWatch.getOutput());System.out.println("OUTPUT: " + outputWatch.getOutput());System.out.println("the return code is " + exitVal);} catch (Throwable t) {t.printStackTrace();}}}
2023-08-20 00:00:291

数据库中死锁是什么产生的?

Mysql数据库里的 锁,根据存储引擎不同,一般有行锁 表锁。其实锁的作用跟文件锁 是差不多的就是避免同时对某表 或某条记录进行修改。死锁 我估计是2个应用同时锁住了 同一个表 或 同一条记录。这样谁也释放不了资源。个人愚见。欢迎拍砖。
2023-08-20 00:01:093

请问下面这些程序是什么意思呢?单片机的

倒数两个分别是LCM初始化,和送数据
2023-08-20 00:01:592

菜鸟始终不明白互斥对象和 WaitForSingleObject!

你可以看看<windows核心编程>的第9章和第3章,里面对线程同步和内核对象有相当清楚的描述.
2023-08-20 00:02:125

java如何调用windows的命令?

用java做病毒啊?有难度..
2023-08-20 00:02:344

我已经预约了。用英文怎么讲

1.你好,我可以帮助你吗?hello,whatcanidoforyou?2.请问您有提前预约吗?didyouregisterinadvance?3您预约的是哪位医生?whichdoctordidyoupreparetosee?4.请您稍等。pleasewaitforamoment5.请到那边休息一下pleasehavearestthere.6.您的费用是......yourtotalexpenseis...7.请慢走pleasetakecare
2023-08-20 00:02:531

网金游侠打点怎么设置

PKStop(0)\停止打点delay(3000)\等待3000毫秒完全退出战斗ZXState(1)\停止自修Moveto(4211,926,722)\移动到消点地图SetXDInfo(39940,0,4211,599,926,2708,150)\消点准备师傅代码,事件,地图,X坐标,Y坐标,武功,目标等级SetDoXiaoDian(20)\消点>0则消点WaitFor(6,2,2000)\等待学点<2000一般情况都是直接消到0点MoveTo(66,666,666)\移动到休息地图HAVEREST()\休息PKStart()\开始打点WaitFor(6,1,300)\等待学点到300PKStop(0)\停止打点delay(3000)\等待3000毫秒完全退出战斗PKStart()\开始打点ZXState(0)\开始自修end();\结束
2023-08-20 00:03:022

waitforgreen什么游戏

是一款模拟生存游戏,游戏设定在亚马逊热带丛林。waitforgreen是一款模拟生存游戏,游戏设定在亚马逊热带丛林,吸引很多的玩家游玩。
2023-08-20 00:03:371

Pleasewaitfortheservertorespond什么意思?

Please wait for the server to respond翻译成为中文就是:请 等待 服务器 响应。(可能是访问的人过多)开心快乐每一天!
2023-08-19 23:58:242

求coldplay(酷玩乐队)-inmyplace歌词翻译

哈哈coldplay,我最喜欢的那首yellow要翻译么?这首inmyplace也不错,帮你翻译一下,有没有追加分数阿,呵呵萧饮寒inmyplace在我这里萧饮寒译inmyplace,inmyplace在我这里,在我这里werelinesthaticouldn"tchange我不能改变那些航线iwaslost,ohyeah我已经迷路了iwaslost,iwaslost我迷路了,我已经迷路了crossedlinesishouldn"thavecrossed我穿过了那些不应该穿过的航线iwaslost,ohyeah我已经迷路了yeah,howlongmustyouwaitforit?是啊,为此你必须要等待多久?yeah,howlongmustyoupayforit?是啊,为此你必须要付出多久?yeah,howlongmustyouwaitforit?是啊,为此你必须要等待多久?forit为了这iwasscared,iwasscared我受伤了,我已经受伤了tiredandunder-prepared精疲力尽毫无准备buti"llwaitforit但我要继续等待andifyougo,ifyougo如果你要走,你要走的话leavemedownhereonmyown让我一个人留在这里theni"llwaitforyou,yeah然后我会在这里等着你yeah,howlongmustyouwaitforit?是啊,为此你必须要等待多久?yeah,howlongmustyoupayforit?是啊,为此你必须要付出多久?yeah,howlongmustyouwaitforit?是啊,为此你必须要等待多久?forit为了这singingplease,please,please请歌唱吧comebackandsingtome回到我身边唱给我听tome,me给我听comeonandsingitout,now,now来吧唱出来吧comeonandsingitouttome,me来吧唱出来给我听吧comebackandsingit回到我身边唱出来吧inmyplace,inmyplace在我这里,在我这里werelinesthaticouldn"tchange我不能改变那些航线iwaslost,ohyeah我已经迷路了
2023-08-19 23:58:161

waitforaclassmate是什么意思?

等待同学希望你们能不能帮助你
2023-08-19 23:58:032

waitforaminute中文是什么

稍等I"ll be right back,please wait for a minute.我马上回来,请等一会儿。"Please wait for a minute, "she called down.“请稍等片刻。”她朝下面叫道。Will you wait for me? I shan"t be a minute.等等我行吗? 我马上就好。Would you wait here for a minute?您能在这里等一下吗?Oh Pam, can you come over here for a minute?喂,帕姆,你能来一下吗?He was not for a minute deceived by her words.他丝毫没有被她的话所蒙骗。I would like to talk to you for a minute.我想和你谈一下。Sit back for a minute and think about what you have done.坐一会儿,考虑考虑你干了什么事情。Would you wait for a minute?请你等一下好吗?I never suspected for a minute that youwere married.我万万没想到你已经结婚了。As I was waiting for a bus a brick fell on my head.当我在等公共汽车时,一块砖头落到了我的头上。It won"t hurt him to wait for a while.让他等一会儿没什麽关系。Wait for: Wait for me a minute, please. I"ll be back very soon.请等我一会儿,我很快就回来。It won"t hurt to wait for a while.多等一会儿没什麽关系。When waiting for a bus, he takes his turn.等公共汽车时,他按顺序排队。Would you please sit down and wait for a moment?您能坐这儿等一下吗?How long do you have to wait for a No. 63?乘63路车要等多久?She hesitated for a minute and then turned back.她踌躇一了会儿,然后回来了。She studied his face very intently for a minute.她对他的脸仔细端详了一分钟。
2023-08-19 23:57:551

java运行python程序,.readLine()读出的内容为null, proc.waitFor();返回值为1,求解

你在while循环里加行代码line = decodeUnicode(line);
2023-08-19 23:57:461

WAITFOR delay语句和WAITFOR time语句有什么区别?

举例来说:waitfor delay "11:02:03"表示要等待11个小时2分3秒后再执行下面的语句,而waitfor time "11:02:03"表示要等到11点2分3秒再执行下面的语句
2023-08-19 23:57:371

waitforyou是什么意思

等你。。。。
2023-08-19 23:57:292

java process.waitfor=3是什么意思

2进制位运算,表示a无条件右移3位,如果a=16,那么a>>>3的结果是2. 原理:16的2进制表示00001000 2的2进制表示00000010
2023-08-19 23:57:091

JAVA多线程 模拟每隔一秒输入一个数据

对于读取字符类型的文件,直接使用增强流中的readLine,一次就是一行,不用你想的这么麻烦!
2023-08-19 23:56:473

waitingforus/our后面一定要跟for吗

waitfor是固定搭配词组。wait是个不及物动词,要等某人,就须甪介词for,waitforsb等候某人。waitingfor,waiting是名词,等候等待服侍伺候的意思,形容词,等待的服侍的意思。
2023-08-19 23:56:361

waitforsb.todosth中的不定式做什么成分

to do做宾语补足语
2023-08-19 23:56:292

待的同音字

带 戴 袋 黛 代 贷 岱 殆 怠等 都是四声
2023-08-19 23:56:064

在SQL Server 中,WAITFOR 语句中的DELAY参数是指什么

delay是指需要等待延迟的时间如waitfor delay "02:00:00" 表时等待2小时后再执行后面的代码。
2023-08-19 23:55:551