文件名称:Generic-Method
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2015-07-03
- 文件大小:
- 12kb
- 下载次数:
- 0次
- 提 供 者:
- Mel***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
1。使用一个HashMap来创建可重用的类选择13个预定义的颜色类的颜色。颜色的名称应该用作键,和预定义的颜色对象应该被用作值。把这个类放在一个可以被导入到任何程序的包中。在应用程序中使用您的新类,允许用户选择一个颜色,然后在该颜色中绘制一个形状。
2、(计数重复的话)编写一个程序,该程序确定和打印语句中的重复单词的数量。把大写字母和小写字母一样。忽略标点符号。
3。(一个TreeSet排序的话)写一个程序,使用一个字符串的方法分割标记线的用户输入的文本和地方在这每个令牌。打印的有序元素。[注:这将导致按递增顺序排列的元素。]
4。(通用isequalto法)写的一个简单的通用版本的方法isequalto比较两个实参与equals方法返回true如果他们是平等的,否则为假。在一个程序中,调用isequalto各种内置类型使用此genericmethod,如对象或整数。当你尝试运行这个程序时,你会得到什么结果?
5。(泛型类对)写的一个通用类副的两型parameters-f和s-each代表对第一和第二单元类型,分别。添加和设置对的第一和第二元素的方法。提示:类标题应该是公共类对-1. Use a HashMap to create a reusable class for choosing one of the 13 predefined colors in class Color. The names of the colors should be used as keys, and the predefined Color objects should be used as values. Place this class in a package that can be imported into any Java program. Use your new class in an application that allows the user to a color and draw a shape in that color.
2. (Counting Duplicate Words) Write a program that determines and prints the number of duplicate words in a sentence. Treat uppercase and lowercase letters the same. Ignore punctuation.
3. (Sorting Words with a TreeSet) Write a program that uses a String method split to tokenize a line of text input by the user and places each token in a TreeSet. Print the elements of the TreeSet. [Note: This should cause the elements to be printed in ascending sorted order.]
4. (Generic isEqualTo Method) Write a simple generic version of method isEqualTo that compares its two arguments with the equals method and retur
2、(计数重复的话)编写一个程序,该程序确定和打印语句中的重复单词的数量。把大写字母和小写字母一样。忽略标点符号。
3。(一个TreeSet排序的话)写一个程序,使用一个字符串的方法分割标记线的用户输入的文本和地方在这每个令牌。打印的有序元素。[注:这将导致按递增顺序排列的元素。]
4。(通用isequalto法)写的一个简单的通用版本的方法isequalto比较两个实参与equals方法返回true如果他们是平等的,否则为假。在一个程序中,调用isequalto各种内置类型使用此genericmethod,如对象或整数。当你尝试运行这个程序时,你会得到什么结果?
5。(泛型类对)写的一个通用类副的两型parameters-f和s-each代表对第一和第二单元类型,分别。添加和设置对的第一和第二元素的方法。提示:类标题应该是公共类对-1. Use a HashMap to create a reusable class for choosing one of the 13 predefined colors in class Color. The names of the colors should be used as keys, and the predefined Color objects should be used as values. Place this class in a package that can be imported into any Java program. Use your new class in an application that allows the user to a color and draw a shape in that color.
2. (Counting Duplicate Words) Write a program that determines and prints the number of duplicate words in a sentence. Treat uppercase and lowercase letters the same. Ignore punctuation.
3. (Sorting Words with a TreeSet) Write a program that uses a String method split to tokenize a line of text input by the user and places each token in a TreeSet. Print the elements of the TreeSet. [Note: This should cause the elements to be printed in ascending sorted order.]
4. (Generic isEqualTo Method) Write a simple generic version of method isEqualTo that compares its two arguments with the equals method and retur
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lab11\.classpath
.....\.project
.....\.settings\org.eclipse.jdt.core.prefs
.....\bin\exercise1\Draw.class
.....\...\.........\HashMap_Color.class
.....\...\........2\CountWords.class
.....\...\........3\SortWords.class
.....\...\........4\GenericIsEaqual.class
.....\...\........5\Pair.class
.....\...\.........\Program.class
.....\src\exercise1\Draw.java
.....\...\.........\HashMap_Color.java
.....\...\........2\CountWords.java
.....\...\........3\SortWords.java
.....\...\........4\GenericIsEaqual.java
.....\...\........5\Pair.java
.....\...\.........\Program.java
.....\bin\exercise1
.....\...\exercise2
.....\...\exercise3
.....\...\exercise4
.....\...\exercise5
.....\src\exercise1
.....\...\exercise2
.....\...\exercise3
.....\...\exercise4
.....\...\exercise5
.....\.settings
.....\bin
.....\src
lab11