在底部回答.
我试图status在git_test2目录中看到我的文件,其中包含3个名为的文件test1.txt,test2.txt和test3.txt.
这是我输入终端的内容:
cd Desktop
cd git_test2
git status
Run Code Online (Sandbox Code Playgroud)
在git status命令之前一切都很好.它应该只显示3个未跟踪的文件,但我从终端获取此文本:
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: ../../AndroidStudioProjects/Sunshine/app/src/main/res/layout/list_item_forecast.xml
new file: ../../Library/Preferences/AndroidStudio1.2/options/fileEditorProviderManager.xml
new file: ../../Library/Preferences/AndroidStudio1.2/options/git.xml
new file: ../../Library/Preferences/AndroidStudio1.2/options/other.xml
new file: ../../Library/Preferences/AndroidStudio1.2/options/runner.layout.xml
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory) …Run Code Online (Sandbox Code Playgroud) 我看到有人创建了一个具有未知数量参数的函数:
public static double calculator(double ... value){
double result=0d;
for(int i=0;i<?;i++){
result+=value;
}
return result
}
Run Code Online (Sandbox Code Playgroud)
现在我正在尝试创建一个for循环,该循环将以输入的参数数量运行次数,因此:
double calc = calculator(1,2,3,4,5)
Run Code Online (Sandbox Code Playgroud)
这将使for循环运行5次.