对Scanner input=new Scanner(System.in)的C++理解(手动emoji黑脸)
2016-08-29 00:06
423 查看
Scanner input=new Scanner(System.in); double radius=input.nextDouble();
Scanner是一个类,nextDouble()是Scanner的成员函数,
System.in作为参数传递给Scanner的构造函数,使Scanner用键盘作为输入,
然后用new在内存中实例化一个Scanner出来,使得其它变量能调用这块内存区。
所以radius赋值初始化的过程调用了这块内存里面指向nextDouble成员函数的内存
相关文章推荐
- Scanner scanner=new Scanner(System.in)
- C++箴言:理解 new-handler的行为
- new, newlc and new in C++
- [Java] new BufferedReader(new InputStreamReader(System.in)) 从控制台输入
- Thinking in C++ ----第13, 14, 15章(new和delete操作符的行为、虚函数的特殊情况)
- 深入理解C++的new()
- 理解 《混沌 In C++::是类型?还是函数调用?》
- Creating a Security Descriptor for a New Object in C++
- 深入理解C++的new
- Question 28: Which of the following statements accurately describe the new[] operator in C++?
- 对《End-to-End Arguments in System Design》理解文章的整理
- New Features in Visual c++ 2008
- C++箴言:理解 new-handler的行为
- 流 JAVA IO 基本小结 通过一行常见的代码讨论:new BufferedReader(new InputStreamReader(System.in))
- How to use the System Restore API to save and to restore system data in Visual C++
- What's New in Visual Studio Team System
- New features in Visual C++ 10 and MFC 10
- C++箴言:理解 new-handler的行为
- [Java] new BufferedReader(new InputStreamReader(System.in)) 从控制台输入
- How to convert array<System::Byte> to char* in C++ CLR?