随笔分类 -  Java / this

摘要:package com.thisDemo; public class Student { double score; public void prinThis(){ System.out.println(this); } public void printPass(double score){ if 阅读全文
posted @ 2023-05-28 11:52 Karlshell 阅读(6) 评论(0) 推荐(0) 编辑
摘要:package com.thisDemo; //掌握this应用 //this有啥应用场景:主要用来解决变量名称冲突问题 public class thisDemo { public static void main(String[] args) { Student s1=new Student() 阅读全文
posted @ 2023-05-28 11:51 Karlshell 阅读(7) 评论(0) 推荐(0) 编辑
摘要:package com.encapsulation; public class Student { private double score; public void setSore(double score){ if (score>=0 && score<=100){ this.score=sco 阅读全文
posted @ 2023-05-28 11:33 Karlshell 阅读(7) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示