javaJava快速入门练习.pdf

  1. 1、本文档共29页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
4 – 4.1 (1) (2) (3) (4) (5) JAVA 4.2 JAVA class object method 4 D - , ; I - , , ; W - P - JAVA 4.3 Lab04 , C: Lab04 Lab04 http://javaLab/lab04.zip 4.4 .4.1: (D) 4.4.1: (D) JAVA JAVA JAVA (class) (method) main applet paint JAVA JOptionPane showMessageDialog showInputDialog JOptionPane.showMessageDialog(null, "Hi there!"); String name = JoptionPane.showInputDialog("What's your name?"); JOptionPane import 1. 1 import javax.swing.JOptionPane; import JAVA javax.swing JOptionPane Integer parseInt String int Interger import java.lang Integer Java Java Java Java Object Class 2. 4-1Student.java //Student.java public class Student { private int id; // ID private String name; // public Student(int id, String name){ this.id = id; = name; } public int getID() { return id; } public void setID(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { = name; } } Student 2 4 1 Student instance 3. JAVA JAVA Primitive Data TypeReference Data Type Student s1, s2; // s1 = new Student // Student 0xabcdef s1 s2 = s1 // s1 s2 2 4.1 : 4.1 s1 s2 s1 s2 method Java constructor instance method static method (1) constructor Student Student s = new Student(123, "he xiang"); new s new Student s (2) instance method .() objectReference.methodName(parameters) Student s getID s.getID(); (3) static method JOptionPane showMessageDialog showInputDialog Integer parseInt .() ClassName.methodName(parameters) static method static 4. 3 (D) 4.4.2: (D) Applet paint public void pain

文档评论(0)

183****8595 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档