码迷,mamicode.com
首页 >  
搜索关键字:println    ( 5792个结果
Java-面向对象_多态(1)
【1】多态跟属性无关,多态指的是方法的多态,而不是属性的多态。 代码: 定义一个动物的父类: public class Animal { public void shut(){ System.out.println("我是小动物,我会叫"); } } 定义一个小猪子类,继承动物类:重写父类的shut ...
分类:编程语言   时间:2021-03-03 12:16:11    阅读次数:0
三元运算符
public class demo5 { public static void main(String[] args) { int a = 10; int b = 20; a+=b;//a = a+b a-=b;//a = a-b System.out.println(a); //字符串连接符 Sy ...
分类:其他好文   时间:2021-03-02 11:50:18    阅读次数:0
类型转换错误使用
public static void main(String[] args) { int num1 = 10_0000_0000; int rate = 20; long total = num1 * rate; System.out.println(total);// 输出为-1474836480 ...
分类:其他好文   时间:2021-03-01 14:18:24    阅读次数:0
逻辑运算符、位运算符
public class demo4 { //逻辑运算符 public static void main(String[] args) { //与(&&)或(||)非(!) boolean a = true; boolean b = false; System.out.println(a && b) ...
分类:其他好文   时间:2021-03-01 14:15:22    阅读次数:0
Java基础语法
Java基础 0.idea快捷操作 1 //idea快捷操作 2 public static void main(String[] args){ 3 //idea快捷输入:psvm 4 System.out.println(""); 5 //idea快捷输入:sout 6 } 7 //Ctrl+D: ...
分类:编程语言   时间:2021-02-27 13:39:28    阅读次数:0
Java运算符(细节)
运算符细节 public class Demo1 { public static void main(String[] args) { int a = 10; int b = 20; System.out.println(""+a+b);//输出的是1020 System.out.println(a ...
分类:编程语言   时间:2021-02-26 13:17:42    阅读次数:0
「Groovy」- 操作文件(读取、写入) @20210223
检查文件是否存在、可读等等 File file = new File("out.txt") println file.exists() println file.canRead() 向文件写入文本 File file = new File("out.txt") file.write "First l ...
分类:其他好文   时间:2021-02-24 13:10:56    阅读次数:0
2.go语言入门----变量类型、声明变量、数组、切片
基本变量类型 介绍几种基本的变量类型:字符串、int、float、bool package main import ( "fmt" ) // 列举几种非常基本的数据类型 func main() { fmt.Println("go" + "lang") // 允许使用“+”来连接字符串 fmt.Pri ...
分类:编程语言   时间:2021-02-24 12:49:16    阅读次数:0
Java中,自加运算符的赋值特性
为了方便理解,我们先看一段代码: int a = 3; System.out.println(a); // 3 int b = a++; //运行顺序是先赋值,再自增 System.out.println(a); //a = a+1; 4 System.out.println(b); //b = a ...
分类:编程语言   时间:2021-02-22 12:01:13    阅读次数:0
2021_2_18_浮点数拓展
# 浮点数中的常见问题 ```javapublic class FloatAndDouble { public static void main(String[] args) { float num1 = 0.1F; double num2 = 1.0/10; System.out.println( ...
分类:其他好文   时间:2021-02-19 13:49:06    阅读次数:0
5792条   上一页 1 ... 8 9 10 11 12 ... 580 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!