package operator; public class Demo01 { public static void main(String[] args) { //二元运算符 //Ctrl+D 复制当前行到下一行 int a=10; int b=20; int c=30; int d=40; Sy ...
分类:
其他好文 时间:
2021-03-06 14:45:10
阅读次数:
0
什么是面向对象 回顾方法的定义与调用 方法的定义 import java.io.IOException; //Demo01 类 public class Demo01 { //main方法 public static void main(String[] args) { } public Strin ...
分类:
编程语言 时间:
2021-03-06 14:43:03
阅读次数:
0
利用循环打印出三角形 public class Demo13 { public static void main(String[] args) { for (int i = 1; i <=5; i++) { for (int d = 5;d>=i;d--){ System.out.print(" " ...
分类:
编程语言 时间:
2021-03-06 14:31:15
阅读次数:
0
class Foo { public static $flag_status = array( 'foo', 'bar' ); Const OT_UPGRADE_1 = 1; Const OT_UPGRADE_2 = 2; } // 静态属性 $name_attr = 'flag_status'; ...
分类:
其他好文 时间:
2021-03-05 13:15:20
阅读次数:
0
一维数组的动态和 自己的解法 public static int[] runningSum(int[] nums) { int[] resArr = new int[nums.length]; int temp = 0; for (int i = 0; i < nums.length; i++) { ...
分类:
其他好文 时间:
2021-03-05 13:05:12
阅读次数:
0
import java.io.File; import java.io.IOException; /* 获取指定文件夹下所有文件名并打印输出, */ public class FileDemo01 { public static void main(String[] args) throws IOE ...
分类:
编程语言 时间:
2021-03-04 13:11:12
阅读次数:
0
3编写代码 public class Hello{ public static void main(String[] args){ System.out.print("Hello,world!"); } } 4编译javac java 文件,会生成一个class文件 5运行class文件,java ...
分类:
其他好文 时间:
2021-03-04 13:10:22
阅读次数:
0
break 和 continue break在任何循环语句的主体部分,均可以用于控制循环的流程。用于强行退出循环,不执行循环中剩余的语句。 也可以用于switch语句中 package com.kuang.struct; public class BreakDemo01 { public stati ...
分类:
其他好文 时间:
2021-03-03 12:26:35
阅读次数:
0
Hello,World! 建一个文件夹,存放代码 新建Java文件 文件后缀名为.java helloworld.java 编写代码 public class helloworld{ public static void main (String[] args){ System.out.print( ...
分类:
其他好文 时间:
2021-03-03 12:16:27
阅读次数:
0
【1】多态跟属性无关,多态指的是方法的多态,而不是属性的多态。 代码: 定义一个动物的父类: public class Animal { public void shut(){ System.out.println("我是小动物,我会叫"); } } 定义一个小猪子类,继承动物类:重写父类的shut ...
分类:
编程语言 时间:
2021-03-03 12:16:11
阅读次数:
0