摘要:
关于for循环的理解 先看例题 public static void main(String[] args) { int x=1; for(System.out.print("a");x<=5;System.out.print("b")) { System.out.print("c");x++; } 阅读全文
posted @ 2022-06-12 23:24
开源遗迹
阅读(25)
评论(0)
推荐(0)
摘要:
public static void main (String args[]){ int s=f(8); System.out.println(s); } public static int f(int n){ if(n==0) return 0; if(n==1) return 1; return 阅读全文
posted @ 2022-06-12 22:18
开源遗迹
阅读(33)
评论(0)
推荐(0)
摘要:
二维数组误区 int[][] array= new int[3][]; int[][] array1= new int[][2]; 以上两种个数组创建可行吗 如果你是以行列矩阵的方式考虑,为什么有行不能有列,就错了 int [3][2]看成二叉树,三个子节点下有两个叶子节点,没有树杈哪来叶子 后面空 阅读全文
posted @ 2022-06-12 21:16
开源遗迹
阅读(20)
评论(0)
推荐(0)
摘要:
public static void main(String[] args) { int []arr={2,2,2,9,7,7,7,3,3,3,6,6,6,0,0,0}; int len=arr.length; char[][]kRadix=new char[len][]; int k=3; int 阅读全文
posted @ 2022-06-12 20:23
开源遗迹
阅读(25)
评论(0)
推荐(0)
摘要:
两个变量交换你明白几种 public class Test { public static void main(String[] args) { int a=1; int b=2; //第一种,临时变量发 int c=a; a=b; b=c; //第二种,加减乘除法(这里可以乘除) a=a+b; b 阅读全文
posted @ 2022-06-12 17:56
开源遗迹
阅读(19)
评论(0)
推荐(0)
摘要:
public static void main(String args[]){ double num=0.625; StringBuilder sb=new StringBuilder("0."); while(num>0){ double r=num*2; if(r>=1){ sb.append( 阅读全文
posted @ 2022-06-12 17:08
开源遗迹
阅读(57)
评论(0)
推荐(0)
摘要:
关于final修饰问题 public class Demo2 { public void test(final int[] array) { if(array.length>1) { array[0]=100; } System.out.println(Arrays.toString(array)) 阅读全文
posted @ 2022-06-12 11:54
开源遗迹
阅读(22)
评论(0)
推荐(0)
摘要:
public class demo3 { public static void main(String[] args) { int a=6; System.out.println(a); int b=m(a); System.out.println(b); } private static int 阅读全文
posted @ 2022-06-12 11:11
开源遗迹
阅读(23)
评论(0)
推荐(0)
摘要:
float范围为何比int大 基本数据类型大小比较:ibyte(8)<short(16)<int(32)<long(64)<float(32)<double(64) float的32bit位表示含义0(符号)00000000(幂数)000000000000000000000(小数部分) 8个bit表 阅读全文
posted @ 2022-06-12 10:18
开源遗迹
阅读(166)
评论(0)
推荐(0)
摘要:
public static void main(String args[]){ Scanner scanner =new Scanner(System.in); int N=scanner.nextInt(); if((N&(N-1))==0){ System.out.println("是"); } 阅读全文
posted @ 2022-06-12 09:27
开源遗迹
阅读(32)
评论(0)
推荐(0)
摘要:
拼接字符串 public class Demo { public static void main(String[] args) { String str1=5+"5"; String str2=5+5+"5"+5+5; String str3='5'+5+"zzt"; String str4="z 阅读全文
posted @ 2022-06-12 09:03
开源遗迹
阅读(24)
评论(0)
推荐(0)
摘要:
public class deme02 { public static void main (String args[]){ Scanner scanner=new Scanner(System.in); int N=scanner.nextInt(); System.out.println(Int 阅读全文
posted @ 2022-06-12 08:35
开源遗迹
阅读(30)
评论(0)
推荐(0)

浙公网安备 33010602011771号