Jian's Note

It's better to burn out than fade away!

Arrays 类及基本使用

主要方法

  • static type[] copyof(type[] original,int length)
  • static int binarysearch(type[] a,type key)
  • static boolean equals(type[] a,type[] b)
  • static void fill(type[] a,type val)
  • static void fill(type[] a,int fromindex,int toindex,type val)
  • static void sort(type[] a)

在搜索、文章底部、侧栏添加最近文章模块

首先在主题配置文件添加以下关键字 1 2 3 4 5 6 7 8 recent_posts: enable: true search: true post: false sidebar: false icon: history title: 近期文章 layout: block 侧栏 在 next/layout/_macro/sidebar.swig 中的 if theme.links 对应的 endif 后面。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 {% if theme.recent_posts.enable and theme.recent_posts.sidebar %} <div class="links-of-blogroll motion-element {{ "links-of-blogroll-" + theme.recent_posts.layout }}"> <div class="links-of-blogroll-title"> <i class="fa fa-history fa-{{ theme.recent_posts.icon | lower }}" aria-hidden="true"></i> {{ theme.recent_posts.title }} </div> <ul class="links-of-blogroll-list"> {% set posts = site.posts.sort('-date') %} {% for post in posts.slice('0', '3') %} <li> <a href="{{ url_for(post.path) }}" title="{{ post.title }}" target="_blank">{{ post.title }}</a> </li> {% endfor %} </ul> </div> {% endif %} 搜索结果处添加 找到路径H:

java 猜数字小游戏(Math 类)

大一刚学 c 的时候以前写过 c 语言版 的。

  1. Math: 针对数学进行运算的类
  2. 特点:没有构造方法,因为它的成员都是静态的
  3. 产生随机数: public static double random(): 产生随机数,范围 [0.0,1.0)
  4. 产生 1-100 之间的随机数 int number = (int)(Math.random()*100)+1;
  5. 猜数字小游戏案例

面向对象基础知识总结

面向对象思想(理解) 面向对象是基于面向过程的一种编程思想 思想特点: A: 是一种更符合我们思考习惯的思想 B: 把复杂的问题简单化 C: 让我们从执行者变成了指挥者 举例: A: 洗衣服 B: 吃饭 C: 买电脑 举例并代码体现 把大象装进冰箱 类与对象(掌握) 我们学习编程是为了把现实世界的事物用编程语言描述来实现信息化。 现实世界事物是如何表

java 水仙花数(循环)

水仙花数(Narcissistic number)也被称为超完全数字不变数(pluperfect digital invariant, PPDI)、自恋数、自幂数、阿姆斯壮数或阿姆斯特朗数(Armstrong number),水仙花数是指一个 3 位数,它的每个位上的数字的 3 次幂之和等于它本身(例如:1^3 + 5^3+ 3^3 = 153)。

java 录入数据

记忆格式: (1) 导包: import java.util.Scanner; 注意:位置在 class 的上面。 (2) 创建键盘录入对象: Scanner sc = new Scanner(System.in); (3) 获取数据 int i = sc.nextInt(); (4) 练习: A: 求两个数据的和 B: 获取两个数据中较大的值 C: 获取三个数据中较大的值 D: 比较两个数是否相等 实例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 package helloworld; import java.util.Scanner; public class helloworld { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i=sc.nextInt(),j=sc.nextInt(),k=sc.nextInt(); sc.close(); System.out.println(i+"+"+j+"="+(i+j)); System.out.println("MAXij="+Max(i,j)); System.out.println("MAXijk="+Max(i,j,k)); }

java 标识符

标识符: 给类,接口,方法或者变量起名字的符号 组成规则: A: 英文字母大小写 B: 数字 C:_和$ 注意事项: A: 不能以数字开头 B: 不能是 Java 中的关键字 C: 区分大小写 Student,student 这是两个名称 常见命名方式: A: 包 其实就是文件夹,用于解决相同类名问题 全部小写 单级:com 多级:cn.itcast B: 类或者接口 一个单词:首字母大写 Student,Person,Teacher 多个单词:

英语语法--主谓一致

常见情况 由 and 或 both and 连接的并列主语,谓语动词一般用复数 English and chinese are two quite different languages. Both brother and sister tire of city life. 一但主语前被 no,every,each 所修饰时,谓语动词用单数 No desk and (no) chair is seen in the hall. All work and no play makes Jack a dull boy. They each have been to the Forbidden city. each 位于主语后,所以谓语动词用复数 当主语表示同一事物的两个部分,同一个人的两个身份(第二个名词前无冠词),谓语动词用单数 比如

英语语法--形式倒装

形式倒装,句子本不是本来的语序。 may 位于句首,标祝愿 例句 May you succeed. May you have a happy holiday. Long live chairman Mao.(毛主席万古长青) whatever 直接做成分或放在名词之前,however 放在 adv,adj 之前或 many,much 等词之前 例句 Whatever the weather is,he sticks out(坚持) walking outside. Go to stamp sales and buy whatever you can offord. Whatever reasons you have,you should carry out your promise. However many difficulties(n.) you meet with,you should try to overcome them. Whatever difficulties(n.) you meet with,you should try to overcome them. However difficult(adj.) the problem is,we must work it out today.

英语语法--完全倒装

完全倒装: 把整个谓语动词放到主语前。 表方位或时间的副词 (adv)、表地点的介词短语位于句首时 例句 Here comes the bus. In the lecture hall of a university sits a professor. Out rushed the children. Now comes your turn. Up jumped the cat and caught the mouse. Down came the rain and up went the umbrellas. Among the people stood his friend,Jim. (To be) South of the river lies a small factory. 但主语为表示人称的代词时无需倒装 Here are you. Away it flew. 表语(词/短语)位于句首时,adj/doing/d
0%