




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、The “White Paper ” Buzzwords Simple簡潔 Object-Oriented面向?qū)ο蟮?Distributed分布式(對網(wǎng)絡(luò)文件處理) Robust健壯性(可靠性,減少程序錯(cuò)誤) Secure安全性(沙盒) Architecture-neutral結(jié)構(gòu)中立(JVM,WORA) Portable可移植 Interpreted解釋型 High-performance高效性 Multithreaded并發(fā)性 Dynamic動(dòng)態(tài)性JVM Java Virtual MachineJDK Java Development KitJRE Java Runtime Environ
2、mentIDE Integrated Development Environment集成開發(fā)環(huán)境GUI Graphical User InterfaceApplication vs. Appletenum typeenum typeenum Size SMALL, MEDIUM, LARGE, EXTRA_LARGE ;Size s = Size.MEDIUM; stringstringString greeting = Hello; String s = greeting.substring(1, 3);StringBuilder builder = new StringBuilder();
3、builder.append(a); builder.append(“cat”); String completedString = builder.toString();Predefined classPredefined classDate b_day = new Date();System.out.println(b_day);/ get the yearSystem.out.println(b_day.getYear();System.out.println(b_day.getMonth();.factory methodsfactory methodsLocalDate rightN
4、ow = LocalDate.now();LocalDate newYearsEve = LocalDate.of(2017, 9, 25);System.out.println(rightDate.getYear(); System.out.println(rightDate.getMonthValue();System.out.println(rightDate.getDayOfMonth();SpecialSpecialfinal 只生成一次static :A static field is also called a class field, which means that the
5、static field is shared across all its objects.只保存最近賦值,所有對象通用,類似unionstatic final:A static final field is a shared constant across all its objectscommentcommentMulti-line comments:/* like this . */Documentation comments:/* * This is the first sample program in Core Java Chapter 3 * version 1.01 1997-
6、03-22 * author Gary Cornell */LiteralsLiteralshex 0 xCAFEoctal 031Binary 0b1111_0100_0010_0100_0000Double.POSTIVE_INFINITY正無窮大Double.NEGATIVE_INFINITY 負(fù)無窮大Use super to avoid recursive callUse super to avoid recursive callpublic class Manager extends Employee private double bonus;public double getSal
7、ary() return super.getSalary() + bonus; Object: The Cosmic SuperclassObject: The Cosmic SuperclassAny object or array reference can be stored in a variable of type Object:System.out.println(Employee)obj1).getName();Object obj2 = new int10;(int)obj2)0 = 1;System.out.println(int)obj2)0);ArrayListArray
8、ListArrayList eList = new ArrayList();eList.add(LiLei);/ Print the second oneSystem.out.println(eList.get(1);/ Set the second to JerryeList.set(1, Jerry);Special objectsSpecial objectsIntegerDoubleLambdaLambdaArrays.sort(intArr, new Comparator() public int compare(Integer i, Integer j) return j - i;
9、Arrays.sort(stus, (s1,s2) - s2.getName().compareTo(s1.getName();System.out.println(Arrays.toString(stus);ComparatorComparatorArrays.sort(stus, new Comparator() public int compare(Student s1, Student s2) return s2.getName().compareTo(s1.getName(););ScreenSizeScreenSizeDimension screenSize = Toolkit.g
10、etDefaultToolkit().getScreenSize();Resizable()drawdrawDrawLineDrawRectDrawOvalLayoutLayoutFlow LayoutThe default layout of JPanelBorder LayoutThe default layout of JFrameGrid LayoutScrollPaneScrollPaneJScrollPane scrollPane = new JScrollPane(textArea);setbackgroundcolorsetbackgroundcolorbRed.addActi
11、onListener(e) - getContentPane().setBackground(Color.red);bPanel.setBackground(Color.red););ChangefontChangefontActionListener checkbListener = event - int mode = 0; if (bold.isSelected() mode += Font.BOLD; if (italic.isSelected() mode += Font.ITALIC; label.setFont(new Font(Serif, mode, FONTSIZE);Co
12、mbpBoxCombpBoxJComboBox faceCombo = new JComboBox();faceCombo.addItem(Serif);faceCombo.addItem(SansSerif);faceCombo.addItem(Monospaced);faceCombo.addItem(Dialog);faceCombo.addItem(DialogInput);faceCombo.addActionListener(event -label.setFont( new Font(String)faceCombo.getSelectedItem(), Font.PLAIN,
13、24);menubarmenubarsetJMenuBar();toolbartoolbarJToolBar bar = new JToolBar();/ Define a button with a given iconJButton btnRed = new JButton(new ImageIcon(red-ball.gif);/ Specify the actionbtnRed.addActionListener(e - label.setForeground(Color.red);/ Add the button to the barbar.add(btnRed);Message DialogJOptionPane.showMessageDialog(null, Hello the Dialog World!);Confirm Dialog Returns an integer indicating the option selected by the user Yes : 0 No : 1 Cancel : 2 Close : -1int retConfirm = JOptionPane.s
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度企業(yè)年會短視頻拍攝制作合同
- 二零二五年度戶外廣告發(fā)布合作合同
- 二零二五年度草原雇傭放羊與生態(tài)補(bǔ)償協(xié)議
- 二零二五年度資質(zhì)借用及資源共享協(xié)議
- 2025年度施工安全協(xié)議個(gè)人責(zé)任履行細(xì)則
- 二零二五年度房地產(chǎn)項(xiàng)目銷售代理與節(jié)能環(huán)保技術(shù)合作合同
- 二零二五年度休閑度假村包租合作合同
- 二零二五年度醫(yī)療行業(yè)勞動(dòng)合同管理規(guī)范與醫(yī)護(hù)人員保障措施
- 掛靠證件合同模板(2025年度)適用于文化創(chuàng)意產(chǎn)業(yè)
- 二零二五年度電子商務(wù)借款居間服務(wù)合同協(xié)議
- 大學(xué)英語翻譯課件
- 薄膜電容項(xiàng)目立項(xiàng)申請報(bào)告
- 《中醫(yī)望聞問切》課件
- 聲帶腫物的護(hù)理教學(xué)查房
- 2023年高考真題-地理(天津卷) 含答案
- 辦公場所修繕施工方案
- 2025年公務(wù)員考試《行測》模擬題及答案(詳細(xì)解析)
- 2024年黑龍江省牡丹江市中考?xì)v史試卷
- 2024員工質(zhì)量意識培訓(xùn)
- 高速公路日常清掃與養(yǎng)護(hù)方案
- 風(fēng)電epc合同模板
評論
0/150
提交評論