码迷,mamicode.com
首页 >  
搜索关键字:println    ( 5792个结果
a和b互换的2种方式
int a=3; int b=2; a=a+b; b=a-b; a=a-b; System.out.println(a); System.out.println(b); int a=3; int b=2; a=a^b; b=b^a; a=a^b; System.out.println(a);; Sy ...
分类:其他好文   时间:2020-07-25 23:36:38    阅读次数:94
一个关于JVM类初始化问题
刚在看虚拟机相关知识点 看到一段代码,大家猜测一下这段代码会触发子类初始化吗 public class SuperClass{ static{ system.out.println("SuperClass init."); } public static int value=1233; } publ ...
分类:其他好文   时间:2020-07-24 22:07:48    阅读次数:74
JAVA中PrintWriter的用法
try (PrintWriter writer = new PrintWriter("student.txt")) { writer.println("姓名\t语文\t数学\t英语\t总分\t"); for (Student s : set) { writer.println(s.getName() ...
分类:编程语言   时间:2020-07-24 09:21:17    阅读次数:128
java中的常量和变量
变量 含义:在程序过程中变量的值会发生变化,直白来说就是用来存储可变化的数据 变量的好处:使内存空间的得到重复利用 举个例子: 1 System.out.println(10); 2 System.out.println(10); 3 System.out.println(10); 这三个10都是字 ...
分类:编程语言   时间:2020-07-23 23:17:43    阅读次数:89
[MOOC-Java]1.2第一个程序
向屏幕输出 代码 package hello; public class Hello { public static void main(String[] args) { // TODO Auto-generated method stub // 输出 System.out.println("Hel ...
分类:编程语言   时间:2020-07-22 20:05:26    阅读次数:70
【Java】while和do-while循环比较测试案例
/**功能:进行while和do-while循环的测试 */ public class Test { public static void main(String[] args) { int i=0; //声明一个变量 System.out.println("准备进行while循环"); while ...
分类:编程语言   时间:2020-07-22 15:57:32    阅读次数:68
【Java】用for循环实现1+2+3......+100 =
public class Test { public static void main(String[] args) { int sum=0; for(int i=1;i<=100;i++) { sum+=i;/**进行累加 */ } System.out.println("结果为"+sum); } ...
分类:编程语言   时间:2020-07-22 15:34:27    阅读次数:111
递归实现杨辉三角
要求实现一个杨辉三角,不了解的可以看 public static void main(String[] args) { int[] arr = new int[]{1}; System.out.println(fn(arr,10)); } public static int[] fn(int[] a ...
分类:其他好文   时间:2020-07-22 02:05:42    阅读次数:53
static经典案例
案例一: public class A{ //static int number = 0; int number = 0; public A(){ number++; System.out.println("数字:"+number); } } public class Test{ public st ...
分类:其他好文   时间:2020-07-22 01:50:37    阅读次数:72
翻转单词顺序
package main import ( "fmt" "strings" ) func main() { /* 示例 1: 输入: "the sky is blue" 输出: "blue is sky the" */ var s = "the sky is blue" fmt.Println(re ...
分类:其他好文   时间:2020-07-22 01:40:25    阅读次数:66
5792条   上一页 1 ... 21 22 23 24 25 ... 580 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!