Think in java 答案_Chapter 2_Exercise 5
来源:互联网 发布:表情包 面具 淘宝 编辑:程序博客网 时间:2024/04/28 03:25
阅前声明: http://blog.csdn.net/heimaoxiaozi/archive/2007/01/19/1487884.aspx
/****************** Exercise 5 ******************
* Write a program that includes and calls the
* storage() method defined as a code fragment in
* this chapter.
***********************************************/
public class E05_Storage {
String s = "Hello, World!";
int storage(String s) {
return s.length() * 2;
}
void print() {
System.out.println(
"storage(s) = " + storage(s));
}
public static void main(String[] args) {
E05_Storage st = new E05_Storage();
st.print();
}
}
/** You could have also made storage( ) a static method and just called it from main( ).*/
//+M java E05_Storage
- Think in java 答案_Chapter 2_Exercise 5
- Think in java 答案_Chapter 5_Exercise 2
- Think in java 答案_Chapter 5_Exercise 5
- Think in java &答案_Chapter 2_Exercise 2
- Think in java 答案_Chapter 3_Exercise 5
- Think in java 答案_Chapter 4_Exercise 5
- Think in java 答案_Chapter 5_Exercise 1
- Think in java 答案_Chapter 5_Exercise 3
- Think in java 答案_Chapter 5_Exercise 4
- Think in java 答案_Chapter 5_Exercise 6
- Think in java 答案_Chapter 5_Exercise 7
- Think in java 答案_Chapter 5_Exercise 8
- Think in java 答案_Chapter 5_Exercise 9
- Think in java 答案_Chapter 5_Exercise 10
- Think in java 答案_Chapter 5_Exercise 11
- Think in java 答案_Chapter 5_Exercise 12
- Think in java &答案_Chapter 2_Exercise 1
- Think in java chapter's答案_Chapter 2_Exercise 3
- Think in java &答案_Chapter 2_Exercise 2
- Think in java chapter's答案_Chapter 2_Exercise 3
- 静态成员本质
- Think in java 答案_Chapter 2_Exercise 4
- 从CSDN开始学.net! 2007-1-19
- Think in java 答案_Chapter 2_Exercise 5
- 需要这样的框架吗?
- 事件和委托学习
- 本人Blog阅前必读(郑重声明)
- map模板类用法整理
- Java & .net struct
- Think in java 答案_Chapter 2_Exercise 6
- (剪切)关于使用DataSet更新数据库
- 追MM与设计模式的有趣见解