小编Upu*_*Han的帖子

java中是否有必要存储返回值的方法的值?

假设我有一个方法

public int dummy(){
  return 1;
}
Run Code Online (Sandbox Code Playgroud)

如果我通过调用这个方法

dummy();
Run Code Online (Sandbox Code Playgroud)

不是

int a  = dummy();
Run Code Online (Sandbox Code Playgroud)

会有什么不同吗?为什么?

java

5
推荐指数
1
解决办法
1811
查看次数

警告:无效的 DOM 属性“class”。您的意思是“className”吗?- 反应

我是 ReactJS 的新手。据我了解,仅当我使用“class”而不是“className”时,浏览器才会出现以下错误。但我已经搜索过,我的代码中没有“类”这样的词。这个错误背后的原因是什么。我在这里遗漏了什么吗?

render() {
        return (
            <div style={{marginTop: 10}}>
                <h3>Create New Todo</h3>
                <form onSubmit={this.onSubmit}>
                    <div className="form-group">
                        <label>Description: </label>
                        <input type="text"
                               className="form-control"
                               value={this.state.todo_description}
                               onChange={this.onChangeTodoDescription}
                        />
                    </div>
                    <div className="form-group">
                        <label>Responsible: </label>
                        <input
                            type="text"
                            className="form-control"
                            value={this.state.todo_responsible}
                            onChange={this.onChangeTodoResponsible}
                        />
                    </div>
                    <div className="form-group">
                        <div className="form-check form-check-inline">
                            <input className="form-check-input"
                                   type="radio"
                                   name="priorityOptions"
                                   id="priorityLow"
                                   value="Low"
                                   checked={this.state.todo_priority === 'Low'}
                                   onChange={this.onChangeTodoPriority}
                            />
                            <label className="form-check-label">Low</label>
                        </div>
                        <div className="form-check form-check-inline">
                            <input className="form-check-input"
                                   type="radio"
                                   name="priorityOptions"
                                   id="priorityMedium"
                                   value="Medium"
                                   checked={this.state.todo_priority === 'Medium'}
                                   onChange={this.onChangeTodoPriority}
                            />
                            <label className="form-check-label">Medium</label>
                        </div>
                        <div className="form-check form-check-inline">
                            <input className="form-check-input"
                                   type="radio"
                                   name="priorityOptions" …
Run Code Online (Sandbox Code Playgroud)

reactjs react-native

5
推荐指数
1
解决办法
1万
查看次数

“'/home/upulie/Desktop' 中的 git 存储库有太多活动更改,只会启用 Git 功能的一个子集”

The git repository at '/home/upulie/Desktop' has too many active changes, only a subset of Git features will be enabled

来源:Git(扩展)

当打开一个 React 项目时,这个警告出现在 VS Code 的角落里。我不明白为什么会发生这种情况,因为我的“/home/upulie/Desktop”中没有任何 .git 文件,里面的任何地方都没有。

(我尝试打开的项目位于桌面的文件夹内)

为什么会发生这种情况,我该如何摆脱它?

git visual-studio-code vscode-settings

2
推荐指数
1
解决办法
2191
查看次数