Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cc.openhome;
- import java.util.Scanner;//懶人包
- class c{
- String color;
- char size;
- c(String color,char size) //建構式(constructor
- {
- this.color=color;
- this.size=size;
- }
- }
- public class Main{
- public static void main(String[] args) {
- Scanner com=new Scanner(System.in);//建立實例
- final int pi=3;
- final int a=75;
- float b=3.14F;//遺失精準度問題,加f
- long d=2147483648L;//int 2147489647
- int num_scan;
- num_scan=com.nextInt();//讀取指令操作
- System.out.print(num_scan);
- System.out.println();
- c sun=new c("red",'s');
- System.out.println("hello ");
- System.out.printf("%d~%d\n",Integer.MIN_VALUE,Integer.MAX_VALUE);
- System.out.println(pi);
- System.out.println(a>70&&a<80);
- System.out.printf("%d\n",d);
- System.out.printf("%s,%c\n",sun.color,sun.size);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement