下面一个javabean程序,有两句不知道是什么意思,有什么作用?(倒数第5,6行)

Jack_dun Jack_dun 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

package red.star;
public class ScoreList
{ String studentName,courseName="",score="";
StringBuffer scoreWatch=new StringBuffer();
public void setScore(String n)
{ score=n;
}
public void setStudentName(String s)
{ studentName=s;
}
public void setCourseName(String s)
{ courseName=s;
}
public String getCourseName()
{ return courseName;
}
public StringBuffer getScoreWatch()
{ if(studentName!=null&&studentName.length()>0&&score.length()>0)
{ scoreWatch.append("<tr>");
scoreWatch.append("<td width=150 Align=Center>");
scoreWatch.append(studentName);
scoreWatch.append("</td>");
scoreWatch.append("<td width=60 Align=Center>");
scoreWatch.append(""+score);
scoreWatch.append("</td>");
scoreWatch.append("</tr>");
studentName=""; \\这句
score=""; \\上一句和这一句是什么意思,作用是什么?
}
return scoreWatch;
}
}

...全文
评论 3
收藏 已收藏
分享
返回顶部
Jack_dun
Web 开发 81,108 成员 341,721 内容