ja

阅读 / 问答 / 标签

请介绍一下BENJAMIN(本杰明)的< where shall we go>

http://www.douban.com/subject/1868896/

漫画家Benjamin(张彬)是哪年生人?

1974.5.16

Benjamin 日语怎么写?

成熟してよ!せいじゅくしてよ! 成熟点吧 少し熟しているでしょう

benjamin所有文学作品

2000年5月《夏天没有的花》 2001年《鸽子在无声地飞翔》BENJAMIN的《记得》2002 年 出版个人作品集《 ONEDAY 》&《 BENJAMIN 电脑漫画技法》 2004 年 出版《记得》&《一天 》新版 2005 年 小说《地下室》 2006 年小说《我们去哪儿》&《Remember》法文版出版 2007 年《救世主》&艺术“剧画” Orange(《橘子》)法文版出版 2008 年 杂文集《总有一天》,英文版画集《flash》,《记得》德文版发行,中文版画集《本杰明》 2009年出版《本色 NO.1湛蓝》 2010年出版《本色 NO.2酒红》

benjamin 是谁

我想你问的一定是那位画漫画的,首位在法国出版漫画的中国新漫画家, 素有中国新锐漫画第一人之称的漫画狂人本杰明简介 笔名:BENJAMIN 本名:张彬 籍贯:黑龙江 学历:大连轻工学院服装设计专业 主要漫画作品:《SENA警官》、《夏天没有的花》、《下午课堂的幻想》、《鸽子在 无声地飞翔》、《一天》、《那年夏天》、《没有人会飞没有人会记得》 、《橘子》、《救世主》 小说集:《地下室》、《我们去哪》 其他:《BENJAMIN电脑漫画技法》 电影海报作品《七剑》 主编杂志:《本色NO.1:湛蓝》(2009年5月) 《本色NO.2:酒红》(2009年12月)

java里什么是“抽象数据类型”类型。参考问题补充里的那段话,呵呵,百度百科的我都看了。不要再粘啊。谢

应该是翻译问题,抽象数据类型在这里应该是指 泛型。

求X Japan的goodbye的罗马音歌词!

X-japan( hide)-goodbye Say good bye tada Good bye. Say goodbye ただGoodbye say good bye 只是good bye Subete no wazurawashisa ni Good bye. 全ての烦わしさに Goodbye 向所有的烦恼 说good bye Say good bye tada Good bye. Say goodbye ただGoodbye say good bye 只是good bye Kawaru koto osorezuni Good bye. 変わる事恐れずに Goodbye 向不再害怕的变化 说good bye Atemo naku tada aruite. あても无く ただ步いて 没有目的 只是随便走走 Tsukareta hibi no takara ni Good bye. 疲れた日々の宝に Goodbye 向已厌倦的日子 说good bye Susundeyuku michishirube wa. 进んで行く 道标は 身边的路标 Saisho to onaji kaze no mama ni. 最初と同じ风のままに 仍是不变的最初 随风前行 If you can′t find a way. If you can"t find a way 如果你不能找到方向 Ikutsu mono Winding road. いくつもの Winding road 前有多少条 winding road Sora ni te wo kazashite Round & round. 空に手をかざして Round & round 向天空伸出手 round & round Mada minu tochi ni fuan oboenagara. まだ见ぬ土地に 不安觉えながら 感觉无力触及的恐惧 Chiisana uta ni tazuneru. 小さな诗に 寻ねる 循着细微的歌声 一路寻觅 Please songs tell me true. Please songs tell me true 用歌声告诉我真相 Kimi no melody. 君のメロデイー 你的旋律伴随左右 Doko ni itemo naritsudzuketeiru. 何処にいても 鸣り续けている 无论何时 无论何地 Mata itsuka hitori mayottemo. またいつか 一人迷っても 从迷境中走出 Kikoetanara karoyaka ni arukidaseru. 闻こえたなら やかに步きてせる 伴随你的旋律 Say good bye tada Good bye. Say goodbye ただGoodbye say good bye 只是good bye Kizutsuku no wo osorezuni Good bye. 伤つくのを恐れずに Goodbye 向不再害怕的伤痛 说good bye Te no naka no machi kirenai. 手の中の持ちきれない 负担不了 太多的回忆 Omoi wa subete suteteyukou. 思いは全て舍てて行こう 那就全部抛弃 Please songs tell me true. Please songs tell me true 用歌声告诉我真相 Kimi no melody. 君のメロデイー 只要有你的旋律 Doko ni itemo naritsudzuketeiru. 何処にいても 鸣り续けている 也许独自迷失 Moshi dokoka hitori mayottemo. もし何処か 一人まよっても 在未知的何地 Utaetanara shinayaka ni arukidaseru. 歌えたなら しなやかに步きだせる 伴随歌声 悠然前行 Goodbye... 下载:http://p9jik.lifepop.com/files/user33/337588/x-japan%20-%20hide%20-%20goodbye_goodbye(psyence).mp3

一个JAVA的问题

分类: 电脑/网络 >> 程序设计 >> 其他编程语言 问题描述: import java.applet.Applet; import java.awt.*; public class splash extends Applet implements Runnable { int XMAX=112; float[] m_Height=new float[MAX]; float[] m_G=new float[XMAX]; float b=1.01f; float fWeight=3; private Thread m_NAMI2D=null; public boolean mouseDown(Event event, int i, int j) { m_Height[i/4-1]+=j/2; m_Height[i/4]+=j; m_Height[i/4+1]+=j/2; return false; } public void paint(Graphics g) { g.setColor(Color.blue); float f1=3F*fWeight; float f2=f1-2.0F; m_Height[0]=m_Height[1]; m_Height[XMAX-1]=m_Height[XMAX-2]; float f=m_Height[0]; for(int i=1; i<XMAX-1;i++) { float f3=((f+f2*m_Height[i]+m_Height[i+1])/f1 +m_G[i]/b; f=m_Height[i]; m_G[i]=f3-f; m_Height[i]=f3; g.clearRect((i-1)*4, (int)f3-30, 4, 60); g.fillRect((i-1)*4, (int)f3+30, 4, 60); } } public void run() { do try { repaint(); Thread.sleep(50L); } catch(InterruptedException_ex); { stop(); } while(true); } public void start() { if(m_NAMI2D==null) { m_NAMI2D=new Thread(this); m_NAMI2D.start(); } } public void stop() { if (m_NAMI2D !=null) { m_NANI2D.stop(); m_NAMI2D=null; } } public void update(Graphics g) { pain(g); } } 到底哪里错了?我都是照着书打的啊! splash.java:31: ")" expected +m_G[i]/b; ^ splash.java:47: <identifier> expected catch(InterruptedException_ex); ^ splash.java:47: ")" expected catch(InterruptedException_ex); ^ splash.java:53: while expected public void start() ^ splash.java:73: "(" expected } ^ splash.java:74: "}" expected ^ 6 errors 为什么出现了那么多的错误。 解析: 我发现你的错误都是语法错误,目前情况有二: 1。符号的中英文状态问题; 2。变量、函数符号的书写错误; 建议你使用高亮显示变量、函数名和关键字的编译工具:如NetBeans,JBuilder,eclipse等。 代码修改如下,修改处有注释: package baidu.zhidao; import java.applet.Applet; import java.awt.*; public class Splash extends Applet implements Runnable { int XMAX=112; float[] m_Height=new float[XMAX]; 此处写成了MAX float[] m_G=new float[XMAX]; float b=1.01f; float fWeight=3; private Thread m_NAMI2D=null; public boolean mouseDown(Event event, int i, int j) { m_Height[i/4-1]+=j/2; m_Height[i/4]+=j; m_Height[i/4+1]+=j/2; return false; } public void paint(Graphics g) { g.setColor(Color.blue); float f1=3F*fWeight; float f2=f1-2.0F; m_Height[0]=m_Height[1]; m_Height[XMAX-1]=m_Height[XMAX-2]; float f=m_Height[0]; for(int i=1; i<XMAX-1;i++) { float f3=(f + f2*m_Height[i] + m_Height[i+1])/f1 + m_G[i]/b; 原始的空格有中文状态的,括号不匹配 f=m_Height[i]; m_G[i]=f3-f; m_Height[i]=f3; g.clearRect((i-1)*4, (int)f3-30, 4, 60); g.fillRect((i-1)*4, (int)f3+30, 4, 60); } } public void run() { do try { repaint(); Thread.sleep(50L); } catch (InterruptedException ex) 此处多了“;” ,“_” { stop(); } while(true); } public void start() { if(m_NAMI2D==null) { m_NAMI2D=new Thread(this); m_NAMI2D.start(); } } public void stop() { if (m_NAMI2D !=null) { m_NAMI2D.stop(); 此处m_NA M I2D写成了m_NA N I2D m_NAMI2D=null; } } public void update(Graphics g) { paint(g); 此处paint写成了pain } } 欢迎到我的学习日志一起学习,讨论问题。 jink2005.blog.sohu/

JAVA编写 将阿拉伯数字转换成中文大写(不要Script的)

public class ChangeNum{ private String ch_Char; private String [] ch_Chars = new String[]{"一","二","三","四","五","六","七","八","九","十"}; void setNum(int num){ if(num<=0 || num>=11){ // Err Info......... } ch_Char = ch_Chars[num-1]; } public String getNum(){ return ch_Char; }}main方法就不用给出了

Trojan-Dowmloader.Win32.Agent.bff是什么????卡巴杀不掉,求高手给个办法!~~~~~~~~~~~

江民可以杀了~

java query所以方法

query

java中query怎么使用

他是hibernate中的一个查询对象的方法

breakdown(jack johnson)的中文歌词翻译

Ihopethisoldtrainbreaksdown我期望着这辆旧火车可以停下thenIcouldtakeawalkaround这样我就可以下车走在了and,seewhatthereistosee然后看看周围的风景andtimeisjustamelody时间如悦耳的音乐allthepeopleinthestreet街上的人们walkasfastastheirfeetcantakethem步履匆匆Ijustroamthroughtown而我却是在漫步Andthoughmywindowsgotaview透过窗我看见Theframeimlookingthrough一幕幕景象seemstohavenoconcernformenow现在仿佛都和我无关sofornow现在他们都与我无关Ineedthishere我现在希望oldtraintobreakdown旧列车可以停下来ohpleasejust仅仅停下来就可letmepleasebreakdown请为我停下Thisenginescreamsoutloud火车头发出轰鸣Sayinthebeatgunnacrawlwestbound说着它在向西行驶soIdontevenmakeasound于是我保持沉默causeitsgunnastingmewhenIleavethistown因为在离开这个城镇的时候,内心尚有一丝悲伤Allthepeopleinthestreet街上的人们thati"llnevergettomeet我再不会遇见ifthesedontbendsomehow如果没有了回头的理由andIgotnotime而我已没有时间thatIgottogetto我已经离开whereIdontneedtobe我不需要去的地方SoI所以我Ineedthishere我现在需要它:oldtraintobreakdown旧火车赶快停下ohpleasejust仅仅需要停下letmepleasebreakdown让我可以歇息IneedthishereoldtraintobreakdownohpleasejustletmepleasebreakdownIwannabreakondown我需要歇息butIcantstopnow但我现在无法停下letmebreakondown请让我停下Butyoucantstopnothing不过你无法停止任何东西ifyougotnocontrol如果你控制不住ofthethoughtsinyourmind心中的想法thatyoukeptin,youknow你执着的想念,你知道的youdontknownothing你分明知道butyoudontneedtoknow但你无须知晓thewisdomsinthetrees树里的智慧nottheglasswindows而非玻璃窗Youcantstopwishing你不能停止渴望Ifyoudontletgo如果你不放弃Butthingsthatyoufind但是你获得的andyoulose,andyouknow和你失去的,你知道的youkeeponrolling你一直在犹豫putthemomentonhold抓住这一刻吧theframestoobright那些景象多么生动soputtheblindsdownlow把窗帘拉下吧IneedthishereoldtraintobreakdownohpleasejustletmepleasebreakdownIneedthishereoldtraintobreakdownohpleasejustletmepleasebreakdown以上重复Iwannabreakondown我不想再继续butIcantstopnow但我无法停下

breakdown(jack johnson)的中文歌词翻译

I hope this old train breaks down我多希望这列旧车停歇then I could take a walk around让我下来散步and, see what there is to see看看周围的景象and time is just a melody时间如柔美曲调流淌all the people in the street市镇里街上的人们walk as fast as their feet can take them行步匆匆不敢迟缓I just roam through town而我只是在漫游And though my windows got a view透过窗我看见The frame im looking through一幕幕景象seems to have no concern for me now现在仿佛都和我无关so for now现在和我无关I need this here我需要这old train to breakdown旧列车停歇oh please just噢请仅仅let me please breakdown请为我停下This engine screams out loud引擎在尖啸Sayin the beat gunna crawl westbound说着它在向西行驶so I dont even make a sound我甚至没有说一个字cause its gunna sting me when I leave this town因为离开这市镇的悲伤All the people in the street街上的人们that i"ll never get to meet我再不会见到if these dont bend somehow如果没有莫名的冲动使我回头and I got no time而我已没有时间that I got to get to我已经去了where I dont need to be我不需要去的地方So I所以我I need this hereold train to breakdownoh please justlet me please breakdownI need this hereold train to breakdownoh please justlet me please breakdownI wanna break on downbut I cant stop nowlet me break on downBut you cant stop nothing但是你可以停下if you got no control如果你控制不住of the thoughts in your mind心中的想念that you kept in, you know你执着的想念,你知道的you dont know nothing你分明知道but you dont need to know但你不需要the wisdoms in the trees树里的智慧not the glass windows不是玻璃的窗You cant stop wishing你无法停止渴望If you dont let go如果你不放弃But things that you find但是你获得的and you lose, and you know和你失去的,你知道的you keep on rolling你一直在犹豫put the moment on hold抓住这一刻吧the frames too bright那些景象多么生动so put the blinds down low把窗帘拉下吧I need this hereold train to breakdownoh please justlet me please breakdownI need this hereold train to breakdownoh please justlet me please breakdownI wanna break on down我想停下but I cant stop now而现在我已做不到

如何使这段java代码兼容firefox与IE

试了半天,终于可以啦。你测试一下吧<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD> <script language="javascript" type="text/javascript"> function expandIt(el) { var obj = eval("sub" + el); var ocj = eval("main" + el); if (obj.style.display == "none") { obj.style.display = "block";//显示子菜单 ocj.style.backgroundImage = "url(/user/skin/fold_2.gif)";//替换样式 }else { obj.style.display = "none"; ocj.style.backgroundImage = "url(/user/skin/fold_1.gif)";//替换样式 } }</script> <BODY><img src="1.gif"><div class="main1" id="main1" onclick="expandIt(1)">menu1</div><ul class="sub" id="sub1" style="display:none"><li><a href="1" target="Main">sub1</a></li><li><a href="1" target="Main">sub2</a></li><li><a href="1" target="Main">sub3</a></li></ul><div class="main2" id="main2" onclick="expandIt(2)">menu1</div><ul class="sub" id="sub2" style="display:none"><li><a href="1" target="Main">sub1</a></li><li><a href="1" target="Main">sub2</a></li><li><a href="1" target="Main">sub3</a></li></ul> </BODY></HTML>

javascript脚本语言能否与服务器的数据库交互

可以,请参考如下网站的方法:http://blog.csdn.net/luoshengsha/archive/2008/04/22/2314490.aspx

我的世界为什么安装了java还说没安装安装好几遍了

您应该检查启动器的设置,看看Java的路径有没有选对

Jay zhou的歌曲《Mine Mine》中的歌词“mine mine”是什么意思?谢谢了,大神帮忙啊

第一段副歌用英文唱着「Cuz baby you are mine mine」,因为你是我的,歌名「mine mine」也就是指这个意思;和「mine mine」同音的台语「唛唛」是指不要的意思,第二段副歌转为唱着台语「唛唛 你唛搁唛搁偷偷离开」,英中台三语巧妙转化,非常贴近现代年轻人的口语习惯,却有一种独特风味,既有中文情歌的诗情,又有台语歌曲宣泄的”馈口”(台语),令人印象深刻。

求 JAY 《MINE MINE 》的歌词,,,

[ti:Mine Mine][ar:周杰伦][al:][by:][00:18.57]没有你的生活 我开始写小说[00:22.89]  好多画面好多灵感 我要把稿费都给你[00:27.28]  巷口不小心经过 你的车子依旧停在红线 帮你缴罚单[00:32.91] 你叫我别管 我才想到我们已经分开[00:35.84]  想起那一个夏天 那不是那不是那是冬天[00:39.87]  想起你生气的脸 每天就像冬天 唉唉唉[00:47.61]  你说那是爱爱爱[00:52.36]  谁该坚强起来 月亮还是太阳 是谁遮了谁 是谁都会依赖[01:00.88]  你说已分开 为什么还要帮你撑伞[01:07.93]  Cuz baby you are mine mine(Mine)[01:11.56]  Mine mine(Mine)[01:17.96]  太快 就承认 我真的很想你[01:23.42]  会不会没有男子气概 You say[01:26.72]  Bye-bye(Bye )[01:30.60]  Oh bye-bye(Bye )[01:35.07]  拆开 我的心随你看 满满的都是爱[01:47.16]  我的眼皮跳一下 代表你在想我[01:52.78]  我的耳朵痒一下 代表你在讲我坏话[01:56.90]  我没这么不好吧 不用跟朋友说吧[02:00.92]  如果以后和好了 看到你朋友不是很尴尬[02:05.06]  想起那一个夏天 那不是那不是那是冬天[02:09.35]  想起你生气的脸 每天就像冬天 唉唉唉[02:16.50]  你说那是爱爱爱[02:22.10]  骗谁 我说的气话都收回[02:24.87]  我写的小说根本是空白黑夜[02:29.13]  你说既然已分开 为何还要帮你撑伞[02:37.51]  唛唛 你唛搁唛搁偷偷离开[02:46.36]  唛唛 你唛搁唛搁偷偷离开[02:47.43]  唛惊 我不会放你一人治那 你想祙有人靠有人会疼[02:55.64]  唛呐 你雨伞雨伞赶紧打开[02:59.78]  唛呐 你雨伞雨伞赶紧打开[03:04.07]  唛闹 落大雨你淋雨我艰苦 落大雨我没你会艰苦[03:28.24]  Cuz baby you are mine mine(Mine )[03:37.00]  Mine mine(Mine )[03:38.49]  太快 就承认 我真的很想你[03:43.64]  会不会没有男子气概 You say[03:46.56]  唛呐 你雨伞雨伞赶紧打开[03:50.78]  唛呐 你雨伞雨伞赶紧打开[03:55.04]  唛闹 落大雨你淋雨我艰苦 落大雨我没你会艰苦

javascript bind的用法

bind( )方法用于将一个处理程序附加到每个匹配元素的事件上并返回jQuery对象。 .bind(eventType[, evnetData], Handler(eventObject)) 其中,参数eventType是一个字符串,包含一个或多个javaScript事件类型,例如click,submit或自定义事件的名称,指定多个事件类型时用空格分隔各个类型;eventData为Map类型,给出要传递给事件处理程序的数据,handler指定触发该事件时要执行的函数,eventObject表示事件对象。 .bind()方法将事件处理程序handler附加到匹配元素集合中的每个元素的eventType事件上,如果需要,还可以向事件处理程序传递数据。

Vaja上海专卖店在哪里????

打电话查114

请问java socket 里面的bind做什么用?

bind,是绑定一个本地的端口,listen是侦听一个远程的连接端口

JACS-u200b香港理工黄勃龙和北大郭少军:u200b高熵合金亚纳米带一般合成方法

研究背景 内容简介 基于此,近日香港理工大学黄勃龙和北京大学郭少军团队设计了一种新的通用低温方法,将多达八种金属元素合并到一个单相亚纳米带中,以获得世界上最薄的HEA金属材料。实验表明,超薄HEA亚纳米带(SNR)的合成过程包括:(1)通过不同金属前体与银纳米线模板之间的电交换反应形成不同的金属原子成核,(2)不同金属前体在纳米线模板上的共还原,以及(3)去除内部银核。密度泛函理论(DFT)计算表明,HEA SNR的结晶和稳定性强烈依赖于模板中的“高动态”Ag,HEA亚纳米带的结晶水平与Pt和Pd的浓度密切相关。目前的合成方法能够灵活控制HEA SNR中的组分和浓度,以实现HEA SNR库和优异的电催化性能。设计良好的HEA SNR在催化燃料电池氧还原反应方面有很大的改进,并且具有高放电容量、低充电过电位和优异的锂电池耐久性 氧气电池。DFT计算表明,HEAs中高浓度还原性元素具有很强的还原能力,而其他元素则保证了有效的电子转移。相关论文以“A General Synthetic Method for High-Entropy Alloy Subnanometer Ribbons”发表在J. Am. Chem. Soc. 本文亮点 1. 构建2D HEA SNR的一般合成路线,包括但不限于五元(PtPdIrRuAg)、六元(PtPdIrRuAuAg)、七元(PtPdIrRuAuRhAg)和八元(PtPdIrRuAuRhOsAg)SNR。 2. 合成机理研究表明,HEA SNR是通过(1)不同金属前驱体与银之间的电偶交换反应形成不同的金属原子成核而形成的纳米线模板,(2)不同金属前体在纳米线模板上的共还原,(3)去除内部银核。 3. 密度泛函理论(DFT)计算表明,银从模板上的最大迁移是保证HEA中其他金属元素稳定的基本因素。同时,钯和铂的浓度对于确定HEA的结晶水平至关重要。在催化应用方面,代表性的五元HEA SNR是碱性电解质中ORR的高效和稳定的电催化剂。 4. DFT计算证实,高动态还原元素(Pd、Pt、Ag、Au)的浓度对于实现HEA的优异电活性至关重要,相对惰性的氧化元素(Ir、Ru、Rh、Os)提高了站点到站点的电子转移效率,但可能导致局部聚集。 图文解析 TEM,HAADF-STEM,PXRD HEA PtPdIrRuAg SNR的宽度为50 150 nm,长度可达数微米。HEA-PtPdIrRuAg SNR 的厚度确定为约 0.8 nm。所获得的 HEA-PtPdIrRuAg SNR 的PXRD结果表明HEA-PtPdIrRuAg SNR 采用无相偏析的 fcc 合金结构。EDS元素映射揭示了Pt、Pd、Ir、Ru和 Ag 元素在五元中的均匀分布。HEA-PtPdIrRuAg SNR 上表面原子排列的原子分辨率 HAADF-STEM 图像和相应的快速傅里叶变换(FFT)模式进一步证明HEA-PtPdIrRuAg SNR 采用 (001)面向fcc 的结构。来自 HEA-PtPdIrRuAg SNR 中各个选定区域的 (200) HEA 晶格说明所获得的五元 HEA 中的晶格畸变。 HAADF-STEM,PXRD 不同成分金属在模板上的可控成核和生长是通过湿化学合成中的电流交换途径和共还原过程实现的,脱合金策略实现了新型 HEA 的二维结构演化。HEA 合成方法是通用的,可用于制造具有 fcc 晶体结构的 六元HEA-PtPdIrRuAuAg SNR、七元 HEA-PtPdIrRuAuRhAg SNR和八元 HEA-PtPdIrRuAuRhOsAg SNR。此外,严重的晶格畸变以及8组分 HEA-PtPdIrRuAuRhOsAg SNR中的无序晶格可能会在一个原子平面上导致更多的原子堆垛层错,这会在不均匀的晶面上引起明显的 X 射线布拉格散射,导致八元 HEA 信噪比的PXRD 衍射峰强度减弱和变宽。 MD模拟 为了进一步了解HEAs的形成过程,通过MD模拟进行DFT计算。为了了解HEA形成过程中原子的动力学,他们比较了元素的均方位移(MSD)。金属原子在HEA形成过程中不断移动,MSD表示金属原子随时间相对于其原始位置的位置偏差。随着更多元素被引入HEA,整体MSD也增加,表明原子迁移行为更强,熵更高,不稳定性可能增加。在HEA形成过程中,Pd和Pt是决定HEAs结晶性的主要因素。Pd和Pt对HEA-SNR的形成有重要的促进作用,而其他金属对HEA-SNR的形成没有明显的影响。 电化学性能 在O2饱和的 0.1 M KOH 中 探索 了五元 HEA-Pt23Pd20Ir17Ru16Ag24SNR 的电催化 ORR 性能,并进一步与商业 Pt/C 进行了比较。HEA-PtPdIrRuAg SNRs/C 的半波电位 (E1/2) 为 0.93 V,而 ORR 的RHE远高于商业 Pt/C(0.85 V)。在 0.90 V 时,HEA-PtPdIrRuAg SNRs/C 的质量活度为 4.28 A mgPt-1和 1.69 A mgPGMs-1(Pt 族金属,PGMs),比商业 Pt/C 高出 21.4 和 8.45 倍( 0.20 A mgPt-1)。经过 10000 次电位循环后,HEA-PtPdIrRuAg SNRs/C 的半波电位几乎没有变化,HEA-PtPdIrRuAg SNRs/C 的质量活度保持在 3.64 A mgPt-1和 1.43 A mgPGMs-1,在 10 000 个循环中分别比商业 Pt/C(0.14 A mgPt-1)高 26.0 倍和 10.2 倍。 电池性能测试 在0.10 A g-1时,HEA-PtPdIrRuAuAg SNRs/C 在 0.10 A g-1 的电流密度下显示出 0.87 V 的低充电过电位和 5252 mAh g-1 的高放电容量。当放电容量在 0.10 A g-1 下固定为 1000 mAh g-1 时,HEA-PtPdIrRuAuAg SNRs/C 的充电过电位低至 0.59 V。随着电流密度从 0.10 增加到 1.00 A g-1,充电过电位仍低于 1.00 V(1000 mAh g-1 时为 0.75 V)。低充电电压也可以通过 0.05 mV s-1 从 2.00 到 4.50 V 的循环伏安法 (CV) 曲线来证明,其中 HEA-PtPdIrRuAuAg SNRs/C 在 0.75 V 处可见低氧化峰。该结果表明 HEA-PtPdIrRuAuAg SNRs/C 可以作为Li2O2分解的有效催化剂。基于 HEA-PtPdIrRuAuAg SNRs/C 的 Li-O2 电池在 0.50 A g-1 下具有 100 次循环的稳定耐久性。 DFT计算 用密度泛函理论(DFT)研究了HEAs的电子结构和电活性。结果表明 Pd、Pt、Ag 和Au 是实现具有强还原能力的稳定 HEA 的关键因素。同时,Ru、Ir、Rh和Os提高了电子转移能力。这两种金属之间的优化平衡导致 ORR 和 Li-O2 电池在五元和六元 HEA 中的卓越性能。除了Ir 和 Ru,Pt 显示出很高的键合可能性。特别是,Pt 和 Os 在相邻位置上是高度优选的。通过 DFT 在五元HEA-PtPdIrRuAg 和 六元HEA-PtPdIrRuAuAg 中进一步研究了 ORR 和 Li-O2 电池的性能。在 0 V 下,ORR过程显示出持续的下坡趋势。对于 Li-O2 电池,Li 到Li2O2 的放电过程显示出自发转化。 该研究主要计算及测试方法 做同步辐射 找易科研 做球差电镜 找易科研 做计算 找易科研 易科研 | 让你科研不再难

bird和jay的区别

bird和jay的区别是含义不同。根据查询相关信息显示:bird的基本意思是鸟,指区别于走兽、鱼、昆虫等可在天空飞行(除个别种类不可)的两翼两腿的动物,jay是指鸟,松鸡,松鸦,爱唠叨的人,碎嘴子,喋喋不休的人。

super 在Java继承中的作用??

可以使用父类的信息,因为有些方法子类被重写...

vulnerable javascript library怎么解决

F盘下面有隐藏的自动运行文件,双击打开F盘的时候就会运行,感觉有点儿像是病毒。 显示所有F盘下的文件,将该文件删除,应该就可以了。 最好杀个毒。

java中的"radio"是什么意思?

RadioButton 单选按钮

干部在线学习视频不能观看,已经安装最新java,但是出现如下提示,求解决

这个貌似是 windows media player吧=,你下一个最新的装上试试呢。

java 存储数据到blob

将字符串转换成byte数组String.getBytes(),然后放进一个ByteArrayInputStream输入流中即可存入BLOB字段中PreparedStatement.setBlob(int parameterIndex, InputStream inputStream)

java里怎么判断Blob类型是否为空

要看写的Blob类型是什么是不是只的boolean类型还是声明为Boolean的类jdk1.4情况下java里有基本类型的boolean和Boolean的包装类。两者是有区别的。至于什么区别,我想楼主应该多看看书。Blooean的声明的变量是引用类型。这个引用将指向一个对象。该对象可以为空。例如:Boolean b = null;System.out.println(b);打印的结果是 null;当然如果声明为基本类型,打印结果默认是false的,例如:boolean b ;System.out.println(b);打印的结果是falsejdk5.0的情况没做测试结果不清楚。估计结果和上面是一样的。但是因为在jdk5.0的情况下包装类对象和基本类型似乎可以互相直接转化例如:int i = new Integer(5);这种语句在1.4情况下编译不过的,似乎5.0就可以。所以5.0以后的情况不确定

java 怎样将File 对象转换为Blob

Blob...好像不是常用类型,是自定义的吧。好吧,最简单的方法。假设已知File类型的file1。List testList=new ArrayList();testList.add(file1);Blob blob=(Blob)testList.get(0);如果可以强转的话,以上代码均有效。换句话说只要Blob是File类型的子类以上代码就有效,否则报错,无法强转。

java中blob类型是什么类型

java基本类型中没有blob类型,应该是自定义的一个类。

java中blob类型是什么类型

java基本类型中没有blob类型,应该是自定义的一个类。

java 关于blob类型问题

用byte类型

Jay Sean的《Maybe》 歌词

歌曲名:Maybe歌手:Jay Sean专辑:MAssive R&B Winter 2008Jay Sean - MaybeBeep Beep On it now there goes my phoneAnd once again I"m just hoping it"s a text from youIt ain"t right I read your messages twice twiceFour times a night it"s trueEveryday I patiently waitFeeling like a fool but I do anywayNothing can feel as sweet and as realAs now that I would"ve waited one dayAnd maybe it"s trueI"m caught up on youMaybe in a while you"ll be stuck on me tooSo maybe I"m wrongIt"s all in my headMaybe we"ll await on words we both hadn"t saidI always connected onlineWatching my space all the timeHoping that you"ve checked my profileJust can"t help wondering why you play it cool but sometimesI just keep falling for youEvery night I"m on the phone and ILoving you and I know you that you like it girlNow don"t keep it inside what"s in the nightNo come say what your trying to hideAnd maybe it"s trueI"m caught Up On YouMaybe in a while you"ll be stuck on me tooSo maybe I"m wrongIt"s all In my headMaybe we"ll await on words we both hadn"t saidLike I really want youI think I need youMaybe I miss youI"m thinking of youLike I really want youI think I need youMaybe I miss youI"m thinking of youAnd maybe it"s trueI"m caught Up On YouMaybe in a while you"ll be stuck on me tooSo maybe I"m wrongIt"s all In my headMaybe we"ll await on words we both hadn"t saidAnd maybe it"s trueI"m caught Up On YouMaybe in a while you"ll be stuck on me tooSo maybe I"m wrongIt"s all In my headMaybe we"ll await on words we both hadn"t saidMaybe it is tureI"m caught up on youMaybe I am wrongMaybe I miss youhttp://music.baidu.com/song/18706746

java中如何把 varbinary 转换成blob

Blob...好像不是常用类型,是自定义的吧。好吧,最简单的方法。假设已知File类型的file1。List testList=new ArrayList();testList.add(file1);Blob blob=(Blob)testList.get(0);如果可以强转的话,以上代码均有效。换句话说只要Blob是File类型的子类以上代码就有效,否则报错,无法强转。

使用java语言操作,如何来实现MySQL中Blob字段的存取

/** * Title: BlobPros.java * Project: test * Description: 把图片存入mysql中的blob字段,并取出 * Call Module: mtools数据库中的tmp表 * File: C:downloadsluozsh.jpg * Copyright: Copyright (c) 2003-2003 * Company: uniware * Create Date: 2002.12.5 * @Author: ChenQH * @version 1.0 版本* * * Revision history * Name Date Description * ---- ---- ----------- * Chenqh 2003.12.5 对图片进行存取 * * note: 要把数据库中的Blob字段设为longblob * */ //package com.uniware; import java.io.*; import java.util.*; import java.sql.*; public class BlobPros { private static final String URL = "jdbc:mysql://10.144.123.63:3306/mtools?user=wind&password=123&useUnicode=true"; private Connection conn = null; private PreparedStatement pstmt = null; private ResultSet rs = null; private File file = null; public BlobPros() { } /** * 向数据库中插入一个新的BLOB对象(图片) * @param infile 要输入的数据文件 * @throws java.lang.Exception */ public void blobInsert(String infile) throws Exception { FileInputStream fis = null; try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); conn = DriverManager.getConnection(URL); file = new File(infile); fis = new FileInputStream(file); //InputStream fis = new FileInputStream(infile); pstmt = conn.prepareStatement("insert into tmp(descs,pic) values(?,?)"); pstmt.setString(1,file.getName()); //把传过来的第一个参数设为文件名 //pstmt.setBinaryStream(2,fis,(int)file.length()); //这种方法原理上会丢数据,因为file.length()返回的是long型 pstmt.setBinaryStream(2,fis,fis.available()); //第二个参数为文件的内容 pstmt.executeUpdate(); } catch(Exception ex) { System.out.println("[blobInsert error : ]" + ex.toString()); } finally { //关闭所打开的对像// pstmt.close(); fis.close(); conn.close(); } } /** * 从数据库中读出BLOB对象 * @param outfile 输出的数据文件 * @param picID 要取的图片在数据库中的ID * @throws java.lang.Exception */ public void blobRead(String outfile,int picID) throws Exception { FileOutputStream fos = null; InputStream is = null; byte[] Buffer = new byte[4096]; try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); conn = DriverManager.getConnection(URL); pstmt = conn.prepareStatement("select pic from tmp where id=?"); pstmt.setInt(1,picID); //传入要取的图片的ID rs = pstmt.executeQuery(); rs.next(); file = new File(outfile); if(!file.exists()) { file.createNewFile(); //如果文件不存在,则创建 } fos = new FileOutputStream(file); is = rs.getBinaryStream("pic"); int size = 0; /* while(size != -1) { size = is.read(Buffer); //从数据库中一段一段的读出数据 //System.out.println(size); if(size != -1) //-1表示读到了文件末 fos.write(Buffer,0,size); } */ while((size = is.read(Buffer)) != -1) { //System.out.println(size); fos.write(Buffer,0,size); } } catch(Exception e) { System.out.println("[OutPutFile error : ]" + e.getMessage()); } finally { //关闭用到的资源 fos.close(); rs.close(); pstmt.close(); conn.close(); } } public static void main(String[] args) { try { BlobPros blob = new BlobPros(); //blob.blobInsert("C:Downloadsluozsh1.jpg"); blob.blobRead("c:/downloads/1.jpg",47); } catch(Exception e) { System.out.println("[Main func error: ]" + e.getMessage()); } } }

Rxjava操作符之辩解map和flatmap的区别,以及应用场景

spark map flatMap flatMapToPair mapPartitions 的区别和用途 map: 对RDD每个元素转换 flatMap: 对RDD每个元素转换,

Rxjava操作符之辩解map和flatmap的区别,以及应用场景

spark map flatMap flatMapToPair mapPartitions 的区别和用途 map: 对RDD每个元素转换 flatMap: 对RDD每个元素转换,

rxjava中map和flatmap 有什么区别

spark map flatMap flatMapToPair mapPartitions 的区别和用途 map: 对RDD每个元素转换 flatMap: 对RDD每个元素转换,

Rxjava操作符之辩解map和flatmap的区别,以及应用场景

spark map flatMap flatMapToPair mapPartitions 的区别和用途 map: 对RDD每个元素转换 flatMap: 对RDD每个元素转换,

rxjava中map和flatmap 有什么区别

map使用在一对一的转换,flatMap使用在一对多的转换,比如学生和学号是一对一,我们就用map,学生和所选课程是一对多,我们就用flatMap

Java线程中wait状态和block状态的区别

BLOCKED是指线程正在等待获取锁;WAITING是指线程正在等待其他线程发来的通知(notify),收到通知后,可能会顺序向后执行(RUNNABLE),也可能会再次获取锁,进而被阻塞住(BLOCKED)

java分析代码执行过程,输出结果

那个啥,你确定你的程序没有问题。 你的employee.id在employe里边都没有给他赋值。还有就是第二个类中间的括起来的那段代码是什么意思的,不是方法来的。

java中static作用详解

http://zhidao.baidu.com/question/217432296.html参考一下吧~

java中怎么向数据库插入数据(java怎么导入数据库)

Java程序向数据库中插入数据,代码如下://首先创建数据库,(aess,oracle,mysql,sqlsever)其中之一,其中aess,sqlsever需要配置数据源(odbc);//然后再eclipse中创建类(ConnDb,Test,TestBean)ConnDb功能为连接数据库,查询,插入,删除,修改数据的类,Test为含有main方法的测试类,TestBean为数据表中的字段属性及set,get方法//以下是ConnDb代码:packagedb;importjava.sql.Connection;importjava.sql.;importjava.sql.ResultSet;importjava.sql.;importjava.sql.Statement;importjava.util.ArrayList;publicclassConnDb{publicConnectionstartConn(Connectionconn){try{Class.forName("sun.jdbc.odbc.");conn=.("jdbc:odbc:数据库","用户名","密码");}catch(Exceptione){System.out.println("连接数据库时出现错误");}returnconn;}publicArrayList(Stringsql){Connectionconn=null;Statementstmt=null;ResultSetrs=null;ArrayListlist=newArrayList();try{conn=startConn(conn);stmt=conn.();rs=stmt.(sql);//sql为sql语句例如"select*from表名",从main方法中传进来,这里用的是ArrayList类将查询结果存储起来while(rs.next()){TestBeantb=newTestBean();tb.setTid(rs.getString("tid"));tb.setTname(rs.getString("tname"));tb.setTinfo(rs.getString("tinfo"));list.add(tb);}}catch(e){//TODOAuto-generatedcatchblocke.();}finally{closeConn(rs,stmt,conn);}returnlist;}publicvoid(Stringsql){Connectionconn=null;Statementstmt=null;try{conn=startConn(conn);stmt=conn.();stmt.(sql);}catch(e){System.out.println("修改,插入或者删除数据库数据时发生错误!");}finally{closeConn(stmt,conn);}}publicvoidcloseConn(ResultSetrs,Statementstmt,Connectionconn){try{if(rs!=null){rs.close();}if(stmt!=null){stmt.close();}if(conn!=null){conn.close();}}catch(e){//TODOAuto-generatedcatchblockSystem.out.println("关闭数据库的时候发生错误!");}}publicvoidcloseConn(Statementstmt,Connectionconn){try{if(stmt!=null){stmt.close();}if(conn!=null){conn.close();}}catch(e){//TODOAuto-generatedcatchblockSystem.out.println("关闭数据库的时候发生错误!");}}}

Java中用什么方法提取Random()中产生的随机数

产生随机数,没有限制范围Randomrand=newRandom();取出指定范围数据intnum=rand.nextInt();打印值System.out.Println(num);依次类推

java中Random方法包含在哪个包中

Random类在java.util.Random而random方法在java.lang.Math.random();java.long不用引用,用Math.random();可以引用

java中Math类中的random方法和Random类有什么区别?

本质上其实没什么区别,Math类的random方法其实也是调用了Random类的nextDouble方法。

请高人指教java中random函数的详细知识!本人不胜感激!谢谢了!

此类的实例用于生成伪随机数流.如果用相同的种子创建两个 Random 实例,则对每个实例进行相同的方法调用序列,它们将生成并返回相同的数字序列。为了保证此属性的实现,为类 Random 指定了特定的算法。为了 Java 代码的完全可移植性,Java 实现必须让类 Random 使用此处所示的所有算法。但是允许 Random 类的子类使用其他算法,只要其符合所有方法的常规协定即可。 Random 类实现的算法使用一个 protected 实用工具方法,每次调用它最多可提供 32 个伪随机生成的位。很多应用程序会发现 Math.random() 方法更易于使用方法摘要 protected int next(int bits) 生成下一个伪随机数。 boolean nextBoolean() 返回下一个伪随机数,它是取自此随机数生成器序列的均匀分布的 boolean 值。 void nextBytes(byte[] bytes) 生成随机字节并将其置于用户提供的 byte 数组中。 double nextDouble() 返回下一个伪随机数,它是取自此随机数生成器序列的、在 0.0 和 1.0 之间均匀分布的 double 值。 float nextFloat() 返回下一个伪随机数,它是取自此随机数生成器序列的、在 0.0 和 1.0 之间均匀分布的 float 值。 double nextGaussian() 返回下一个伪随机数,它是取自此随机数生成器序列的、呈高斯(“正态”)分布的 double 值,其平均值是 0.0,标准差是 1.0。 int nextInt() 返回下一个伪随机数,它是此随机数生成器的序列中均匀分布的 int 值。 int nextInt(int n) 返回一个伪随机数,它是取自此随机数生成器序列的、在 0(包括)和指定值(不包括)之间均匀分布的 int 值。 long nextLong() 返回下一个伪随机数,它是取自此随机数生成器序列的均匀分布的 long 值。 void setSeed(long seed) 使用单个 long 种子设置此随机数生成器的种子。

Java里使用random如何返回一个0-3的随机数。

int num=(int)(Math.random()*4);PS:Math.radom()*4;返回的是0~3,不包括4。

java中random是什么意思

  Random()函数能够返回带正号的double值,该值大于等于0.0且小于1.0,即取值范围是[0.0,1.0)的左闭右开区间,返回值是一个伪随机选择的数,在该范围内(近似)均匀分布。

java关于Random的用法

Random类中实现的随机算法是伪随机,也就是有规则的随机。在进行随机时,随机算法的起源数字称为种子数(seed),在种子数的基础上进行一定的变换,从而产生需要的随机数字。相同种子数的Random对象,相同次数生成的随机数字是完全相同的。也就是说,两个种子数相同的Random对象,第一次生成的随机数字完全相同,第二次生成的随机数字也完全相同。这点在生成多个随机数字时需要特别注意。下面介绍一下Random类的使用,以及如何生成指定区间的随机数组以及实现程序中要求的几率。1、Random对象的生成 Random类包含两个构造方法,下面依次进行介绍: a、public Random()该构造方法使用一个和当前系统时间对应的相对时间有关的数字作为种子数,然后使用这个种子数构造Random对象。 b、public Random(long seed)该构造方法可以通过制定一个种子数进行创建。示例代码:Random r = new Random();Random r1 = new Random(10);再次强调:种子数只是随机算法的起源数字,和生成的随机数字的区间无关。2、Random类中的常用方法Random类中的方法比较简单,每个方法的功能也很容易理解。需要说明的是,Random类中各方法生成的随机数字都是均匀分布的,也就是说区间内部的数字生成的几率是均等的。下面对这些方法做一下基本的介绍:a、public boolean nextBoolean()该方法的作用是生成一个随机的boolean值,生成true和false的值几率相等,也就是都是50%的几率。b、public double nextDouble()该方法的作用是生成一个随机的double值,数值介于[0,1.0)之间。c、public int nextInt()该方法的作用是生成一个随机的int值,该值介于int的区间,也就是-231到231-1之间。如果需要生成指定区间的int值,则需要进行一定的数学变换,具体可以参看下面的使用示例中的代码。d、public int nextInt(int n)该方法的作用是生成一个随机的int值,该值介于[0,n)的区间,也就是0到n之间的随机int值,包含0而不包含n。如果想生成指定区间的int值,也需要进行一定的数学变换,具体可以参看下面的使用示例中的代码。e、public void setSeed(long seed)该方法的作用是重新设置Random对象中的种子数。设置完种子数以后的Random对象和相同种子数使用new关键字创建出的Random对象相同。3、Random类使用示例使用Random类,一般是生成指定区间的随机数字,下面就一一介绍如何生成对应区间的随机数字。以下生成随机数的代码均使用以下Random对象r进行生成:Random r = new Random();a、生成[0,1.0)区间的小数 double d1 = r.nextDouble();直接使用nextDouble方法获得。b、生成[0,5.0)区间的小数double d2 = r.nextDouble() * 5;因为nextDouble方法生成的数字区间是[0,1.0),将该区间扩大5倍即是要求的区间。同理,生成[0,d)区间的随机小数,d为任意正的小数,则只需要将nextDouble方法的返回值乘以d即可。c、生成[1,2.5)区间的小数 double d3 = r.nextDouble() * 1.5 + 1;生成[1,2.5)区间的随机小数,则只需要首先生成[0,1.5)区间的随机数字,然后将生成的随机数区间加1即可。同理,生成任意非从0开始的小数区间[d1,d2)范围的随机数字(其中d1不等于0),则只需要首先生成[0,d2-d1)区间的随机数字,然后将生成的随机数字区间加上d1即可。d、生成任意整数int n1 = r.nextInt();直接使用nextInt方法即可。e、生成[0,10)区间的整数int n2 = r.nextInt(10);n2 = Math.abs(r.nextInt() % 10);以上两行代码均可生成[0,10)区间的整数。第一种实现使用Random类中的nextInt(int n)方法直接实现。第二种实现中,首先调用nextInt()方法生成一个任意的int数字,该数字和10取余以后生成的数字区间为(-10,10),然后再对该区间求绝对值,则得到的区间就是[0,10)了。同理,生成任意[0,n)区间的随机整数,都可以使用如下代码:int n2 = r.nextInt(n);n2 = Math.abs(r.nextInt() % n);f、生成[0,10]区间的整数int n3 = r.nextInt(11);n3 = Math.abs(r.nextInt() % 11);相对于整数区间,[0,10]区间和[0,11)区间等价,所以即生成[0,11)区间的整数。g、生成[-3,15)区间的整数int n4 = r.nextInt(18) - 3;n4 = Math.abs(r.nextInt() % 18) - 3;生成非从0开始区间的随机整数,可以参看上面非从0开始的小数区间实现原理的说明。

January - 2014 K-POP MEGA MASH-UP有哪些歌曲

1. 15& - Sugar2. 2000 Won - I hate Seoul3. 2NE1 - Come Back Home4. 2NE1 - Gotta Be You5. 4minute - Whatcha Doin" Today?6. A Pink - Mr. Chu7. Ailee - I Can Sing Better8. Akdong Musician - 200%9. Alphabat - Tantara10. AOA - Miniskirt11. AOA - Short Hair12. B1A4 - Lonely13. Bangtan Boys - Boy In Luv14. BAP - 100415. BEAST - Good Luck16. BESTie - Thank You Very Much17. Block B - Jackpot18. Bob Girls - No Way19. Boyfriend u2013 Obsession20. BTOB u2013 Beep Beep21. CNBLUE - Can"t Stop22. Crayon Pop - Uh-ee23. Cross Gene - Amazing -Bad Lady-24. Dal shabet - BBB25. EXO u2013 Overdose26. G.NA u2013 Pretty Lingerie27. Ga-in - Fxxk U28. Girl"s Day - Something29. Girls" Generation - Mr. Mr.30. GOT7 - A31. GOT7 - Girls Girls Girls32. GP BASIC - Pika Burnjuck33. HIGH4, IU - Not Spring, Love, or Cherry Blossoms34. HISTORY - Psycho35. Hyomin (T-ARA) - Nice Body36. Infinite - Last Romeo37. Jiyeon (T-ARA) - Never Ever38. JJCC - At First39. Jun Hyosung (SECRET) - Good Night Kiss40. Junggigo - Want You41. K-Much - Good to Go42. Kiss&Cry - Domino Game43. Ladies" Code - So Wonderful44. MBLAQ - Be a Man45. MR. MR. - Big Man46. NS Yoon-G - Yasisi47. Orange Caramel - Catallena48. Rain - 30SEXY49. Rainbow Blaxx - Cha Cha50. Soyu x Junggigo - Some51. SPICA - You Don"t Love Me52. Stellar - Marionette53. Sunmi - Full Moon54. Taeyang - Eyes, Nose, Lips55. TAHITI - Oppa You"re Mine56. TINT - Wolf is Stupid57. TOHEART - Delicious58. TROY - Green Light59. TVXQ - Something60. U-KISS - Don"t Flirt61. VIXX - Eternity62. ZE:A - Breath

java中的random()和random(long seed) 有什么区别?

Random()默认的seed为当前系统时间即:System.currentTimeMillis区别:Random()调用nextXXX()方法产生的随机数,随着每次运行都不同;Random(longseed)不变

java关于Random的用法

在Java的API帮助文档中,Random函数功能的描述:1、java.util.Random类中实现的随机算法是伪随机,也就是有规则的随机,所谓有规则的就是在给定种(seed)的区间内随机生成数字;2、相同种子数的Random对象,相同次数生成的随机数字是完全相同的;3、Random类中各方法生成的随机数字都是均匀分布的,也就是说区间内部的数字生成的几率均等。扩展资料:Java是一门面向对象编程语言,不仅吸收了C++语言的各种优点,还摒弃了C++里难以理解的多继承、指针等概念,因此Java语言具有功能强大和简单易用两个特征。Java语言作为静态面向对象编程语言的代表,极好地实现了面向对象理论,允许程序员以优雅的思维方式进行复杂的编程。Java具有简单性、面向对象、分布式、健壮性、安全性、平台独立与可移植性、多线程、动态性等特点。Java可以编写桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等语言特点:1.简单性:Java看起来设计得很像C++,但是为了使语言小和容易熟悉,设计者们把C++语言中许多可用的特征去掉了,这些特征是一般程序员很少使用的。例如,Java不支持go to语句,代之以提供break和continue语句以及异常处理。Java还剔除了C++的操作符过载(overload)和多继承特征,并且不使用主文件,免去了预处理程序。因为Java没有结构,数组和串都是对象,所以不需要指针。Java能够自动处理对象的引用和间接引用,实现自动的无用单元收集,使用户不必为存储管理问题烦恼,能更多的时间和精力花在研发上。2.面向对象:Java是一个面向对象的语言。对程序员来说,这意味着要注意应中的数据和操纵数据的方法(method),而不是严格地用过程来思考。在一个面向对象的系统中,类(class)是数据和操作数据的方法的集合。数据和方法一起描述对象(object)的状态和行为。每一对象是其状态和行为的封装。类是按一定体系和层次安排的,使得子类可以从超类继承行为。在这个类层次体系中有一个根类,它是具有一般行为的类。Java程序是用类来组织的。Java还包括一个类的扩展集合,分别组成各种程序包(Package),用户可以在自己的程序中使用。例如,Java提供产生图形用户接口部件的类(java.awt包),这里awt是抽象窗口工具集(abstract windowing toolkit)的缩写,处理输入输出的类(java.io包)和支持网络功能的类(java.net包)。3.分布性:Java设计成支持在网络上应用,它是分布式语言。Java既支持各种层次的网络连接,又以Socket类支持可靠的流(stream)网络连接,所以用户可以产生分布式的客户机和服务器。网络变成软件应用的分布运载工具。Java程序只要编写一次,就可到处运行。4.编译和解释性:Java编译程序生成字节码(byte-code),而不是通常的机器码。Java字节码提供对体系结构中性的目标文件格式,代码设计成可有效地传送程序到多个平台。Java程序可以在任何实现了Java解释程序和运行系统(run-time system)的系统上运行。在一个解释性的环境中,程序开发的标准“链接”阶段大大消失了。如果说Java还有一个链接阶段,它只是把新类装进环境的过程,它是增量式的、轻量级的过程。因此,Java支持快速原型和容易试验,它将导致快速程序开发。这是一个与传统的、耗时的“编译、链接和测试”形成鲜明对比的精巧的开发过程。参考资料:百度百科-java

编写一个JAVA计算器程序

你会被鄙视的 又到一年答辩论文时 不会你就拿这东西当论文吧!???

me.name.is.jason,这句英文什么意思

我名叫杰森

JavaScript中blur方法是什么意思?

这是控制元素失去焦点的方法

JavaScript中blur方法是什么意思?

当你按下键盘的键时,如果控件具有焦点,那么键盘动作就会触发这个控件的相应动作;如果没有焦点呢,你再怎么操作,这个控件也不会相应动作。

用JAVA编写一个计算器

不好意思帮不上你了

java程序设计 计算器 求代码

用VC做吧

用JAVA编写一个计算器

http://www.oschina.net/code/snippet_105887_8300

java 计算器代码

import java.awt.*;import java.awt.event.*;import javax.swing.*;public class three extends JFrame implements ActionListener{ private JPanel jPanel1,jPanel2; private JTextField resultField; private JButton s1,s2,s3,s4,s5,s6,s7,s8,s9,s0,b1,b2,b3,b4,f1,f2; private boolean end,add,sub,mul,div; private String str; private double num1,num2;public three(){ super("计算器"); setSize(300,240); Container con=getContentPane(); con.setLayout(new BorderLayout()); jPanel1=new JPanel(); jPanel1.setLayout(new GridLayout(1,1)); jPanel2=new JPanel(); jPanel2.setLayout(new GridLayout(4,4)); resultField=new JTextField("0"); jPanel1.add(resultField); con.add(jPanel1,BorderLayout.NORTH); s1=new JButton(" 1 "); s1.addActionListener(this); s2=new JButton(" 2 "); s2.addActionListener(this); s3=new JButton(" 3 "); s3.addActionListener(this); s4=new JButton(" 4 "); s4.addActionListener(this); s5=new JButton(" 5 "); s5.addActionListener(this); s6=new JButton(" 6 "); s6.addActionListener(this); s7=new JButton(" 7 "); s7.addActionListener(this); s8=new JButton(" 8 "); s8.addActionListener(this); s9=new JButton(" 9 "); s9.addActionListener(this); s0=new JButton(" 0 "); s0.addActionListener(this); b1=new JButton(" + "); b1.addActionListener(this); b2=new JButton(" - "); b2.addActionListener(this); b3=new JButton(" * "); b3.addActionListener(this); b4=new JButton(" / "); b4.addActionListener(this); f1=new JButton(" . "); f1.addActionListener(this); f2=new JButton(" = "); f2.addActionListener(this); jPanel2.add(s1); jPanel2.add(s2); jPanel2.add(s3); jPanel2.add(b1); jPanel2.add(s4); jPanel2.add(s5); jPanel2.add(s6); jPanel2.add(b2); jPanel2.add(s7); jPanel2.add(s8); jPanel2.add(s9); jPanel2.add(b3); jPanel2.add(s0); jPanel2.add(f1); jPanel2.add(f2); jPanel2.add(b4); con.add(jPanel2,BorderLayout.CENTER); }public void num(int i){ String s = null; s=String.valueOf(i); if(end){ //如果数字输入结束,则将文本框置零,重新输入 resultField.setText("0"); end=false; } if((resultField.getText()).equals("0")){ //如果文本框的内容为零,则覆盖文本框的内容 resultField.setText(s); } else{ //如果文本框的内容不为零,则在内容后面添加数字 str = resultField.getText() + s; resultField.setText(str); } }public void actionPerformed(ActionEvent e){ //数字事件 if(e.getSource()==s1) num(1); else if(e.getSource()==s2) num(2); else if(e.getSource()==s3) num(3); else if(e.getSource()==s4) num(4); else if(e.getSource()==s5) num(5); else if(e.getSource()==s6) num(6); else if(e.getSource()==s7) num(7); else if(e.getSource()==s8) num(8); else if(e.getSource()==s9) num(9); else if(e.getSource()==s0) num(0); //符号事件 else if(e.getSource()==b1) sign(1); else if(e.getSource()==b2) sign(2); else if(e.getSource()==b3) sign(3); else if(e.getSource()==b4) sign(4); //等号 else if(e.getSource()==f1){ str=resultField.getText(); if(str.indexOf(".")<=1){ str+="."; resultField.setText(str); } } else if(e.getSource()==f2){ num2=Double.parseDouble(resultField.getText()); if(add){ num1=num1 + num2;} else if(sub){ num1=num1 - num2;} else if(mul){ num1=num1 * num2;} else if(div){ num1=num1 / num2;} resultField.setText(String.valueOf(num1)); end=true; } }public void sign(int s){ if(s==1){ add=true; sub=false; mul=false; div=false; } else if(s==2){ add=false; sub=true; mul=false; div=false; } else if(s==3){ add=false; sub=false; mul=true; div=false; } else if(s==4){ add=false; sub=false; mul=false; div=true; } num1=Double.parseDouble(resultField.getText()); end=true; } public static void main(String[] args){ three th1=new three(); th1.show(); } }

Java入门写一个计算器的程序,要求如图

import javax.swing.*; import javax.swing.border.Border; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.HashMap; /** * 我的计算器。Cheshi 继承于 JFrame,是计算器的界面 c*/ public class Cheshi extends JFrame { private Border border = BorderFactory.createEmptyBorder(5, 5, 5, 5); private JTextField textbox = new JTextField("0"); private CalculatorCore core = new CalculatorCore(); private ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { JButton b = (JButton) e.getSource(); String label = b.getText(); String result = core.process(label); textbox.setText(result); } }; public Cheshi(String title) throws HeadlessException { super(title); // 调用父类构造方法 setupFrame(); // 调整窗体属性 setupControls(); // 创建控件 } private void setupControls() { setupDisplayPanel(); // 创建文本面板 setupButtonsPanel(); // 创建按钮面板 } // 创建按钮面板并添加按钮 private void setupButtonsPanel() { JPanel panel = new JPanel(); panel.setBorder(border); panel.setLayout(new GridLayout(4, 5, 3, 3)); createButtons(panel, new String[]{ "7", "8", "9", "+", "C", "4", "5", "6", "-", "CE", "1", "2", "3", "*", "", // 空字符串表示这个位置没有按钮 "0", ".", "=", "/", "" }); this.add(panel, BorderLayout.CENTER); } /** * 在指定的面板上创建按钮 * * @param panel 要创建按钮的面板 * @param labels 按钮文字 */ private void createButtons(JPanel panel, String[] labels) { for (String label : labels) { // 如果 label 为空,则表示创建一个空面板。否则创建一个按钮。 if (label.equals("")) { panel.add(new JPanel()); } else { JButton b = new JButton(label); b.addActionListener(listener); // 为按钮添加侦听器 panel.add(b); } } } // 设置显示面板,用一个文本框来作为计算器的显示部分。 private void setupDisplayPanel() { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.setBorder(border); setupTextbox(); panel.add(textbox, BorderLayout.CENTER); this.add(panel, BorderLayout.NORTH); } // 调整文本框 private void setupTextbox() { textbox.setHorizontalAlignment(JTextField.RIGHT); // 文本右对齐 textbox.setEditable(false); // 文本框只读 textbox.setBackground(Color.white); // 文本框背景色为白色 } // 调整窗体 private void setupFrame() { this.setDefaultCloseOperation(EXIT_ON_CLOSE); // 当窗体关闭时程序结束 this.setLocation(100, 50); // 设置窗体显示在桌面上的位置 this.setSize(300, 200); // 设置窗体大小 this.setResizable(false); // 窗体大小固定 } // 程序入口 public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); Cheshi frame = new Cheshi("我的计算器"); frame.setVisible(true); // 在桌面上显示窗体 } } /** * 计算器核心逻辑。这个逻辑只能处理 1~2 个数的运算。 */ class CalculatorCore { private String displayText = "0"; // 要显示的文本 boolean reset = true; private BigDecimal number1, number2; private String operator; private HashMap<String, Operator> operators = new HashMap<String, Operator>(); private HashMap<String, Processor> processors = new HashMap<String, Processor>(); CalculatorCore() { setupOperators(); setupProcessors(); } // 为每种命令添加处理方式 private void setupProcessors() { processors.put("[0-9]", new Processor() { public void calculate(String command) { numberClicked(command); } }); processors.put("\.", new Processor() { public void calculate(String command) { dotClicked(); } }); processors.put("=", new Processor() { public void calculate(String command) { equalsClicked(); } }); processors.put("[+\-*/]", new Processor() { public void calculate(String command) { operatorClicked(command); } }); processors.put("C", new Processor() { public void calculate(String command) { clearClicked(); } }); processors.put("CE", new Processor() { public void calculate(String command) { clearErrorClicked(); } }); } // 为每种 operator 添加处理方式 private void setupOperators() { operators.put("+", new Operator() { public BigDecimal process(BigDecimal number1, BigDecimal number2) { return number1.add(number2); } }); operators.put("-", new Operator() { public BigDecimal process(BigDecimal number1, BigDecimal number2) { return number1.subtract(number2); } }); operators.put("*", new Operator() { public BigDecimal process(BigDecimal number1, BigDecimal number2) { return number1.multiply(number2); } }); operators.put("/", new Operator() { public BigDecimal process(BigDecimal number1, BigDecimal number2) { return number1.divide(number2, 30, RoundingMode.HALF_UP); } }); } // 根据命令处理。这里的命令实际上就是按钮文本。 public String process(String command) { for (String pattern : processors.keySet()) { if (command.matches(pattern)) { processors.get(pattern).calculate(command); break; } } return displayText; } // 当按下 CE 时 private void clearErrorClicked() { if (operator == null) { number1 = null; } else { number2 = null; } displayText = "0"; reset = true; } // 当按下 C 时,将计算器置为初始状态。 private void clearClicked() { number1 = null; number2 = null; operator = null; displayText = "0"; reset = true; } // 当按下 = 时 private void equalsClicked() { calculateResult(); number1 = null; number2 = null; operator = null; reset = true; } // 计算结果 private void calculateResult() { number2 = new BigDecimal(displayText); Operator oper = operators.get(operator); if (oper != null) { BigDecimal result = oper.process(number1, number2); displayText = result.toString(); } } // 当按下 +-*/ 时(这里也可以扩展成其他中间操作符) private void operatorClicked(String command) { if (operator != null) { calculateResult(); } number1 = new BigDecimal(displayText); operator = command; reset = true; } // 当按下 . 时 private void dotClicked() { if (displayText.indexOf(".") == -1) { displayText += "."; } else if (reset) { displayText = "0."; } reset = false; } // 当按下 0-9 时 private void numberClicked(String command) { if (reset) { displayText = command; } else { displayText += command; } reset = false; } // 运算符处理接口 interface Operator { BigDecimal process(BigDecimal number1, BigDecimal number2); } // 按钮处理接口 interface Processor { void calculate(String command); } }

java中,谁能告诉我下面中的“\”是表示什么,可不可以去掉,还有“[0-9]”是什么意思?

\表示转义反斜杠,常用在正则表达式。"\."表示转义点号,将.视为正常的标点符号.而不是正则表达式的.(正则表达式.表示任意字符)能不能去掉得看你自己的代码了。

如何将一个应用程序嵌入到java的窗体中

package boom;import javax.swing.*;import javax.swing.border.Border;import java.awt.*;import java.awt.event.ActionListener;import java.awt.event.ActionEvent;import java.math.BigDecimal;import java.math.RoundingMode;import java.util.HashMap;/** * 我的计算器。MyCalculator 继承于 JFrame,是计算器的界面 */public class MyCalculator extends JFrame { private static final long serialVersionUID = 1L; private Border border = BorderFactory.createEmptyBorder(5, 5, 5, 5); private JTextField textbox = new JTextField("0"); private CalculatorCore core = new CalculatorCore(); private ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { JButton b = (JButton) e.getSource(); String label = b.getText(); String result = core.process(label); textbox.setText(result); } }; public MyCalculator(String title) throws HeadlessException { super(title); // 调用父类构造方法 setupFrame(); // 调整窗体属性 setupControls(); // 创建控件 } private void setupControls() { setupDisplayPanel(); // 创建文本面板 setupButtonsPanel(); // 创建按钮面板 } // 创建按钮面板并添加按钮 private void setupButtonsPanel() { JPanel panel = new JPanel(); panel.setBorder(border); panel.setLayout(new GridLayout(4, 5, 3, 3)); createButtons(panel, new String[] { "7", "8", "9", "+", "C", "4", "5", "6", "-", "CE", "1", "2", "3", "*", "", // 空字符串表示这个位置没有按钮 "0", ".", "=", "/", "" }); this.add(panel, BorderLayout.CENTER); } /** * 在指定的面板上创建按钮 * * @param panel * 要创建按钮的面板 * @param labels * 按钮文字 */ private void createButtons(JPanel panel, String[] labels) { for (String label : labels) { // 如果 label 为空,则表示创建一个空面板。否则创建一个按钮。 if (label.equals("")) { panel.add(new JPanel()); } else { JButton b = new JButton(label); b.addActionListener(listener); // 为按钮添加侦听器 panel.add(b); } } } // 设置显示面板,用一个文本框来作为计算器的显示部分。 private void setupDisplayPanel() { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.setBorder(border); setupTextbox(); panel.add(textbox, BorderLayout.CENTER); this.add(panel, BorderLayout.NORTH); } // 调整文本框 private void setupTextbox() { textbox.setHorizontalAlignment(JTextField.RIGHT); // 文本右对齐 textbox.setEditable(false); // 文本框只读 textbox.setBackground(Color.white); // 文本框背景色为白色 } // 调整窗体 private void setupFrame() { this.setDefaultCloseOperation(EXIT_ON_CLOSE); // 当窗体关闭时程序结束 this.setLocation(100, 50); // 设置窗体显示在桌面上的位置 this.setSize(300, 200); // 设置窗体大小 this.setResizable(false); // 窗体大小固定 } // 程序入口 public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); MyCalculator frame = new MyCalculator("我的计算器"); frame.setVisible(true); // 在桌面上显示窗体 }}/** * 计算器核心逻辑。这个逻辑只能处理 1~2 个数的运算。 */class CalculatorCore { private String displayText = "0"; // 要显示的文本 boolean reset = true; private BigDecimal number1, number2; private String operator; private HashMap<String, Operator> operators = new HashMap<String, Operator>();private HashMap<String, Processor> processors = new HashMap<String, Processor>(); CalculatorCore() { setupOperators(); setupProcessors(); } // 为每种命令添加处理方式 private void setupProcessors() { processors.put("[0-9]", new Processor() { public void calculate(String command) { numberClicked(command); } }); processors.put("\.", new Processor() { public void calculate(String command) { dotClicked(); } }); processors.put("=", new Processor() { public void calculate(String command) { equalsClicked(); } }); processors.put("[+\-*/]", new Processor() { public void calculate(String command) { operatorClicked(command); } }); processors.put("C", new Processor() { public void calculate(String command) { clearClicked(); } }); processors.put("CE", new Processor() { public void calculate(String command) { clearErrorClicked(); } }); } // 为每种 operator 添加处理方式 private void setupOperators() { operators.put("+", new Operator() { public BigDecimal process(BigDecimal number1, BigDecimal number2) { return number1.add(number2); } }); operators.put("-", new Operator() { public BigDecimal process(BigDecimal number1, BigDecimal number2) { return number1.subtract(number2); } }); operators.put("*", new Operator() { public BigDecimal process(BigDecimal number1, BigDecimal number2) { return number1.multiply(number2); } }); operators.put("/", new Operator() { public BigDecimal process(BigDecimal number1, BigDecimal number2) { return number1.divide(number2, 30, RoundingMode.HALF_UP); } }); } // 根据命令处理。这里的命令实际上就是按钮文本。 public String process(String command) { for (String pattern : processors.keySet()) { if (command.matches(pattern)) { processors.get(pattern).calculate(command); break; } } return displayText; } // 当按下 CE 时 private void clearErrorClicked() { if (operator == null) { number1 = null; } else { number2 = null; } displayText = "0"; reset = true; } // 当按下 C 时,将计算器置为初始状态。 private void clearClicked() { number1 = null; number2 = null; operator = null; displayText = "0"; reset = true; } // 当按下 = 时 private void equalsClicked() { calculateResult(); number1 = null; number2 = null; operator = null; reset = true; } // 计算结果 private void calculateResult() { number2 = new BigDecimal(displayText); Operator oper = operators.get(operator); if (oper != null) { BigDecimal result = oper.process(number1, number2); displayText = result.toString(); } } // 当按下 +-*/ 时(这里也可以扩展成其他中间操作符) private void operatorClicked(String command) { if (operator != null) { calculateResult(); } number1 = new BigDecimal(displayText); operator = command; reset = true; } // 当按下 . 时 private void dotClicked() { if (displayText.indexOf(".") == -1) { displayText += "."; } else if (reset) { displayText = "0."; } reset = false; } // 当按下 0-9 时 private void numberClicked(String command) { if (reset) { displayText = command; } else { displayText += command; } reset = false; } // 运算符处理接口 interface Operator { BigDecimal process(BigDecimal number1, BigDecimal number2); } // 按钮处理接口 interface Processor { void calculate(String command); }}

JAVA或者C#中如何获取并输出调用堆栈上的变量值

用e.printStackTrace();如果你是说你程序中的用到的堆栈,可以在finally{}块中把堆栈的内容输出来。StackTrace ss = new StackTrace(true);String flName = ss.GetFrame(1).GetFileName();// GetMethod().DeclaringType;int lineNo = ss.GetFrame(1).GetFileLineNumber();String methodName = ss.GetFrame(1).GetMethod().Name;这是 C# 的调用栈上的内容java 中也有一个,StackTraceElement calledSte = getCallStackTraceElement();int lineNo = calledSte.getLineNumber();String className = calledSte.getClassName();String methodName = calledSte.getMethodName();

Java 堆和栈到底要怎么理解

这要从操作系统里进程的内存结构说起了。。。下图是linux 中一个进程的虚拟内存分布:gt;图中0号地址在最下边,越往上内存地址越大。以32位地址操作系统为例,一个进程可拥有的虚拟内存地址范围为0-2^32。分为两部分,一部分留给kernel使用(kernel virtual memory),剩下的是进程本身使用, 即图中的process virtual memory。普通Java 程序使用的就是process virtual memory.上图中最顶端的一部分内存叫做user stack. 这就是题目问的 stack. 中间有个 runtime heap。就是题目中的heap. 他们的名字和数据结构里的stack 和 heap 几乎每啥关系。注意在上图中,stack 是向下生长的; heap是向上生长的。当程序进行函数调用时,每个函数都在stack上有一个 call frame。比如对于以下程序,public void foo(){//do something...println("haha"); // <<<=== 在这儿设置breakpoint 1}public void bar(){foo();}main(){bar();println("hahaha"); // <<<=== 在这儿设置 breakpoint 2}当程序运行到breakponit1时,user stack 里会有三个frame|| main 函数的 frame-------------------|| bar 函数的 frame-------------------<<<=== %ebp|| foo 函数的 frame------------------- <<<===%esp其中 esp 和 ebp 都是寄存器。 esp 指向stack 的顶(因为stack 向下生长,esp会向下走); ebp 指向当前frame的边界。当程序继续执行到brekapoing 2的时候stack 大概是这样的:

求大神 C++ 接口 转成java方法

提供思路:1: 用Java对这些方法重写2: 使用JNI,调用C++代码

Java中在线程中再开线程,可以么

对于进程最直观的感受应该就是“windows任务管理器”中的进程管理:(计算机原理课上的记忆已经快要模糊了,简单理解一下):一个进程就是一个“执行中的程序”,是程序在计算机上的一次运行活动。程序要运行,系统就在内存中为该程序分配一块独立的内存空间,载入程序代码和资源进行执行。程序运行期间该内存空间不能被其他进程直接访问。系统以进程为基本单位进行系统资源的调度和分配。何为线程?线程是进程内一次具体的执行任务。程序的执行具体是通过线程来完成的,所以一个进程中至少有一个线程。回忆一下 HelloWrold 程序中main方法的执行,其实这时候,Java虚拟机会开启一个名为“main”的线程来执行程序代码。一个进程可以包含多个线程,这些线程共享数据空间和资源,但又分别拥有各自的执行堆栈和程序计数器。线程是CPU调度的基本单位。多线程一个进程包含了多个线程,自然就叫做多线程。拥有多个线程就可以让程序看起来可以“同时”处理多个任务,为什么是看起来呢?因为CPU也分身乏术,只能让你这个线程执行一会儿,好了你歇着,再让另一个线程执行一会儿,下次轮到你的时候你再继续执行。这里的“一会儿”实际上时间非常短,感觉上就是多个任务“同时”在执行。CPU就这样不停的切来切去…既然CPU一次也只能执行一个线程,为什么要使用多线程呢?当然是为了充分利用CPU资源。一个线程执行过程中不可能每时每刻都在占用CPU,CPU歇着的时候我们就可以让它切过来执行其他的线程。Java中的多线程Java中启用多线程有两种方式:①继承Thread类;②实现Runnable接口。There are two ways to create a new thread of execution. One is to declare a class to be a subclass of Thread. This subclass should override the run method of class Thread. An instance of the subclass can then be allocated and started.The other way to create a thread is to declare a class that implements the Runnable interface. That class then implements the run method. An instance of the class can then be allocated, passed as an argument when creating Thread, and started. 继承Thread类创建一个类,继承java.lang.Thread,并覆写Thread类的run()方法,该类的实例就可以作为一个线程对象被开启。/*** Dog类,继承了Thread类* @author lt*/class Dog extends Thread {/** 覆写run()方法,定义该线程需要执行的代码*/@Overridepublic void run() {for (int i = 0; i < 10; i++) {System.out.println(i);}}}线程创建好了,怎么让它作为程序的一个独立的线程被执行呢?创建一个该类的实例,并调用start()方法,将开启一个线程,并执行线程类中覆写的run()方法。public class ThreadDemo {public static void main(String[] args) {Dog dog = new Dog();dog.start();}}看不出什么端倪,如果我们直接调用实例的run()方法,执行效果是完全一样的,见上图。public class ThreadDemo {public static void main(String[] args) {Dog dog = new Dog();dog.run();}}如果一切正常,这时候程序中应该有两个线程:一个主线程main,一个新开启的线程。run()方法中的代码究竟是哪个线程执行的呢?Java程序中,一个线程开启会被分配一个线程名:Thread-x,x从0开始。我们可以打印当前线程的线程名,来看看究竟是谁在执行代码。class Dog extends Thread {@Overridepublic void run() {for (int i = 0; i < 10; i++) {System.out.println("当前线程:" + Thread.currentThread().getName() + "---" + i);}}}public class ThreadDemo {public static void main(String[] args) {System.out.println("当前线程:" + Thread.currentThread().getName());Dog dog = new Dog();dog.start();}}可以看到,确实开启了一个新的线程:Thread-0,main()方法的线程名就叫main。同一个实例只能调用一次start()方法开启一次,多次开启,将报java.lang.IllegalThreadStateException异常:我们再创建一个实例,开启第三个线程:public class ThreadDemo {public static void main(String[] args) {System.out.println("当前线程:" + Thread.currentThread().getName());Dog dog = new Dog();Dog dog2 = new Dog();dog.start();dog2.start();}}这时候我们已经能够看到多线程的底层实现原理:CPU切换处理、交替执行的效果了。run和start上面我们直接调用run()方法和调用start()方法的结果一样,现在我们在打印线程名的情况下再来看看:public class ThreadDemo {public static void main(String[] args) {System.out.println("当前线程:" + Thread.currentThread().getName());Dog dog = new Dog();Dog dog2 = new Dog();dog.run();dog2.run();}}可以看到,这时候并没有开启新的线程,main线程直接调用执行了run()方法中的代码。所以start()方法会开启新的线程并在新的线程中执行run()方法中的代码,而run()方法不会开启线程。查看start()的源代码,该方法调用了本地方法 private native void start0();即调用的是操作系统的底层函数:public synchronized void start() {if (threadStatus != 0)throw new IllegalThreadStateException();group.add(this);boolean started = false;try {start0();started = true;} finally {try {if (!started) {group.threadStartFailed(this);}} catch (Throwable ignore) {/* do nothing. If start0 threw a Throwable thenit will be passed up the call stack */}}}private native void start0();实现Runnable接口第二种方式,实现Runnable接口,并覆写接口中的run()方法,这是推荐的也是最常用的方式。Runnable接口定义非常简单,就只有一个抽象的run()方法。//Runnable接口源码public interface Runnable {public abstract void run();}class Dog implements Runnable {@Overridepublic void run() {for (int i = 0; i < 10; i++) {System.out.println("当前线程:" + Thread.currentThread().getName() + "---" + i);}}}这时候的Dog类看起来跟线程什么的毫无关系,也没有了start()方法,怎么样开启一个新的线程呢?直接调用run()方法?想想也不行。这时候我们需要将一个Dog类的实例,作为Thread类的构造函数的参数传入,来创建一个Thread类的实例,并通过该Thread类的实例来调用start()方法从而开启线程。public class ThreadDemo {public static void main(String[] args) {System.out.println("当前线程:" + Thread.currentThread().getName());Dog dog = new Dog();Thread thread = new Thread(dog);thread.start();}}这时候如果要开启第三个线程,需要创建一个新的Thread类的实例,同时传入刚才的Dog类的实例(当然也可以创建一个新的Dog实例)。这时候我们就可以看到跟继承Thread类的方式的区别:多个线程可以共享同一个Dog类的实例。public class ThreadDemo {public static void main(String[] args) {System.out.println("当前线程:" + Thread.currentThread().getName());Dog dog = new Dog();Thread thread = new Thread(dog);Thread thread2 = new Thread(dog);thread.start();thread2.start();}}两种方式的比较继承Thread类的方式有它固有的弊端,因为Java中继承的单一性,继承了Thread类就不能继承其他类了;同时也不符合继承的语义,Dog跟Thread没有直接的父子关系,继承Thread只是为了能拥有一些功能特性。而实现Runnable接口,①避免了单一继承的局限性,②同时更符合面向对象的编程方式,即将线程对象进行单独的封装,③而且实现接口的方式降低了线程对象(Dog)和线程任务(run方法中的代码)的耦合性,④如上面所述,可以使用同一个Dog类的实例来创建并开启多个线程,非常方便的实现资源的共享。实际上Thread类也是实现了Runnable接口。实际开发中多是使用实现Runnable接口的方式。

歌词翻译Breaking Benjamin - The Diary Of Jane

Breaking Benjamin 日记阿珍如果要我把自己的权利旁边,你让 我问你想呢? 你想是什么? 我不介意你这样说,爱是我们最后的时间,所以现在我会问你喜欢 为何? 你喜欢它们吗? 没有! ! 一些议员接触,我有办法的正要休息,我会设法把我的日记 简这么告诉我应该如何尝试找出让你剔正如我说谎 下跌疮病,你呢? 你喜欢它们吗? 只有一线之间的爱与恨,我并不介意让我说我喜欢, 我很喜欢这一点的走去,我有办法的正要休息,我会找我的地方 日记阿珍我烧伤另一页我寻找其他途径,我仍然试图翅 四,我在日记中这样阿珍告诉我应该如何绝望,我钨 爬病患等待这么久,没有爱情, 再没有爱的死对任何人有什么,我变得一天比一天的方式采取一些正要是BRE 对AK ,我会设法把我的日记阿珍我烧伤另一页我思源 钾的其他方式,我还是设法把我的日记阿珍结束

极可意 JACUZZI 在景观里是做什么的?

在思考

Java编程作业,急用

这个简单,

Michael Jackson的"you rock my world"中英文歌词

Mylifewillneverbethesame我的生命将不再如过往"Causegirl,youcameandchanged因为女孩你闯进了我的生活ThewayIwalk改变了我的ThewayItalk一举一动IcannotexplainthethingsIfeelforyou我无法形容我对你的感觉Butgirl,youknowit"strue但是女孩,你知道这是真爱Staywithme,fulfillmydreams请留在我身边,圆满我今生的梦想AndI"llbeallyou"llneed我将是你最完美的情人Oh,oh,oh,oh,ooh,itfeelssoright(Girl)哦,感觉真棒,女孩I"vesearchedfortheperfectloveallmylife这就是我毕尽一生去追寻的完美爱情(AllMylife)Oh,oh,oh,oh,ooh,itfeelslikeI(LikeI)我终于找到了真爱Havefinallyfoundherperfectloveismine(See,Ifinallyfound,comeon,girl)Yourockedmyworld,youknowyoudid你让我的世界天旋地转,全是因为你AndeverythingI"mgonnagive(Yourockedmyworld)我将奉献所有Andthereain"tnothingwecouldfind再也找不到Someonelikeyoutocallmine(Yourockedmyworld)如你般全属于我的爱人Yourockedmyworld,youknowyoudid你让我的世界天旋地转,全是因为你AndeverythingI"mgonnagive(Yourockedmyworld)我将奉献所有Andthereain"tnothingwecouldfind再也找不到Someonelikeyoutocallmine如你般全属于我的爱人IntimeIknewthatlovewouldbring就是此刻Thishappinesstome我知道爱情将带给我快乐Itriedtokeepmysanity我会试着保持冷静Iwaitedpatiently耐心地等待Girl,youknowitseems女孩啊你会明了Mylifeisfullycomplete我的生命因你而完整Ourloveistruebecauseofyou我们的爱情无比真诚You"redoin"whatyoudo这是命运使然

at the end of may 20th to 2015 in january 28th是什么意思

2015年一月二十八日至五月二十日末至

求X-Japan的Art of life的歌词(要有中英文对照)

Desert Rose 沙漠玫瑰 Why do you live alone 为何你独自生存 If you are sad 若你悲哀 I"ll make you leave this life 我将使你离开此生 Are you white, blue or bloody red 你是蓝色、白色、还是如血般的红 All I can see is drowning in cold gray sand 我所能见的全都淹没在冷灰的沙中 The winds of time 时间之风 You knock me to the ground 你将我击倒在地 I"m dying of thirst 我渴而垂死 I wanna run away 我想逃离 I don"t know how to set me free to live 我不知如何让自己自由的生活 My mind cries out feeling pain 我的心因痛苦而呐喊 I"ve been roaming to find myself 我四处徘徊 寻找自我 How long have I been feeling endless hurt 这无尽的痛 我还得忍受多久 Falling down, rain flows into my heart 落雨流入我心中 In the pain I"m waiting for you 在痛苦中我等待你 Can"t go back 无法回去 No place to go back to 无处可归 Life is lost. Flowers fall 生命已逝 花坠落 If it"s all dream 如果这都是梦 Now wake me up 现在就唤醒我 If it"s all real 如果全是真的 Just kill me 就只好杀了我 I"m making the wall inside my heart 我正在自己的心中筑墙 I don"t wanna let my emotions get out 我不要让我的情感泄露 It scares me to look at the world 它恐吓我注视著世界 Don"t want to find myself lost in your eyes 不要让自己在你眼中消失 I tried to drown my past in gray 我试著埋葬我的过去 I never wanna feel more pain 不要再受更多的伤害 Run away from you without saying any words 无言的从你身旁逃开 What I don"t wanna lose is love 我不愿失去的是「爱」 Through my eyes 从我的眼中 Time goes by like tears 时光如泪水般流逝 My emotion"s losing the color of life 我的情感失去生命的色彩 Kill my heart 使我心死 Release all my pain 解除我所有的痛苦 I"m shouting out loud 我高声叫喊 Insanity takes hold over me 疯狂威胁著我 Turning away from the wall 从墙的那一面转过来 Nothing I can see 我什么都看不见 The scream deep inside 深处的呐喊 reflecting another person in my heart 在心中反射出另一个自己 He calls me from within 他从内心深处告诉我 "All existence you see before you must be wipe out: 「你必须消灭你能见的所有存在 Dream, Reality, Memories 梦 真实 记忆 and Yourself." 和你自己」 I begin to lose control of myself 我开始失去自制 My lust is so blind, destroys my mind 我盲目的欲望破坏理智 Nobody can stop my turning to madness 无人能阻止我转向疯狂 No matter how you try to hold me in your heart 无论你如何尝试在你心中抓住我 Why do you wanna raise these walls 为何你要筑高这堵墙 I don"t know the meaning of hatred 我不知憎恨的意义 My brain gets blown away hearing words of lies 我的脑因听见谎言而疲惫 I only want to hold your love 我只想拥有你的爱 Stab the doll filled with hate 戳刺充满憎恨的人偶 Wash yourself with their blood 用它们的血洗你自己 Drive into the raging current of time 在猛烈的时间之流中行进 Swing your murderous weapon into the belly 在贪欲中操纵你杀人的凶器 "the earth" 向著「世界」 Shout and start creating confusion 狂叫且开始困惑 Shed your blood for preasure 你流血为获得快乐 And what? For love? 还有什么?为了爱? What am I suppose to do? 什么是我该做的? I believe in the madness called " Now " 我相信在被称为「现在」的疯狂中 Past and future prison my heart 过去和未来禁锢我的心 Time is blind 时间是盲目的 But I wanna trace my heart 但我要追溯我的爱 On the wall of time, over pain in my heart 在时间之壁上,越过我心中的痛苦 Art of life Art of life Insane blade stabbing dreams 疯狂的刀刃刺穿梦境 Try to break all truth now 试著破坏全部的事实 But I can"t heal this broken heart in pain 但我无法治愈这痛苦而破碎的心 Cannot start to live. Cannot end my life 无法开始生活,无法结束生命 Keep on crying 继续哭泣 Close my eyes 闭上眼睛 Time breath I can hear 我能听见时间的低语 All love and sadness melt in my heart 全部的爱与悲哀在我心中融化 Dry my tears 拭乾泪水 Wipe my broody face 擦拭我满是血污的脸 I wanna feel me living my life outside my wall 我要在我的墙外感受我的存在 You can"t draw a picture of yesterday , so 你无法为昨日描绘影象,以致於 You"re painting your heart with your blood 你用你的血涂抹你的心 You can"t say "No" 你无法说「不」 Only turning the wheel of time 只能用环绕在颈中的绳索 with a rope around your neck 转动时间之轮 You build a wall of morality and take a breath 你建造美德之墙 from between the bricks 在砖缝之间 延残喘 You make up imaginary enemies and are chased by them 你制造假想敌并被他们追捕 You"re trying to commit suicide 你试著自杀 You"re satisfied with your prologue 你对你的序幕感到满意 Now you"re painting your first chapter black 现在你抹黑你的第一章 You are putting the scraps of life together 你把生命的碎片收集在一起 and trying to make an asylum for yourself 并尝试为你自己制造一个避难所 You"re hitting a bell at the edag of the stage 你在舞台边缘敲钟 and 而且 You are trying to kill me 你试著杀我 I believe in the madness called " Now " 我相信在被称为「现在」的疯狂中 Time goes flowing, breaking my heart 时光流逝,破坏我的心 Wanna live 要活著 Can"t let my heart kill myself 不能让我的心毁了我自己 Still I haven"t found what I"m looking for 我仍未找到我要找寻的 Art of life Art of life I try to stop myself 我试著停止我自己 But my heart goes to destroy the truth 但我的心意欲毁灭这事实 Tell me why 告诉我为什么 I want the meaning of my life 我想知道我活著的意义 Do I try to live? Do I try to love 我该试著活下去吗 in my dream 我该试著去实现梦想中的爱吗 I am breaking the wall inside my heart 我破坏我心中的墙 I just wanna let my emotions get out 我想让我的情感流露 Nobody can stop 无人能阻止 I"m running to freedom 我奔向自由 No matter how you try to hold me in your world 无论你多想在你的世界中掌握我 Like a doll carried by the flow of time 像被流逝的时光控制的玩偶 I sacrificed the present moment for the future 我为未来牺牲此刻 I was in chains of memory half-blinded 我被半瞎的记忆束缚 Losing my heart, walking in the sea of dream 失去我的心,徘徊在梦之海里 Close my eyes 闭上眼睛 Rose breathes I can hear 我听见玫瑰的低语 All love and sadness melt in my heart 全部的爱与悲哀在我心中融化 Dry my tears 拭乾泪水 Wipe my bloody face 擦拭我满是血污的脸 I wanna feel me living my life outside my wall 我要在我的墙外感受我的存在 Dreams can make me mad 梦能使我疯狂 I can"t leave my dream 我无法离开梦境 I can"t stop myself 我无法阻止我自己 Don"t know what I am 不知我是什么 What lies are truth 什么是谎言 What truth are lies 什么是真实 Art of life Art of life An Eternal Bleeding heart 一颗永远滴血的心 You never wanna breathe your last 你永远不碰触你的过去 Wanna live 要活著 Can"t let my heart kill myself 不能让我的心毁了我自己 Still I am feeling for 我仍感觉到 A Rose is breathing love 一朵玫瑰正注入爱 in my life 在我生命

VOIE 6 RUE DE HOLLANDE ST JAMES MARIGOT是哪个国家的地址?

ST JAMES是圣詹姆斯(美国纽约州东南部长岛北部城市)MARIGOT是马格里特(大西洋群岛)

用Java编写一个方法 用来计算并输出: 1-1/2+1/3-1/4+1/5-1/6……-1/50

调用时n=50;double s(int n){ int temp=1; dobule sum=0; for(int i=1;i<=n;i++){ sum+=temp*(1/i); temp*=-1; } return sum;}

用JAVA编写的科学计算器源代码

这个你参考一下。import javax.swing.*; //import javax.swing.event.*; import java.awt.*; import java.awt.event.*; //计算器显示结果的窗体 class Result extends JPanel { JTextField text = new JTextField("0"); //text先是输入和结果 Result() { text.setHorizontalAlignment(SwingConstants.RIGHT); //讲输入的数字或得到的结果在text的右边显示 text.setEnabled(false); //文本框不能编辑 setLayout(new BorderLayout()); //设定布局管理器边框布局 add(text, BorderLayout.CENTER); //text放置在窗体的中间 } } //计算器数字按钮定义面板 class Number_Key extends JPanel { JButton zero = new JButton("0");//数字键0 JButton one = new JButton("1");//数字键1 JButton two = new JButton("2");//数字键2 JButton three = new JButton("3");//数字键3 JButton four = new JButton("4");//数字键4 JButton five = new JButton("5");//数字键5 JButton six = new JButton("6");//数字键6 JButton seven = new JButton("7");//数字键7 JButton eight = new JButton("8");//数字键8 JButton nine = new JButton("9");//数字键9 JButton plus = new JButton("+"); JButton sub = new JButton("-"); JButton mul = new JButton("*"); JButton div = new JButton("/"); JButton equal = new JButton("="); JButton ce = new JButton("ce");//置零键 JButton point = new JButton("."); JButton tzero = new JButton("00"); Number_Key() { setLayout(new GridLayout(6, 3, 10, 10));//定义布局管理器为网格布局 //添加各个按钮键 add(seven); add(eight); add(nine); add(four); add(five); add(six); add(one); add(two); add(three); add(zero); add(tzero); add(plus); add(sub); add(mul); add(div); add(point); add(equal); add(ce); } } //计算器主类 class sakura extends JFrame implements ActionListener { Result result = new Result();//定义text的面板 Number_Key number_key = new Number_Key();//定义按钮面板 //当点击按钮+、-、*、/时,com = true boolean com = false; //当i=0时说明是我们第一次输入,字符串sum不会累加 int i = 0; //存放text的内容 String sum = ""; //存放点击按钮+、-、*、/之前的数值 double total = 0; //+、-、*、/的代号分别为1,2,3,4 int symbol = 0; sakura() { super("Calculator");//设定标题 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设定关闭窗体时退出程序 JPanel pane = new JPanel();//定义主面板 pane.setLayout(new BorderLayout()); pane.add(result, BorderLayout.NORTH); pane.add(number_key, BorderLayout.SOUTH); number_key.one.addActionListener(this);//对1按钮添加监听事件 number_key.two.addActionListener(this);//对2按钮添加监听事件 number_key.three.addActionListener(this);//对3按钮添加监听事件 number_key.four.addActionListener(this);//对4按钮添加监听事件 number_key.five.addActionListener(this);//对5按钮添加监听事件 number_key.six.addActionListener(this);//对6按钮添加监听事件 number_key.seven.addActionListener(this);//对7按钮添加监听事件 number_key.eight.addActionListener(this);//对8按钮添加监听事件 number_key.nine.addActionListener(this);//对9按钮添加监听事件 number_key.zero.addActionListener(this);//对0按钮添加监听事件 number_key.ce.addActionListener(this);//对置零按钮添加监听事件 number_key.plus.addActionListener(this);//对+按钮添加监听事件 number_key.equal.addActionListener(this);//对=按钮添加监听事件 number_key.sub.addActionListener(this);//对-按钮添加监听事件 number_key.mul.addActionListener(this);//对*按钮添加监听事件 number_key.div.addActionListener(this);//对/按钮添加监听事件 number_key.tzero.addActionListener(this);//对00按钮添加监听事件 number_key.point.addActionListener(this);//对.按钮添加监听事件 setContentPane(pane); pack();//初始化窗体大小为正好盛放所有按钮 } //各个按钮触发的事件 public void actionPerformed(ActionEvent e) { /*如果是点击数字按钮那么先要判断是否在此之前点击了+、-、*、/、=,如果是那么com=true * 如果没有com= false;或者是否点击数字键,如果是i = 1,如果没有 i = 0; **/ if (e.getSource() == number_key.one) { if (com || i == 0) { result.text.setText("1"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "1"); } } else if (e.getSource() == number_key.two) { if (com || i == 0) { result.text.setText("2"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "2"); } } else if (e.getSource() == number_key.three) { if (com || i == 0) { result.text.setText("3"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "3"); } } else if (e.getSource() == number_key.four) { if (com || i == 0) { result.text.setText("4"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "4"); } } else if (e.getSource() == number_key.five) { if (com || i == 0) { result.text.setText("5"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "5"); } } else if (e.getSource() == number_key.six) { if (com || i == 0) { result.text.setText("6"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "6"); } } else if (e.getSource() == number_key.seven) { if (com || i == 0) { result.text.setText("7"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "7"); } } else if (e.getSource() == number_key.eight) { if (com || i == 0) { result.text.setText("8"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "8"); } } else if (e.getSource() == number_key.nine) { if (com || i == 0) { result.text.setText("9"); com = false; i = 1; } else { sum = result.text.getText(); result.text.setText(sum + "9"); } } /*对于0这个按钮有一定的说法,在我的程序里不会出现如00000这样的情况,我加了判断条件就是 * 如果text中的数值=0就要判断在这个数值中是否有.存在?如果有那么就在原来数值基础之上添 * 加0;否则保持原来的数值不变 */ else if (e.getSource() == number_key.zero) { if (com || i == 0) { result.text.setText("0"); com = false; i = 1; } else { sum = result.text.getText(); if (Float.parseFloat(sum) > 0 || Float.parseFloat(sum) < 0) { result.text.setText(sum + "0"); } else { if (sum.trim().indexOf(".") == -1) { result.text.setText(sum); } else { result.text.setText(sum + "0"); } } } } else if (e.getSource() == number_key.ce) { result.text.setText("0"); i = 0; com = true; } else if (e.getSource() == number_key.tzero) { if (com || i == 0) { result.text.setText("0"); com = false; i = 1; } else { sum = result.text.getText(); if (Float.parseFloat(sum) > 0 || Float.parseFloat(sum) < 0) { result.text.setText(sum + "00"); } else { if (sum.trim().indexOf(".") == -1) { result.text.setText(sum); } else { result.text.setText(sum + "00"); } } } } /*本程序不会让一个数值中出现2个以上的小数点.具体做法是:判断是否已经存在.存在就不添加, * 不存在就添加. */ else if (e.getSource() == number_key.point) { if (com || i == 0) { result.text.setText("0."); com = false; i = 1; } else { sum = result.text.getText(); if (sum.trim().indexOf(".") == -1) { result.text.setText(sum + "."); } else { result.text.setText(sum); } } } //获得点击+之前的数值 else if (e.getSource() == number_key.plus) { com = true; i = 0; total = Double.parseDouble(result.text.getText()); symbol = 1; }//获得点击-之前的数值 else if (e.getSource() == number_key.sub) { com = true; i = 0; total = Double.parseDouble(result.text.getText()); symbol = 2; }//获得点击*之前的数值 else if (e.getSource() == number_key.mul) { com = true; i = 0; total = Double.parseDouble(result.text.getText()); System.out.println(total); symbol = 3; }//获得点击/之前的数值 else if (e.getSource() == number_key.div) { com = true; i = 0; total = Double.parseDouble(result.text.getText()); symbol = 4; } else if (e.getSource() == number_key.equal) { switch (symbol) { case 1 ://计算加法 { double ad = total + Double.parseDouble(result.text.getText()); result.text.setText(ad + ""); i = 0; sum = ""; break; } case 2 ://计算减法 { double ad = total - Double.parseDouble(result.text.getText()); result.text.setText(String.valueOf(ad)); i = 0; sum = ""; break; } case 3 ://计算乘法 { double ad = total * Double.parseDouble(result.text.getText()); result.text.setText(ad + ""); i = 0; sum = ""; break; } case 4 ://计算除法 { double ad = total / Double.parseDouble(result.text.getText()); result.text.setText(ad + ""); i = 0; sum = ""; break; } } System.out.println(com); } } public static void main(String[] args) { sakura ww = new sakura(); ww.setVisible(true) ; } }
 首页 上一页  114 115 116 117 118 119 120 121 122 123 124  下一页  尾页