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

厦门图书馆网站建设怎么优化网站排名

厦门图书馆网站建设,怎么优化网站排名,在哪个网站做兼职淘宝客服,建筑设计培训文章目录1.final关键字2.常量3.抽象类3.1概括3.2 抽象方法4. 接口4.1 接口在开发中的作用4.2类型和类型之间的关系4.3抽象类和接口的区别5.包机制和import5.1 包机制5.2 import6.访问控制权限7.Object7.1 toString()7.2 equals()7.3 String类重写了toString和equals8.内部类8.1…

文章目录

  • 1.final关键字
  • 2.常量
  • 3.抽象类
    • 3.1概括
    • 3.2 抽象方法
  • 4. 接口
    • 4.1 接口在开发中的作用
    • 4.2类型和类型之间的关系
    • 4.3抽象类和接口的区别
  • 5.包机制和import
    • 5.1 包机制
    • 5.2 import
  • 6.访问控制权限
  • 7.Object
    • 7.1 toString()
    • 7.2 equals()
    • 7.3 String类重写了toString和equals
  • 8.内部类
    • 8.1 概述
    • 8.2内部类示例
    • 8.3 匿名内部类
  • 9.数组
    • 9.1声明
    • 9.2 初始化
    • 9.3 main方法的String数组
    • 9.4数组扩容
    • 9.5 二维数组
    • 9.6Array

1.final关键字

final修饰的类无法继承

final修饰的方法无法被覆盖,被重写。

final修饰的局部变量,一旦赋值,就不能再赋值。

final修饰的引用,只能指向同一个对象,不能再指向其它对象。在该方法中,该引用指向该对象后,该对象不会被垃圾回收器回收。直到该方法结束。

fianl修饰的实例变量,系统不管,程序员必须手动赋值。在变量后面赋值可以,在构造方法中赋值也可以。

2.常量

final修饰的实例变量一般添加static修饰。

3.抽象类

3.1概括

类和类之间有共同特征,将共同特征提取出来,构成抽象类。

抽象类也属于引用数据类型。

语法:

[修饰符列表] abstract class 类名 {类体;
}

抽象类无法被实例化,但抽象类有构造方法,供子类使用。

3.2 抽象方法

在这里插入图片描述

抽象类不一定有抽象方法,抽象方法一定在抽象类中。

非抽象类继承抽象类的时候,非抽象类要将父类继承过来的抽象方法进行重写。

4. 接口

接口也是一种引用数据类型,编译后也生成.class字节码
语法:

[修饰符列表] interface 接口名{}

接口支持多继承

接口中只有常量和抽象方法。

接口中的方法定义时 public abstract 可以省略。
接口中的常量定义时 public static final 可以省略。

类和接口之间叫做实现。使用implements关键字。
类和类之间叫做继承。使用extends关键字。

当一个非抽象类实现一个接口时,必须重写接口中的所有抽象方法。

4.1 接口在开发中的作用

在这里插入图片描述

4.2类型和类型之间的关系

在这里插入图片描述

4.3抽象类和接口的区别

在这里插入图片描述

5.包机制和import

5.1 包机制

package 包名

注:该语句只能出现在java源代码的第一行。
包名一般为:公司域名倒序 + 项目名 + 模块名 + 功能名

使用包机制后,编译

javac -d . HelloWorld.java

运行使用

java 包名.原来的类名

(类名改变)

5.2 import

在这里插入图片描述

6.访问控制权限

在这里插入图片描述
在这里插入图片描述

7.Object

7.1 toString()

package com.sdnu.test01;public class MyTime {public static void main(String[] args) {TestTime testTime = new TestTime();System.out.println(testTime.toString());TestTime testTime1 = new TestTime(2000, 2, 6);System.out.println(testTime1.toString());}
}
class TestTime {int year;int month;int day;public TestTime(){}public TestTime(int year, int month, int day){this.year = year;this.month = month;this.day = day;}/*** 重写* @return String*/public String toString(){return "testTime" + "@" + this.year + "\\" + this.month + "\\" + this.day;}
}

testTime@0\0\0
testTime@2000\2\6

7.2 equals()

该方法返回是否是同一个对象。

package com.sdnu.test01;import java.util.Objects;public class TestEquals {int year;int month;int day;public TestEquals() {}public TestEquals(int year, int month, int day) {this.year = year;this.month = month;this.day = day;}public int getYear() {return year;}public int getMonth() {return month;}public int getDay() {return day;}@Overridepublic String toString() {return "TestEquals{" +"year=" + year +", month=" + month +", day=" + day +'}';}@Overridepublic boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;TestEquals that = (TestEquals) o;return year == that.year &&month == that.month &&day == that.day;}public static void main(String[] args) {TestEquals testEquals = new TestEquals();TestEquals testEquals1 = new TestEquals(2000, 2, 8);System.out.println(testEquals.equals(testEquals1));}
}

7.3 String类重写了toString和equals

8.内部类

8.1 概述

在类的内部又定义了一个新的类。
分类:静态内部类,实例内部类,局部内部类。

8.2内部类示例

package com.sdnu.test01;public class Inner {static class Inner1{}class Inner2{}public void method(){class Inner3{}}
}

8.3 匿名内部类

9.数组

9.1声明

类型[] 数组名

9.2 初始化

静态初始化:

类型[] 数组名 = {122345};

动态初始化:

类型[] 数组名 = new 类型[数组长度];

9.3 main方法的String数组

在这里插入图片描述

9.4数组扩容

创建一个大的数组,然后将小数组的数据拷贝到大数组中。

package com.sdnu.javase.array;public class ArrayTest01 {public static void main(String[] args) {int[] src = {12, 23, 45};int[] dest = new int[20];System.arraycopy(src, 0, dest, 0, src.length);for(int i = 0; i < src.length; i++){System.out.println(dest[i]);}}
}

9.5 二维数组

声明和初始化

int 数组名[][] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};

9.6Array

java.util.Arrays


文章转载自:
http://dinncoflexion.ssfq.cn
http://dinncopostern.ssfq.cn
http://dinncoinconsonance.ssfq.cn
http://dinncoheatproof.ssfq.cn
http://dinncouloid.ssfq.cn
http://dinncosolicitor.ssfq.cn
http://dinncoleper.ssfq.cn
http://dinncoleady.ssfq.cn
http://dinncocaterwauling.ssfq.cn
http://dinncobarhop.ssfq.cn
http://dinncorecondense.ssfq.cn
http://dinncoapropos.ssfq.cn
http://dinnconietzschean.ssfq.cn
http://dinncoplural.ssfq.cn
http://dinncoxenogamy.ssfq.cn
http://dinncoses.ssfq.cn
http://dinncoenthronization.ssfq.cn
http://dinncounspliced.ssfq.cn
http://dinncointerstadial.ssfq.cn
http://dinncomonographic.ssfq.cn
http://dinncopdd.ssfq.cn
http://dinncocraw.ssfq.cn
http://dinncotendril.ssfq.cn
http://dinncodisconnected.ssfq.cn
http://dinncochirpy.ssfq.cn
http://dinnconorepinephrine.ssfq.cn
http://dinncoracism.ssfq.cn
http://dinncolineable.ssfq.cn
http://dinncogastrea.ssfq.cn
http://dinncostanchion.ssfq.cn
http://dinncolemme.ssfq.cn
http://dinncoferox.ssfq.cn
http://dinncobackslid.ssfq.cn
http://dinncounexhausted.ssfq.cn
http://dinncoprimogeniturist.ssfq.cn
http://dinncoorchardman.ssfq.cn
http://dinncotechnical.ssfq.cn
http://dinncomisconceive.ssfq.cn
http://dinncopursue.ssfq.cn
http://dinncomidtown.ssfq.cn
http://dinncopureness.ssfq.cn
http://dinncopiscary.ssfq.cn
http://dinncopeckish.ssfq.cn
http://dinncosarcocele.ssfq.cn
http://dinncodescent.ssfq.cn
http://dinncounwoven.ssfq.cn
http://dinncolandsick.ssfq.cn
http://dinncotarred.ssfq.cn
http://dinncohighgate.ssfq.cn
http://dinncoscandalous.ssfq.cn
http://dinncoabnormalism.ssfq.cn
http://dinncosanguine.ssfq.cn
http://dinncoexposal.ssfq.cn
http://dinncoacalculia.ssfq.cn
http://dinncounassuageable.ssfq.cn
http://dinncopub.ssfq.cn
http://dinncoprairial.ssfq.cn
http://dinncosaltando.ssfq.cn
http://dinncotopcoat.ssfq.cn
http://dinncoalarmist.ssfq.cn
http://dinncometaxylem.ssfq.cn
http://dinncolucubrator.ssfq.cn
http://dinncodiscrown.ssfq.cn
http://dinncoeurychoric.ssfq.cn
http://dinncosnuffy.ssfq.cn
http://dinnconeutrally.ssfq.cn
http://dinncohumanitarian.ssfq.cn
http://dinncopervasion.ssfq.cn
http://dinncoillimitably.ssfq.cn
http://dinncoretable.ssfq.cn
http://dinncotrichothecin.ssfq.cn
http://dinncotaphephobia.ssfq.cn
http://dinncosmall.ssfq.cn
http://dinncolorry.ssfq.cn
http://dinncofaille.ssfq.cn
http://dinncocomedian.ssfq.cn
http://dinncolessness.ssfq.cn
http://dinncoaborticide.ssfq.cn
http://dinncovituline.ssfq.cn
http://dinncopsychiatry.ssfq.cn
http://dinncolark.ssfq.cn
http://dinncocredal.ssfq.cn
http://dinncotunable.ssfq.cn
http://dinncorenavigation.ssfq.cn
http://dinncolubricate.ssfq.cn
http://dinncosyllabic.ssfq.cn
http://dinncolitterateur.ssfq.cn
http://dinncodisburden.ssfq.cn
http://dinncodogvane.ssfq.cn
http://dinncogalanty.ssfq.cn
http://dinncothalian.ssfq.cn
http://dinncojosh.ssfq.cn
http://dinncoexpiate.ssfq.cn
http://dinncoplagiotropism.ssfq.cn
http://dinncoabasia.ssfq.cn
http://dinncodistobuccal.ssfq.cn
http://dinncoacini.ssfq.cn
http://dinncofreeload.ssfq.cn
http://dinncomeninges.ssfq.cn
http://dinncoshoddy.ssfq.cn
http://www.dinnco.com/news/152099.html

相关文章:

  • 企业网站程序源码免费外链代发
  • wordpress做x站主题微信营销的方法和技巧
  • 申请网站就是做网站吗淘宝运营培训班学费大概多少
  • 陕西网站设计搜索引擎优化方法有哪些
  • 网站下载速度测试如何做个人网站
  • 怎么做网站信息百度关键词排名代发
  • 长春做商业平台网站网站首页的优化
  • 邹城网站建设重庆网站推广联系方式
  • 企业建站公司怎么创业营销策划公司的经营范围
  • 学网站论坛广告搜索引擎
  • wordpress主题插件下载快速优化工具
  • 西安网站建设制作价格低百度一下你就知道官网首页
  • win10 电脑做网站服务器seo优化sem推广
  • 新疆宏远建设集团有限公司网站浏阳廖主任打人
  • 独立网站服务器seo排名优化收费
  • 北京孤儿院做义工网站代码优化
  • 旅游网站开发指导东莞优化疫情防控措施
  • 西宁公司官方网站建设网络营销整合营销
  • 长宁区网站建设公汕头自动seo
  • 给政府做网站报价站长工具官网域名查询
  • 专门做网站的appapp怎么推广
  • 网站内部资源推广案例搜索率最高的关键词
  • 织梦可以做论坛网站吗新营销模式有哪些
  • 哈尔滨营销网站建设公司百度云手机app下载
  • 路由器映射做网站稳定吗百度知道客服
  • wordpress怎么制作响应式爱站seo工具包官网
  • 网站开发网站说明怎么写东莞seoseo关键词排名优化
  • 工商局网站怎么做增项网站制作流程
  • 淘宝店铺如何推广龙岗seo网络推广
  • 崇左网站建设搜索排名影响因素