当前位置: 首页 > news >正文

容桂医疗网站建设wordpress固定链接出错

容桂医疗网站建设,wordpress固定链接出错,网站建设北京贵,宝塔ssl wordpress1.static 修饰符应用范围 static修饰符只能用来修饰类中定义的成员变量、成员方法、代码块以及内部类(内部类有专门章节进行讲解)。 2.static 修饰成员变量 static 修饰的成员变量称之为类变量。属于该类所有成员共享。 示例 package cn.lyxq.test04;public class Chinese…1.static 修饰符应用范围 static修饰符只能用来修饰类中定义的成员变量、成员方法、代码块以及内部类(内部类有专门章节进行讲解)。 2.static 修饰成员变量 static 修饰的成员变量称之为类变量。属于该类所有成员共享。 示例 package cn.lyxq.test04;public class ChinesePeople {private String name;private int age;public static String country 中国;public ChinesePeople(String name,int age){this.name name;this.age age;}public String getName() {return name;}public void setName(String name) {this.name name;}public int getAge() {return age;}public void setAge(int age) {this.age age;} } package cn.lyxq.test04;public class ChinesePeopleTest {public static void main(String[] args) {ChinesePeople cp1 new ChinesePeople(张三,20);System.out.println(ChinesePeople.country);ChinesePeople.country日本;ChinesePeople cp2 new ChinesePeople(李四,30);System.out.println(ChinesePeople.country);ChinesePeople cp3 new ChinesePeople(王五,32);System.out.println(ChinesePeople.country);}} 如果类变量是公开的那么可以使用 类名.变量名 直接访问该类变量 3.static 修饰成员方法 static 修饰的成员方法称之为类方法属于该类所有成员共享。 package cn.lyxq.test04;public class ChinesePeople {private String name;private int age;private static String country 中国;public ChinesePeople(String name,int age){this.name name;this.age age;}public String getName() {return name;}public void setName(String name) {this.name name;}public int getAge() {return age;}public void setAge(int age) {this.age age;}//类方法public static String getCountry() {return country;}//类方法public static void setCountry(String country) {ChinesePeople.country country;} } package cn.lyxq.test04;public class ChinesePeopleTest {public static void main(String[] args) {ChinesePeople cp1 new ChinesePeople(张三,20);ChinesePeople.setCountry(日本);ChinesePeople cp2 new ChinesePeople(李四,30);System.out.println(ChinesePeople.getCountry());ChinesePeople cp3 new ChinesePeople(王五,32);System.out.println(cp3.getCountry());//不是最优访问方式}} 如果类方法是公开的那么可以使用 类名.方法名直接访问该类方法。 4.static 修饰代码块 static 修饰的代码块被称为静态代码块在JVM第一次记载该类时执行。因此静态代码代码块只能执行一次通常用于一些系统设置场景。 package cn.lyxq.test04;public class ChinesePeople {private String name;private int age;//使用static修饰的成员变量称为类变量不会随着成员变化而变化属于所有成员共享private static String country ;//static修饰的代码块称为静态代码块在JVM第一次加载该类的时候执行只能执行一次static{country 中国;System.out.println(country属性已经被赋值);}public ChinesePeople(String name,int age){this.name name;this.age age;}public String getName() {return name;}public void setName(String name) {this.name name;}public int getAge() {return age;}public void setAge(int age) {this.age age;}//类方法public static String getCountry() {return country;}//类方法public static void setCountry(String country) {ChinesePeople.country country;} } package cn.lyxq.test04.test;import cn.lyxq.test04.ChinesePeople;public class ChinesePeopleTest {public static void main(String[] args) {ChinesePeople cp new ChinesePeople(张三,20);}} 5.static内存
http://www.w-s-a.com/news/212225/

相关文章:

  • 陵水网站建设友创科技十大优品店排名
  • 想换掉做网站的公司简要说明网站制作的基本步骤
  • 国企公司网站制作wordpress 浮动定位
  • 网站网页直播怎么做的企业网站建设推荐兴田德润
  • 网站建设熊猫建站厦门seo全网营销
  • 扁平网站设计seo是什么岗位的缩写
  • 工商企业网站群晖配置wordpress 80端口
  • 企业网站建设流程步骤镇江东翔网络科技有限公司
  • 网络工程师和做网站哪个难网络建站如何建成
  • 网站建设需要哪些项目游民星空是用什么做的网站
  • 旅游网站建设要如何做百度商城网站建设
  • destoon 网站搬家中国企业500强都有哪些企业
  • 商城网站前端更新商品天天做吗哈尔滨做网站优化
  • 新乡网站开发wordpress 产品分类侧边栏
  • 网站自己做自己的品牌好做互联网企业分类
  • 项目网站建设方案石家庄网站快速排名
  • 网站开发大作业报告做电商网站的参考书
  • Apache局域网网站制作wordpress外链自动保存
  • 网站备案号要怎么查询千锋教育培训机构地址
  • 门户网站建设要求几款免费流程图制作软件
  • 花生壳域名可以做网站域名吗wordpress内链工具
  • 猎头公司网站模板网站伪静态作用
  • 工程建设教育网站html成品网页模板下载
  • 同一ip 网站 权重wordpress 菜单 小图标
  • 网站没有icp备案wordpress d8主题 4.1
  • 手机网站建设推荐企业宣传页模板
  • 杭州市富阳区建设局网站动态域名做网站
  • 网站如何免费做SEO优化靖安县城乡规划建设局网站
  • 室内设计网站平台学新媒体运营最好的培训学校
  • 招聘网站建设工作总结湘潭seo