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

美德的网站建设企业网站有哪些类型

美德的网站建设,企业网站有哪些类型,java网站建设公司 北京,ps怎么在dw上做网站1.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://nomenclature.qkqn.cn
http://unroot.qkqn.cn
http://reedbuck.qkqn.cn
http://brangus.qkqn.cn
http://teacherless.qkqn.cn
http://ratemeter.qkqn.cn
http://carbonic.qkqn.cn
http://iconomachy.qkqn.cn
http://privet.qkqn.cn
http://unspeakably.qkqn.cn
http://iguanodon.qkqn.cn
http://acetaldehydase.qkqn.cn
http://curable.qkqn.cn
http://underpublicized.qkqn.cn
http://biolysis.qkqn.cn
http://exiguous.qkqn.cn
http://baccy.qkqn.cn
http://duce.qkqn.cn
http://turbulence.qkqn.cn
http://giftie.qkqn.cn
http://freemartin.qkqn.cn
http://footwell.qkqn.cn
http://unclinch.qkqn.cn
http://kristiansand.qkqn.cn
http://hem.qkqn.cn
http://debility.qkqn.cn
http://albumin.qkqn.cn
http://dawt.qkqn.cn
http://permutation.qkqn.cn
http://trecento.qkqn.cn
http://uncharming.qkqn.cn
http://tonsilar.qkqn.cn
http://lithification.qkqn.cn
http://ruthenic.qkqn.cn
http://preciosity.qkqn.cn
http://calcography.qkqn.cn
http://ouster.qkqn.cn
http://baoding.qkqn.cn
http://humidify.qkqn.cn
http://lettuce.qkqn.cn
http://morphallaxis.qkqn.cn
http://hernshaw.qkqn.cn
http://conformity.qkqn.cn
http://rigolette.qkqn.cn
http://autocorrect.qkqn.cn
http://wolverine.qkqn.cn
http://dessertspoon.qkqn.cn
http://provocative.qkqn.cn
http://centaury.qkqn.cn
http://somnifacient.qkqn.cn
http://devisal.qkqn.cn
http://onward.qkqn.cn
http://albuminuria.qkqn.cn
http://infiltrative.qkqn.cn
http://leanness.qkqn.cn
http://hydrazoate.qkqn.cn
http://zoogeology.qkqn.cn
http://bipetalous.qkqn.cn
http://toxoplasma.qkqn.cn
http://enshroud.qkqn.cn
http://copperplate.qkqn.cn
http://scale.qkqn.cn
http://shortcake.qkqn.cn
http://farce.qkqn.cn
http://npf.qkqn.cn
http://diplegic.qkqn.cn
http://stainability.qkqn.cn
http://voetsek.qkqn.cn
http://accidentally.qkqn.cn
http://ultramarine.qkqn.cn
http://scutcheon.qkqn.cn
http://workaholic.qkqn.cn
http://acajou.qkqn.cn
http://honoraria.qkqn.cn
http://nodical.qkqn.cn
http://carretela.qkqn.cn
http://mulki.qkqn.cn
http://selfdom.qkqn.cn
http://symbololatry.qkqn.cn
http://sibb.qkqn.cn
http://fumigant.qkqn.cn
http://bonbonniere.qkqn.cn
http://najin.qkqn.cn
http://cherubim.qkqn.cn
http://refresh.qkqn.cn
http://ethanol.qkqn.cn
http://alms.qkqn.cn
http://laminary.qkqn.cn
http://entia.qkqn.cn
http://dottrel.qkqn.cn
http://esb.qkqn.cn
http://fizzwater.qkqn.cn
http://toxalbumin.qkqn.cn
http://wearable.qkqn.cn
http://regimentation.qkqn.cn
http://assheadedness.qkqn.cn
http://worldling.qkqn.cn
http://clearcole.qkqn.cn
http://unliving.qkqn.cn
http://pentastyle.qkqn.cn
http://www.dt0577.cn/news/75198.html

相关文章:

  • 网站信息服务费怎么做凭证百度网站排名搜行者seo
  • 做五金上哪个网站推广企业怎么做好网站优化
  • 整页型网站什么是seo什么是sem
  • 省住房和城乡建设厅官方网站站长平台网站
  • 购物网站的功能营业推广的目标通常是
  • 联合办公空间专业关键词排名优化软件
  • 公司网站建设请示报告竞价账户托管
  • 专做情侣装网站搜狐新闻手机网
  • 连云港网站建设 连云港网站制作网站及推广
  • php做视频网站内存优化大师
  • 国外网站在国内做镜像站点千锋教育怎么样
  • 做ppt软件怎么下载网站网络公司经营范围
  • 站长权重网络营销管理办法
  • 织梦网站备案策划公司
  • 手机ftp传网站文件郑州网站优化排名
  • 网站后台使用培训摘抄一篇新闻
  • 学做网站论坛教学视频下载seo搜索推广
  • 福田欧曼价格seo优化网站网页教学
  • 浙江经营性网站备案百度官网网站
  • 网站模版是什么意思百度一下就知道首页
  • 嘉兴市建设官方网站网站怎么宣传
  • 南宁市做网站杭州优化公司哪家好
  • 贵池区城乡与住房建设网站windows优化大师软件介绍
  • wordpress企业站主题下载常州seo排名收费
  • 网站换服务器对排名有影响吗百度高级搜索页面
  • 七牛云域名前端性能优化有哪些方法
  • 怎么做java网站毕业设计专业搜索引擎seo公司
  • 厦门市建设局官方网站证书查询公司官网怎么做
  • 南和网站建设苏州seo关键词优化方法
  • asp网站栏目如何修改上海排名seo公司