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

网站开发过程中出现的问题企业wordpress模板免费

网站开发过程中出现的问题,企业wordpress模板免费,怎么封锁网站,教育类网站源码自定义数组(面向对象编程)#xff1a;直接上代码#xff1a;package com.xingej.algorithm.datastructure.array;/*** 面向对象编程** 自定义类数组** 你一定要明白#xff0c;这是在JDK基础之上的封装#xff0c;要学会这种思路#xff0c;其他框架如netty 也是在前者的基…自定义数组(面向对象编程)直接上代码package com.xingej.algorithm.datastructure.array;/*** 面向对象编程** 自定义类数组** 你一定要明白这是在JDK基础之上的封装要学会这种思路其他框架如netty 也是在前者的基础上封装而来的如有一** 部分是封装的线程池** author erjun 2017年11月28日 下午9:42:10*/public class MyArray {// 定义的数据结构类型是 数组// 这是最核心的组件其他都是围绕这个来进行操作的private long[] arr;// 表示有效数据的长度也就是说数组里有多少个数组private int elements;public MyArray() {// 默认可以存储50个数字arr  new long[50];}public MyArray(int maxsize) {arr  new long[maxsize];}// 插入数据public void insert(long value) {arr[elements]  value;// 每次插入数据都会自增一次elements;}// 根据索引来查找数据public long get(int index) {if (index  elements || index throw new ArrayIndexOutOfBoundsException();}return arr[index];}// 显示数据也就是打印数组里的内容public void display() {// 说明此时数组里还没有内容呢if (elements  0) {return;}System.out.print([ );for (int i  0; i System.out.print(arr[i]   );}System.out.println(]);}// 根据输入的值来返回 索引值public int getIndexByValue(long value) {int i  0;for (; i if (arr[i]  value) {// 如果找到的话就立即返回索引值return i;}}return -1;}// 根据索引值来删除数组里的元素public void delete(int index) {if (index  elements || index throw new ArrayIndexOutOfBoundsException();}// 将后面的元素往前移动for (int i  index; i arr[i]  arr[i  1];}// 最后将有效值减一elements--;}// 更新值public void update(int index, long newValue) {if (index  elements || index throw new ArrayIndexOutOfBoundsException();}arr[index]  newValue;}}测试用例package com.xingej.algorithm.datastructure.array;import org.junit.Before;import org.junit.Test;import com.xingej.algorithm.datastructure.array.MyArray;/*** 面向对象编程** 也就是说你操作的 都是对象而非基本数据类型了*** author erjun 2017年11月28日 下午9:59:36*/public class MyArrayTest {private MyArray myArray;Beforepublic void init() {myArray  new MyArray();testInsert();}// 插入数据测试Testpublic void test() {myArray.insert(20);System.out.println(----:\t  myArray.get(0));}Testpublic void testInsert() {myArray.insert(20);myArray.insert(10);myArray.insert(5);myArray.insert(30);}// 显示/打印数组里的内容Testpublic void testDisplay() {myArray.display();}// 显示/打印数组里的内容Testpublic void testGetIndexByValue() {System.out.println(---索引值是:\t  myArray.getIndexByValue(20));}// 根据下标来删除指定位置的元素Testpublic void testDelete() {System.out.println(---删除之前打印数组里的元素------);myArray.display();myArray.delete(5);System.out.println(---删除之后打印数组里的元素------);myArray.display();}Testpublic void testUpdate() {myArray.update(2, 100);System.out.println(---更新之后的值----\t  myArray.get(2));}}代码已经上传到git上了
http://www.zqtcl.cn/news/983041/

相关文章:

  • 网站的数据库丢失建筑素材网
  • 个人网站做短视频pathon能做网站开发吗
  • 客户网站制作管理系统网站程序 wap pc 同步
  • 天津手动网站建设调试百度医院网站建设
  • ppt网站源码今天哈尔滨最新通告
  • asp网站乱码广州制作网页设计
  • 调用别人网站的数据库如何开网店卖自己的东西
  • 个人网站做影视网站开发学什么专业
  • 企业名称注册查询官网入口免费seo网站推广
  • 浙江门户网站建设公司个体工商户查询
  • 做网站的注意点赛事竞猜网站开发
  • 现在流行用什么语言做网站ppt设计教程网
  • 高端网站哪种好培训机构不退钱最怕什么举报
  • 青岛个人建站模板wordpress没有链接
  • 网上学习网站有哪些厦门城乡建设局网站
  • 怎样创建网站快捷方式个人制作一个网站的费用
  • 恒信在线做彩票的是什么样的网站软件开发流程管理
  • 网站服务器地址在哪里看艺术学校网站模板
  • 郑州中心站网站建设价格标准新闻
  • 电子商务网站管理互联网营销师主要做什么
  • 门户网站指的是什么凯里网络公司建设网站
  • 网站接入服务商查询0建设营销型网站步骤
  • 长沙如何做百度的网站小型网站建设实训教程
  • 昆明网络公司网站网站建设经费请示
  • 手机端网站欣赏wordpress 文章rss
  • 做网站一定要实名认证吗国外免费空间网站申请
  • 阿里云网站空间主机长春网站建设设计
  • 龙华网站建设yihekj长沙招聘网站制作
  • 网站怎么做文本跳出来网络规划设计师有用吗
  • 室内设计网站官网大全中国那些企业做网站做得好