第一篇:java面向對象程序設計 書中例子
Java面向對象程序設計
<書中例題>
第1章 Java 語言綜述
例1-1 一個加法器 //Add.java public class Add { public static void main(String args[]){
int a,b,c;
a=5;
b=7;
c=a+b;
System.out.println(a+“+”+b+“=”+c);} }
例1-2 能接受命令行參數的應用程序 //WhoSayWhat.java class WhoSayWhat { public static void main(String args[]){
if(args.length<2)
{
System.out.println(“請向應用程序傳遞兩個參數:”);
System.exit(0);//
}
String s1=args[0];
String s2=args[1];
System.out.println(s1+“ Say: ”+s2);} }
例1-3小應用程序舉例 //Test.java import java.applet.Applet;import java.awt.Graphics;//Graphics public class Test extends Applet {
public void paint(Graphics g){
g.drawString(“hello world!”,50,25);} }
第二篇:java面向對象程序設計教案
武漢大學珞珈學院 系/教研室 Java 面 向 對 象 程 序 設 計 課 教 案
主講教師:熊春秀 編寫時間:2011-4-30
第一章:概述
第 1、2 節:面向對象的基本概念、面向對象程序設計概述 授課時間:2011-2-
22、23
計劃學時數:1 教學任務與目的:讓學生理解面向對象的基本概念 教學重點:掌握面向對象的基本概念 教學難點:理解面向對象程序設計的方法 教學方法:多媒體+板書 參考書目:《面向對象程序設計導論》,[美]C.Thomas wu著,電子工業出版社 專業詞匯:Java虛擬機、Applet程序 備注
第二章:Java特點及運行環境
第 1、2、3 節:Java語言特點、Java應用程序及運行環境、Java Applet程序及運行環境 授課時間:2011-2-
22、23
計劃學時數:3 教學任務與目的:讓學生學會JDK的下載、安裝與環境配置。教學重點:掌握編譯和執行Java程序的基本步驟
教學難點:理解Java程序的入口并能夠通過命令行傳遞參數 教學方法:多媒體+板書 參考書目:《面向對象程序設計導論》,[美]C.Thomas wu著,電子工業出版社 專業詞匯:JDK、lib、bin 備注 第三章:Java語言基礎
第 1、2 節:Java程序的構成、數據類型、表達式以及流程控制語句 授課時間:2011-3-
1、2
計劃學時數:3 教學任務與目的:讓學生學會Java基本的數據類型和表示方法、數值類型的運算、邏輯運算和比較、條件執行語句(包括三種條件語句和switch語句)、循環控制語句(包括for、while、do while循環及相應的輔助語句)、字符串類String和BufferString以及數組的聲明及使用。
教學重點:掌握Java基本的數據類型和表示方法
教學難點:理解Java程序的循環控制語句(包括for、while、do while循環及相應的輔助語句)
教學方法:多媒體+板書 參考書目:《Java語言與面向對象程序設計》,印旻編著,清華大學出版社 專業詞匯:變量、數據類型、循環控制語句 備注 第三章:Java語言基礎 第 3 節:Java與C比較
授課時間:2011-3-
8、9
計劃學時數:3 教學任務與目的:讓學生在C語言的基本上進一步學習Java語言。教學重點:掌握Java語言與C語言的區別與聯系。教學難點:理解Java語言在C語言上的改進。教學方法:多媒體+板書 參考書目:《Java2參考大全(第四版)》,[美]Herbert Schildt著,張玉清、吳浦峰、尚勇等譯,清華大學出版社。專業詞匯:Java、C 備注 第四章:抽象、封裝與類
第 1 節:抽象、封裝與Java類的概念
授課時間:2011-3-
15、16
計劃學時數:3 教學任務與目的:讓學生學會面向對象的基本特征、掌握如何定義一個類以及如何生成對象、深入掌握方法的定義及技巧、深入掌握類的訪問權限與封裝機制、深入掌握包的定義與包的使用方法。
教學重點:掌握類的定義與對象的生成。教學難點:理解類的抽象與封裝機制。教學方法:多媒體+板書 參考書目:《Java2 實用教程》,耿祥義、張躍平編著,清華大學出版社。專業詞匯:抽象、封裝、類 備注 第四章:抽象、封裝與類 第 2 節:系統定義的類
授課時間:2011-3-
22、23
計劃學時數:3 教學任務與目的:讓學生學會使用系統定義的類,并掌握與用戶自定義類的區別。教學重點:掌握如何定義所需要的類。
教學難點:熟悉Java平臺定義了哪些經常要用到、而且滿足我們需要的類。教學方法:多媒體+板書 參考書目:《Java2 實用教程》,耿祥義、張躍平編著,清華大學出版社。專業詞匯:系統定義的類、用戶自定義類 備注 第四章:抽象、封裝與類
第 3 節:類、域和方法的修飾符
授課時間:2011-3-
29、30
計劃學時數:3 教學任務與目的:讓學生學會類的聲明。
教學重點:掌握如何定義類的修飾和方法的修飾符。教學難點:熟悉類的變量的定義與使用方法。教學方法:多媒體+板書 參考書目:《Java2 實用教程》,耿祥義、張躍平編著,清華大學出版社。專業詞匯:成員變量、類變量、成員方法、類方法 備注 第五章:繼承與多態
第 1、2 節:Java的繼承與派生、域的繼承與隱藏 授課時間:2011-4-
5、6
計劃學時數:3 教學任務與目的:讓學生全面掌握面向對象的基本特征、掌握如何使用繼承性來到達軟件的重用、深入掌握繼承過程中域的隱藏和方法的覆蓋技巧。教學重點:掌握如何使用繼承性來到達軟件的重用。教學難點:熟悉繼承過程中域的隱藏和方法的覆蓋技巧。教學方法:多媒體+板書 參考書目:《Java2 實用教程》,耿祥義、張躍平編著,清華大學出版社。專業詞匯:繼承派生、域、隱藏 備注 第五章:繼承與多態
第 3、4 節:方法的繼承、重載與覆蓋、this與super、構造函數的繼承與重載 授課時間:2011-4-
12、13
計劃學時數:3 教學任務與目的:讓學生通過繼承可以更有效地組織程序結構,明確類之間的關系,并充分利用已有的類來創建新類,通過繼承可以實現代碼的重用,以完成更復雜的設計、開發。教學重點:掌握類的重載與覆蓋的區別與聯系。教學難點:熟悉類的重載與覆蓋使用方法。教學方法:多媒體+板書 參考書目:《Java語言與面向對象程序設計》,印旻編著,清華大學出版社。專業詞匯:繼承、重載、覆蓋、this、super 備注 第五章:繼承與多態
第 5、6 節:多態性的實現、接口聲明與實現 授課時間:2011-4-
19、20
計劃學時數:3 教學任務與目的:讓學生深入掌握抽象類和抽象方法的定義,掌握多態通過統一多個相關類的對外接口,在運行時根據不同的情況執行不同的操作,提高類的抽象度和靈活性,深入掌握接口的定義和使用技巧。
教學重點:熟悉多態性實現的兩種方式以及接口的實現。教學難點:熟悉多態性與接口的實現方法。教學方法:多媒體+板書 參考書目:《Java語言與面向對象程序設計》,印旻編著,清華大學出版社。專業詞匯:多態性、接口 備注 第六章:工具類與算法
第 1、2 節:語言基礎類庫、Applet類與小程序的基本原理 授課時間:2011-4-
26、27
計劃學時數:3 教學任務與目的:深入了解Applet生命周期的主要方法和特點、熟練掌握Applet程序的編寫方法、深入了解Applet的安全機制及其合理運用。教學重點:熟練掌握Applet程序的編寫方法。
教學難點:深入了解Applet的安全機制及其合理運用。教學方法:多媒體+板書 參考書目:《Java語言與面向對象程序設計》,印旻編著,清華大學出版社。專業詞匯:Applet、生命周期 備注 第六章:工具類與算法
第 3、4 節:數組、字符串、常用算法
授課時間:2011-5-
3、4
計劃學時數:3 教學任務與目的:讓學生學會字符串類String和BufferString、數組的聲明及使用。教學重點:熟練掌握字符串與數組的使用方法。教學難點:深入了解數組的使用方法。教學方法:多媒體+板書 參考書目:《Java語言與面向對象程序設計》,印旻編著,清華大學出版社。專業詞匯:數組、字符串 備注 第七章:用戶圖形界面的設計
第 1、2 節:用戶自定義成分、事件驅動設計 授課時間:2011-5-
10、11
計劃學時數:3 教學任務與目的:讓學生學會使用面向對象的程序設計方法構建圖形用戶界面、深入了解抽象窗口工具包(AWT)、掌握事件處理基本原理和方法。教學重點:熟練掌握圖形用戶界面的開發方法。教學難點:深入了解圖形界面的各種事件。教學方法:多媒體+板書 參考書目:《Java語言與面向對象程序設計》,印旻編著,清華大學出版社。專業詞匯:AWT、GUI 備注 第七章:用戶圖形界面的設計
第 3、4 節:GUI對象,包括:按鈕、文本框、鼠標、鍵盤等事件的處理、布局設計 授課時間:2011-5-
17、18
計劃學時數:3 教學任務與目的:讓學生深入了解GUI構件及掌握布局控制方法、熟練掌握菜單和對話框、掌握簡單繪圖方法。
教學重點:熟練使用Java語言提供的布局管理器來管理組件在容器中的布局。教學難點:深入了解組件在程序中安排中位置和大小使用方法。教學方法:多媒體+板書 參考書目:《Java語言與面向對象程序設計》,印旻編著,清華大學出版社。專業詞匯:布局管理器、容器 備注 第八章:Java高級編程
第 1、2、3節:異常處理、多線程機制、Java程序對網上資源的訪問 授課時間:2011-5-
24、25
計劃學時數:3 教學任務與目的:讓學生深入理解多線程的基本概念、熟練掌握創建線程的兩種基本方法、熟練處理線程的同步問題和死鎖問題、深入理解異常的基本概念、熟悉和掌握Java平臺定義異常類、熟練掌握創建自定義異常類的方法。教學重點:熟練掌握創建線程的兩種基本方法。教學難點:深入了解線程的同步問題和死鎖問題。教學方法:多媒體+板書 參考書目:《Java語言與面向對象程序設計》,印旻編著,清華大學出版社。專業詞匯:同步、死鎖、多線程、異常
第三篇:JAVA面向對象程序設計教學大綱
《JAVA面向對象程序設計》課程教學大綱
Oriented object Programming in JAVA 編號: 08065121
適用專業:計算機科學與技術、網絡工程 學時數:32 學分數:2 執筆者:田小玲 編寫日期:2009年11月
一、課程的性質和目的
本課程是為計算機科學與技術以及網絡工程專業本科生開設的專業選修課,是一門面向對象的編程語言,通過本課程的學習,培養和提高學生面向對象程序設計的能力和Java語言在web開發中的應用能力。
二、課程教學內容
第一章 面向對象軟件開發概述(2學時)1.內容
面向對象問題求解的提出、面向對象問題求解的概述、對象、類與實體、對象的屬性與相互關系、面向對象的軟件開發過程、面向對象程序設計方法的優點、開發環境設置及開發工具簡介。
2.要求
(1)了解:面向對象軟件開發概述,面向對象的軟件開發過程及面向對象程序設計 方法的優點。
(2)掌握:對象的屬性與相互關系,對象、類與實體的基本概念。(3)熟練掌握:開發環境設置及開發工具簡介(補充)。3.重點
對象、類與實體的基本概念。
4.難點
面向對象程序設計方法的理解。第二章 Java概述(2學時)1.內容
Java語言的特點、Java虛擬機及垃圾回收機制、JDK目錄結構、Java 的API結構及Java程序結構、第一個Java Application程序、第一個Java Applet程序、圖形界面的輸入輸出、字符界面的輸入輸出。
2.要求
(1)了解:Java語言的發展歷史及特點,Java Application程序及Java Applet程 序,圖形界面的輸入輸出,字符界面的輸入輸出。
(2)掌握:Java語言實現機制(補充),Java體系結構(補充)。(3)熟練掌握:Java Application程序的結構。3.重點
Java Application程序的結構。
4.難點
Java語言實現機制。
第三章 Java語言基礎(2學時)1.內容
數據類型、變量與常量、表達式、流程控制語句。2.要求
(1)了解:java語言的發展。
(2)掌握:數據類型、變量與常量的定義及使用。(3)熟練掌握:表達式的使用,流程控制語句。3.重點
表達式的使用,流程控制語句。
4.難點
流程控制語句的運用。
第四章 抽象、封裝與類(6學時)
1.內容
抽象與封裝、Java的類、類的修飾符、域、方法、訪問控制符。2.要求
(1)了解:抽象、封裝概念,系統定義的類。
(2)掌握:類的修飾符(abstract和final),域(包括靜態域、靜態初始化器、最終域和易失域),方法(包括抽象方法、靜態方法、最終方法)。
(3)熟練掌握:用戶程序自定義類及創建對象與定義構造函數,訪問控制符(包括public、缺省訪問控制符、private、protected)的運用。
3.重點
自定義類、創建對象與定義構造函數。
4.難點
四種訪問控制符的運用。第五章 繼承與多態(4學時)1.內容
Java的繼承、多態、Java的重載、構造函數的繼承與重載、包及接口的概念。2.要求
(1)了解:繼承及多態的概念,Java接口的概念。(2)掌握:Java的方法重載,包的創建及引用。(3)熟練掌握:構造函數的繼承與重載。
3.重點
方法的重載、類的繼承。4.難點
屬性的隱藏、方法的覆蓋。第六章 工具類與算法(2學時)
1.內容
語言基礎類庫(包括Object類、數據類型類、Math類及System類)、Applet類與Applet小程序、數組。
2.要求
(1)了解:Applet類與Applet小程序。(2)掌握:Java語言基礎類庫。(3)熟練掌握:數組的聲明及初始化。3.重點
數組的聲明及初始化、數組的應用。4.難點
編寫Applet小程序。
第七章 圖形用戶界面的設計與實現(8學時)
1.內容
圖形用戶界面概述、GUI標準組件概述及布局設計、Java的事件處理機制。2.要求
(1)了解:圖形界面組件之間的層次關系、容器的概念和作用。(2)掌握:圖形用戶界面程序的基本結構。(3)熟練掌握:事件監聽機制。3.重點
圖形用戶界面程序的基本結構。4.難點
Java的事件處理機制。
第八章 Java高級編程(6學時)
1.內容
異常處理、Java多線程機制、Swing GUI 組件、流式輸入輸出與文件處理、用Java實現底層網絡通信、Java程序對網上資源的訪問。
2.要求
(1)了解:例外的概念、Java中線程的基本概念、Java的線程類與Runnable接口及如何在程序中實現多線程、Java輸入輸出類庫及文件的處理與隨機訪問、使用Java實現底層網絡通信、Java程序對網上資源的訪問。
3(2)掌握:例外處理機制。
(3)熟練掌握:Swing GUI組件的運用。3.重點
例外處理機制、Swing GUI組件的創建。
4.難點
自定義異常類。
三、課程教學的基本要求
課程教學的基本要求包含三項:上機環節、作業要求、考試方式。1.上機環節
根據課堂講授的理論,并結合上機操作讓學生及時掌握每章節所學的知識,通過實操可加深學生對面向對象程序設計的思想及Java程序設計的領會。
2.作業要求
(1)作業要求:獨立思考完成、書寫工整、按時交(2)作業量:每次課均布置作業,作業量約2~3題(3)總作業量:約30~40道題 3.考試方式
(1)考試方式:閉卷筆試(2)評定成績要求:
總成績=平時成績×30%+考試成績×70%
四、本課程與其它課程的聯系與分工
1.前期課程:
程序設計基礎、計算機網絡、C語言程序設計、C++程序設計 2.后續課程:
軟件工程、Web應用程序開發
五、建議教材與教學參考書
[1] 印旻.《Java語言與面向對象程序設計》,清華大學出版社 [2] 於東軍,楊靜宇.《Java程序設計與應用開發》,清華大學出版社 [3] 辛運幃.《Java程序設計》,清華大學出版社 [4] 姜剛.《Java語言程序設計》,人民郵電出版社 [5] 閻菲.《Java程序設計教程》,中國水利水電出版社
第四篇:Java面向對象程序設計教學大綱
Java面向對象程序設計課程教學大綱
Object-Oriented Programming with Java Syllabus
課程名稱 課程類別 建設單位/教研室 前后課程 適用專業、層次 Java面向對象程序設課程英文名Object-Oriented Programming with Java 計 稱 專業必修課 學分/學時 4.0/42+42 計算機系/軟件工程教研室 考核方式 考試 C語言程序設計
軟件工程、計算機科學與技術、網絡工程
Upon completion of this course, students should master the basic knowledge of Java language, understand and grasp the basic object-oriented programming design ideas and skillfully use Java language to write, compile and debug programs.These would lay a good foundation for students on independently finish the work of program development with Java in the future.教學目的
The emphasis: 1.The origin of Java, Why should we learn Java language, Java cross-platform principle analysis(JVM)and Java Environment variable configuration.2.Data and Expressions: including Character Strings, Variables and Assignment, Primitive Data Types, Expressions, Data Conversion, Interactive Programs.3.Oriented object programming ideas: including Class, Object, Variables, Methods, Encapsulation, Inheritance, Polymorphism, Interface and so on.4.Java statements: including conditionals and loops statements.5.Arrays: Declaring and using one-dimensional arrays and two-dimensional arrays.6.Exceptions: including exception handling, uncaught exceptions, and try-catch statement and so on.7.GUI: including event handling and graphics user interface.The difficulty:
Object-oriented concept and idea, establishing application model and algorithm of description, the algorithm optimization of program and so on.教材和主要參考資料: Text and references Text :
John Lewis “Java程序設計教程(第六版)英文版” 電子工業出版社 ISBN-978-7-121-08808-7 References:
1.《Java編程思想(英文版 第3版)》,(美)Bruce Eckel編,機械工業出版社出版社; 2.Java程序設計基礎》,(美)Gary J.Bronson編, 趙德奎 林仕平譯,北京大學出版社。
3.Cay S.Horstmann, Gary Cornell.Java 2核心技術 卷I:基礎知識.機械工業出版社, 2001.4.Cay S.Horstmann, Gary Cornell.Java 2核心技術 卷II:高級特性.機械工業出版社, 2001.教學內容 學時 基本要求
按章、節具體列出
教學內容 Topic 具體列出教學的基本要求,如了解、理解、掌握及應用等。
By the end of chapter ,students should understand Chapter 1 Introduction
Chapter 2 Data and ExpressionsChapter 3 Using Classes and Objects Chapter 4 Writing Classes 3+3 To be able to have a fundamental understanding of software role in a computer system.? To know components of a computer ? To understand how those components interact ? To grasp how computers store and manipulate information ? To know how computers are connected into networks to share information.? To profile programming and programming languages ? To profile an introduction to Java ? To grasp object-oriented concepts 3+6 Explore some of the basic types of data used in a Java program and the use of expressions to perform calculations.? To understand character strings, concatenation, and escape sequences.? To grasp the declaration and use of variables.? To be familiar with Java primitive data types.? To understand expressions and operator precedence.? To grasp the syntax and processing of expressions.? To understand the types of data conversions and the mechanisms for
accomplishing them.? To know how to create interactive programs.? To understand the basic graphic concepts and the techniques for drawing
shapes.? To know the concept of a Java applet.4+4 Use the predefined classes in the Java class library that are provided to us to make the process of writing programs easier.? To grasp the creation of objects and the use of object reference variables.? To be familiar with the services provided by the String class.? To know how the java standard class library is organized into packages.? To be familiar with the services provided by the Random and Math class.? To grasp ways to format output using the NumberFormat and DecimalFormat
classes.? To be familiar with enumerated types.? To understand wrapper classes and the concept of autoboxing.? To understand components and containers used in graphics user interfaces.? To know a label component and the use of images.6+6 We've been using predefined classes.Now we will learn to write our own classes to define objects.? To grasp the structure and content of a class definition.? To understand the concept of object state using instance data.? To know the effect of visibility modifiers on methods and data.? To grasp the structure of a method definition, including parameters and return
values.? To grasp the structure and purpose of a constructor.? To grasp the creation of graphical objects.? To understand the concepts needed to create an interactive graphical user
interface.Chapter 5 Conditionals and Loops
Chapter 6 OBJECT-ORIENTED DESIGN
Chapter 7 Arrays
Chapter 8 Inheritance ? To know some basic GUI components and events.4+4 Now we will examine programming statements that allow us to make decisions and repeat processing steps in a loop.? To know the flow of control through a method.? To understand Boolean expressions that can be used to make decisions.? To grasp to perform basic decision making using if and switch statements.? To understand issues pertaining to the comparison of certain types of data.? To grasp familiarly to execute statements repetitively using while, do, and for
loops.? To understand the concept of an iterator object and use one to read a text file.? To know how to draw with the aid of conditionals and loops.? To know more GUI components and events.4+4 Now we can extend our discussion of the design of classes and objects ? To know key issues related to the design of object-oriented software.? To techniques for identifying the classes and objects needed in a program.? To understand the relationships among classes.? To understand the effect on the static modifier on methods and data.? To grasp the creation of a formal object interface.? Further grasp the definition of enumerated type classes.? To grasp issues related to the design of methods, including method
overloading.? To know issues related to the design of graphics user interface, including
layout managers.6+3 Arrays are objects that help us organize large amounts of information ? Define and use arrays for basic data organization.? To know bounds checking and techniques for managing capacity.? To learn to compare the issues related to arrays as objects and arrays of
objects.? To grasp the use of command-line arguments.? To grasp the syntax and use of variable-length parameter lists.? To be familiar with the creation and use of multidimensional arrays.? To be familiar with the ArrayList class and its generic parameter.? To know more mouse and keyboard events.6+6 Inheritance is a fundamental object-oriented design technique used to create and organize reusable classes.? To know the derivation of new classes from existing ones.? To understand the concept and purpose of method overriding.? To grasp the design of class hierarchies.? To grasp the issue of visibility as it relates to inheritance.? To have the ability to derive on interface from another.? To grasp object-oriented design in the context of inheritance.? To know the inheritance structure for GUI components.? To explore the creation of listeners by extending adaptor classes.Chapter 9 Polymorphism 3+3 Chapter 10 Exceptions 3+3 有關說明:
擬稿(簽名):謝彥麒 Polymorphism is an object-oriented concept that allows us to create versatile software designs ? To understand polymorphism and explore its benefits.? To understand the concept of dynamic binding.? To grasp to use inheritance relationships to create polymorphic references.? To grasp to use interfaces to create polymorphic references.? To grasp sorting and searching using polymorphic implementations.? To be familiar with object-oriented design in the context of polymorphism.? To know the processing of events as an example of polymorphism.? To know more GUI components.Exception handling is an important aspect of object-oriented design ? To know the purpose of exceptions.? To know exception messages and the call stack trace.?
To be familiar with the usage of the try-catch statement for handling exception.? To understand the concept of exception propagation.?
To be familiar with the exception class hierarchy in the Java standard class library.? To be familiar with I/O exception and the ability to write text files.? To know how to create GUI using mnemonics and tool tips.?
To know additional GUI components and containers.核稿(簽名): 審批(簽名): 年 月 日
第五篇:Java面向對象程序設計課后答案
Java面向對象程序設計課后答案
Java面向對象程序設計 清華大學出版社
(編著 耿祥義 張躍平)習題解答
建議使用文檔結構圖
(選擇Word菜單→視圖→文檔結構圖)習題1 1.James Gosling、、、、2.
(1)使用一個文本編輯器編寫源文件。
(2)使用Java編譯器(javac.exe)編譯Java源程序,得到字節碼文件。(3)使用Java解釋器(java.exe)運行Java程序
3.Java的源文件是由若干個書寫形式互相獨立的類組成的。應用程序中可以沒有public類,若有的話至多可以有一個public類。4.系統環境path Djdkbin;系統環境classpath Djdkjrelibrt.jar;.;5.
B 6. Java源文件的擴展名是.java。Java字節碼的擴展名是.class。
7.D 8.(1)Speak.java(2)生成兩個字節碼文件,這些字節碼文件的名字Speak.class 和 Xiti8.class(3)java Xiti8(4)執行java Speak的錯誤提示
Exception in thread “main” java.lang.NoSuchMethodError: main 執行java xiti8得到的錯誤提示
Exception in thread “main” java.lang.NoClassDefFoundError: xiti8(wrong name: Xiti8)執行java Xiti8.class得到的錯誤提示
Exception in thread “main” java.lang.NoClassDefFoundError: Xiti8/class 執行java Xiti8得到的輸出結果 I'm glad to meet you 9.屬于操作題,解答略。習題2 1.
D 2.【代碼1】
【代碼2】 錯誤
//【代碼3】更正為 float z=6.89F;3.float型常量后面必須要有后綴“f”或“F”。
對于double常量,后面可以有后綴“d”或“D”,但允許省略該后綴。4.public class Xiti4{ public static void main(String args[ ]){ char ch1='你',ch2='我',ch3='他';System.out.println(“”“+ch1+”“的位置:”+(int)ch1);System.out.println(“”“+ch2+”“的位置:”+(int)ch2);System.out.println(“”“+ch3+”“的位置:”+(int)ch3);} } 5.數組名字.length 6.數組名字.length 7. 【代碼1】A,65 【代碼2】-127 【代碼3】
123456.783,123456.78312 8.
【代碼1】false 【代碼2】true 【代碼3】false 【代碼4】3 【代碼5】4.4 【代碼6】8.8習題3 輸出110 if-else語句書寫的不夠規范,復合語句缺少大括號“{}”,代碼不夠清晰。2.你好好酷!3.
public class Xiti3_3 {
public static void main(String args[ ]){ int startPosition=0,endPosition=0;char cStart='а',cEnd='я';startPosition=(int)cStart;//cStart做int型轉換據運算,并將結果賦值給startPosition endPosition=(int)cEnd;
//cEnd做int型轉換運算,并將結果賦值給endPosition
System.out.println(“俄文字母表:”);for(int i=startPosition;i<=endPosition;i++){ char c=' 主站蜘蛛池模板: 日韩av一区二区三区免费看| 亚洲宅男精品一区在线观看| 日韩午夜爽爽人体A片视频| 亚洲国产精品高清在线第1页| 精品欧美乱码久久久久久1区2区| 亚洲成aⅴ人片在线观| 精品一区二区三区东京热| 久久亚洲道色宗和久久| 国产又滑又嫩又白| 精品人妻av区波多野结衣| 狠狠综合久久久久综合网站| 免费无码午夜理论电影| 67194熟妇在线观看线路1| a在线观看免费网站大全| 久久影院午夜理论片无码| 丁香婷婷激情综合俺也去| 无码少妇精品一区二区免费动态| 一区二区传媒有限公司| 巨爆乳中文字幕爆乳区| 人妻熟女一区二区aⅴ林晓雪| 精品综合久久久久久97超人| 国产精品美女久久久久av福利| 亚洲av无码成人精品区狼人影院| 国产极品美女高潮抽搐免费网站| 国产午夜片无码区在线播放| 熟女丝袜潮喷内裤视频网站| 国产精品拍国产拍拍偷| 无码人妻aⅴ一区二区三区日本| 色偷偷av男人的天堂| 亚洲日韩精品欧美一区二区| 成在线人免费视频| 亚洲无线一二三四区手机| 国内露脸中年夫妇交换| 2020精品国产自在现线官网| 熟妇人妻午夜寂寞影院| 国产乱子伦60女人的皮视频| 在线观看国产精品乱码app| 久久这里只精品国产免费10| 业余 自由 性别 成熟视频 视频| 婷婷中文字幕综合在线| 一二三四日本中文在线|