{"id":193,"date":"2023-11-03T16:24:02","date_gmt":"2023-11-03T08:24:02","guid":{"rendered":"http:\/\/8.140.50.131\/?p=193"},"modified":"2023-11-03T16:24:02","modified_gmt":"2023-11-03T08:24:02","slug":"11-02","status":"publish","type":"post","link":"https:\/\/fg2025.cn\/index.php\/2023\/11\/03\/11-02\/","title":{"rendered":"11\/02"},"content":{"rendered":"<h2>\u7a0b\u5e8f\u8bbe\u8ba1\u9898<\/h2>\n<p>\u9700\u6c42:<\/p>\n<p>\u5b9a\u4e49\u4e00\u4e2a\u5b66\u751f\u6ce8\u518c\u4fe1\u606f\u7c7b\uff0c\u8981\u6c42\u6709\u59d3\u540d\u3001\u7535\u8bdd\u3001\u4e13\u4e1a\u548c\u8eab\u4efd\u8bc1\u3002\u5176\u4e2d\u4f60\u53ef\u4ee5\u9009\u62e9\u7528\u59d3\u540d\u548c\u7535\u8bdd\u6216\u59d3\u540d\u8eab\u4efd\u8bc1\u6ce8\u518c\u3002\u7535\u8bdd\u3001\u59d3\u540d\u548c\u8eab\u4efd\u8bc1\u4e3a\u4e0d\u53ef\u4fee\u6539\u5c5e\u6027\uff0c\u4e13\u4e1a\u4e3a\u975e\u5fc5\u8981\u5c5e\u6027\u4e14\u53ef\u4fee\u6539\uff08\u63d0\u793a\uff1a\u63d0\u4f9b2\u4e2a\u6784\u9020\u5668\uff09\uff0c\u5982\u679c\u59d3\u540d\u548c\u7535\u8bdd\u6216\u59d3\u540d\u548c\u8eab\u4efd\u8bc1\u76f8\u7b49\uff0c\u53ef\u8ba4\u4e3a\u662f\u540c\u4e00\u4e2a\u5b66\u751f\uff0c\u6253\u5370\u8f93\u51fa(\u201c\u4fe1\u606f\u5df2\u7ecf\u6ce8\u518c\u6216\u8bf7\u6838\u5bf9\u4fe1\u606f\u201d)\u3002<\/p>\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u5b9a\u4e49\u4e00\u4e2a\u5b66\u751f\u6ce8\u518c\u4fe1\u606f\u7c7b\uff0c\u8981\u6c42\u6709\u59d3\u540d\u3001\u7535\u8bdd\u3001\u4e13\u4e1a\u548c\u8eab\u4efd\u8bc1\u3002\n\/\/\u7535\u8bdd\u3001\u59d3\u540d\u548c\u8eab\u4efd\u8bc1\u4e3a\u4e0d\u53ef\u4fee\u6539\u5c5e\u6027\uff0c\u4e13\u4e1a\u4e3a\u975e\u5fc5\u8981\u5c5e\u6027\u4e14\u53ef\u4fee\u6539,\uff08\u63d0\u793a\uff1a\u63d0\u4f9b2\u4e2a\u6784\u9020\u5668\uff09\uff0c\u5982\u679c\u59d3\u540d\u548c\u7535\u8bdd\u6216\u59d3\u540d\u548c\u8eab\u4efd\u8bc1\u76f8\u7b49\uff0c\u53ef\u8ba4\u4e3a\u662f\u540c\u4e00\u4e2a\u5b66\u751f\uff0c\u6253\u5370\u8f93\u51fa(\u201c\u4fe1\u606f\u5df2\u7ecf\u6ce8\u518c\u6216\u8bf7\u6838\u5bf9\u4fe1\u606f\u201d)\nclass Student_2(val name: String,val tel: String,val idCard:String) {\n  var major=\"\"\n  println(\"enter into Student_2 contruction\")\n  def this(name: String, tel: String, major: String, idCard: String) {\n    this(name, tel, idCard)\n    this.major=major\n  }\n  override def toString = s\"Student_2($name,$tel,$major,$idCard)\"\n  \/\/\u5b9a\u4e49\u68c0\u67e5\u4e24\u4e2a\u5b66\u751f\u662f\u5426\u76f8\u540c\n  def SameStudent(other: Student_2): Boolean = {\n    (this.name == other.name) &amp;&amp; (this.tel == other.tel) || (this.idCard == other.idCard) &amp;&amp; (this.name == other.name)\n    \/\/ || \u4e24\u4e2a\u6761\u4ef6\u4e00\u4e2a\u4e3a\u771f\u5219\u4e3a\u771f \u903b\u8f91\u6216\n  }\n  }\nobject RunStudent{\n  def main(args: Array&#091;String]): Unit = {\n    val r=new Student_2(\"xyz\", \"123456789\",\"it\",\"987654321\")\n    val r2=new Student_2(\"xyz\", \"123456789\",\"it\",\"98764321\")\n    if (r.SameStudent(r2)){\n      println(\"\u4fe1\u606f\u4ee5\u7ecf\u6ce8\u518c\")\n    }\n    else  {\n      println(\"\u4fe1\u606f\u6ce8\u518c\u6210\u529f\")\n    }\n  }\n}\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>\u8fd0\u7b97\u7b26<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>\u63cf\u8ff0<\/strong><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&amp;&amp;<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u903b\u8f91\u4e0e<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">||<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u903b\u8f91\u6216<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">!<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u903b\u8f91\u975e<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\"><div class='alert alert-primary'><span class='alert-inner--text'>Scala \u4e2d\u7684\u903b\u8f91\u8fd0\u7b97\u4e0e Java \u4e2d\u4e00\u6837\uff0c\u4e5f\u662f\u4e0e\u3001\u6216\u3001\u975e\u4e09\u79cd\u60c5\u51b5\uff0c\u5206\u522b\u4ecb\u7ecd\u5982\u4e0b\u3002\u00b7\u4e0e\uff1a\u8fd0\u7b97\u8868\u8fbe\u5f0f\u6709\u4e00\u4e2a\u4e3a\u5047\uff0c\u5219\u6574\u4e2a\u8868\u8fbe\u5f0f\u4e3a\u5047\u3002<br>\u6216\uff1a\u8fd0\u7b97\u8868\u8fbe\u5f0f\u6709\u4e00\u4e2a\u4e3a\u771f\uff0c\u5219\u6574\u4e2a\u8868\u8fbe\u5f0f\u4e3a\u771f\u3002\u975e\uff1a\u5c31\u662f\u53d6\u53cd\u7684\u610f\u601d\uff0c\u4e0e\u53c2\u4e0e\u8868\u8fbe\u5f0f\u76f8\u53cd\u3002<\/span><\/div><\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u7a0b\u5e8f\u8bbe\u8ba1\u9898 \u9700\u6c42: \u5b9a\u4e49\u4e00\u4e2a\u5b66\u751f\u6ce8\u518c\u4fe1\u606f\u7c7b\uff0c\u8981\u6c42\u6709\u59d3\u540d\u3001\u7535\u8bdd\u3001\u4e13\u4e1a\u548c\u8eab\u4efd\u8bc1\u3002\u5176\u4e2d\u4f60\u53ef\u4ee5\u9009\u62e9\u7528\u59d3\u540d\u548c\u7535\u8bdd\u6216\u59d3\u540d\u8eab [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":154,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scala"],"_links":{"self":[{"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":0,"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"wp:attachment":[{"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fg2025.cn\/index.php\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}