Skip to content

数字相加#232

Open
haileeliang wants to merge 1 commit intohcsp:masterfrom
haileeliang:master
Open

数字相加#232
haileeliang wants to merge 1 commit intohcsp:masterfrom
haileeliang:master

Conversation

@haileeliang
Copy link
Copy Markdown

完成 原生数据类型与装箱类型训练 第二题

@hcsp-bot
Copy link
Copy Markdown
Contributor

🎉 感谢提交Pull Request!请稍等片刻,我们已经将其提交到CI进行检查,一旦有结果会立即通知您!

// 注意,若参数为null,则当作0处理,即add("123", null)=="123", add(null, null)=="0"
public static String add(String a, String b) {}
public static String add(String a, String b) {
if ( a == null ){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'(' 后不应有空格。
')' 前不应有空格。
'{' 前应有空格。

public static String add(String a, String b) {}
public static String add(String a, String b) {
if ( a == null ){
a = "0";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应对方法参数'a'赋值。

if ( a == null ){
a = "0";
}
if ( b == null){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'(' 后不应有空格。
'{' 前应有空格。

a = "0";
}
if ( b == null){
b = "0";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应对方法参数'b'赋值。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants