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

佛山信息技术网站开发市场推广方式有哪几种

佛山信息技术网站开发,市场推广方式有哪几种,帮别人设计网站,公司做网站 优帮云接口 1. 概念 在软件工程中#xff0c;软件与软件的交互很重要#xff0c;这就需要一个约定。每个程序员都应该能够编写实现这样的约定。接口就是对约定的描述。 In the Java programming language, an interface is a reference type, similar to a class, that can con… 接口 1. 概念 在软件工程中软件与软件的交互很重要这就需要一个约定。每个程序员都应该能够编写实现这样的约定。接口就是对约定的描述。 In the Java programming language, an interface is a reference type, similar to a class, that can contain only constants, method signatures, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods. Interfaces cannot be instantiated—they can only be implemented by classes or extended by other interfaces 在 Java 编程语言中接口是类似于类的引用类型它只能包含常量方法签名默认方法静态方法和嵌套类型。 方法主体仅适用于默认方法和静态方法。 接口无法实例化- 它们只能由类实现或由其他接口扩展。 An interface declaration can contain method signatures, default methods, static methods and constant definitions. The only methods that have implementations are default and static methods. 接口声明可以包含方法签名默认方法静态方法和常量定义。 具有实现的方法是默认方法和静态方法。 从上面的描述中可以得出 接口中没有构造方法。 2. 接口定义 语法 [ public ] interface 接口名 {                 [ public static final ] 数据类型 变量名 变量的值 ; // 接口中定义变量该变量是静态常量在定义的时候必须赋值                                  返回值类型 方法名 ([ 参数列表 ]); // 定义接口方法                 default 返回值类型 方法名 ([ 参数列表 ]){ // 接口中定义的默认方法必须在 JDK8 及以上版本使用                         [ return 返回值 ;]                 }                 static 返回值类型 方法名 ([ 参数列表 ]){ // 接口中定义的静态方法必须在 JDK8 及以上版本使用                         [ return 返回值 ;]                 }                 private 返回值类型 方法名 ([ 参数列表 ]){ // 接口中定义的私有方法必须在 JDK9 及以上版本使用                         [ return 返回值 ;]                 } } package com . we . interfaceclass ; interface Test {         public static final int number 10 ;         public abstract void show ();         public default int plus ( int a , int b ){                 return a b ;         }         public static int multiply ( int a , int b ){                 return a * b ;         }         private String getName (){                 return admin ;         } } 示例 使用接口描述人有名字 package com . we . interfaceclass . person ; public interface Person {         String getName (); // 获取人的姓名 } 使用接口描述演员能表演 package com . we . interfaceclass . person ; public interface Actor {         void performance (); // 演员表演 } 3. 接口继承 语法 [ public ] interface 接口名 extends 接口名 1 , 接口名 2 ,... 接口名 n { } 示例 使用接口继承描述演员是人 package com . we . interfaceclass . person ; public interface Actor extends Person {         void performance (); // 演员表演 } 使用接口继承描述歌手是人 package com . we . interfaceclass . person ; public interface Singer extends Person {         void sing (); // 唱歌 } 使用接口继承描述艺人既是演员也是歌手 package com . we . interfaceclass . person ; public interface Artist extends Actor , Singer {         void endorsement (); // 代言 } 注意 接口可以多继承这是Java 中唯一可以使用多继承的地方。接口包含的变量都是静态常量接 口中包含的方法签名都是公开的抽象方法接口中的默认方法和静态方法在 JDK8 及以上版本才能定 义接口的私有方法必须在 JDK9 及以上版本才能定义。接口编译完成后也会生成相应的 class 文件。 4. 接口实现 实现接口语法 访问修饰符 class 类名 implements 接口名 1 , 接口名 2 ,... 接口名 n { } A class that implements an interface must implement all the methods declared in the interface. 实现接口的类必须实现接口中声明的所有方法。         一个类如果实现了一个接口那么就必须实现这个接口中定义的所有抽象方法包括接口通过继承关系继承过来的抽象方法这个类被称为接口的实现类或者说子类。与继承关系一样实现类与接口之间 的关系是 is-a 的关系。 示例 使用实现接口的方式描述娱乐明星是艺人 package com . we . interfaceclass . person ; public class EntertainmentStar implements Artist {         private String name ;         public EntertainmentStar ( String name ) {                 this . name name ;         }         Override         public void endorsement () {                 System . out . printf ( 娱乐明星 %s 代言 \n , getName ());         }         Override         public void performance () {                 System . out . printf ( 娱乐明星 %s 表演 \n , getName ());         }         Override         public void sing () {                 System . out . printf ( 娱乐明星 %s 唱歌 \n , getName ());         }         Override         public String getName () {                 return name ;         } } package com . we . interfaceclass . person ; public class PersonTest {         public static void main ( String [] args ) {                 Person p new EntertainmentStar ( 刘德华 ); // 娱乐明星是人                 System . out . println ( p . getName ());                 Actor a new EntertainmentStar ( 范冰冰 ); // 娱乐明星是演员                 a . performance ();                 Singer s new EntertainmentStar ( 张学友 ); // 娱乐明星是歌手                 s . sing ();                 Artist artist new EntertainmentStar ( 古天乐 ); // 娱乐明星是艺人                 artist . endorsement ();                 artist . performance ();                 artist . sing ();         } } 5. 接口应用场景         一般来说定义规则、定义约定时使用接口。 示例         计算机对外暴露有 USB 接口 USB 接口生产商只需要按照接口的约定生产相应的设备 ( 比如 USB 键盘、USB 鼠标、优盘 ) 即可。 Java SE文章参考:Java SE入门及基础知识合集-CSDN博客
http://www.hkea.cn/news/14437101/

相关文章:

  • 网站建网站建设网站站网站惠阳有做公司网站的吗
  • 网站seo和sem是什么意思临沂h5建站
  • 最新流行网站开发技术重庆品牌网站建设公司
  • 如何建设网站pdf下载wordpress论坛主题模板
  • 关于网站建设的调查问卷网站群建设工作培训会
  • 网站后台软件可以自己做吗怎么做 在线电影网站
  • 微网站欣赏曲阜网站设计
  • 网站毕设离型剂技术支持东莞网站建设
  • 淘宝客网站怎样做seo商城网站开发价格
  • 新乐市建设银行网站湖南长沙最新情况
  • 网站建设常用单词医疗器械监督管理条例2021
  • 交互式英语网站的构建自己的网站怎么做团购
  • 哈尔滨模板建站源码网站建设好后能直接打开吗
  • 南京外贸网站建设系统如何优化推广中的关键词
  • 建个网站视频网站建设套餐服务
  • saas是不是做网站网站域名注册备案教程
  • 高端网站开发多少钱外贸网站和企业网站
  • 简历生成网站外网视频网站做泥声控
  • 公司的网站推广怎么做上海闵行
  • 移动电商网站开发需求文档怎么做网站结构拓扑图
  • 苏州网站建设公司有哪些中国建设教育协会证书查询网站
  • 网站建站哪个品牌好海外推广广告
  • 东莞市电池网站建设饥饿营销案例
  • 保定制作网站软件广州哪里好玩的景点推荐
  • 成品网站 修改首页诏安建设局网站
  • 印刷网站开发的可行性报告温州网站开发流程
  • 做富集分析的网站it学校培训学校哪个好
  • 网站关键词排名系统品牌全案策划案例
  • 美观网站建设价格注册一个公司
  • 网站文字公告代码邯郸网站建设做公司