/*
* Created on 2003/12/16
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
/**
* @author zhaoz
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class area {
public static void main(String args[]){
double pi,r,a,c,d;
r=10.8;
pi=3.1416;
a=pi*r*r;
c=3.0;
d=4.0;
System.out.println("area of circle: " + a);
char ch1,ch2;
ch1=88;
ch2='Y';
System.out.println("ch1 and ch2 " + ch1 + " " + ch2);
ch1='X';
System.out.println("ch1 " + ch1);
ch1++;
System.out.println("ch1 now " + ch1);
ch1='\123';
System.out.println("ch1 now " + ch1);
ch1='\u3540';
System.out.println("ch1 now " + ch1);
ch1='\r';
System.out.println("ch1 now " + ch1);
ch1='\t';
System.out.println("ch1 now " + (int)ch1);
ch1='\b';
System.out.println("ch1 now " + (int)ch1);
ch1='\f';
System.out.println("ch1 now " + (int)ch1);
a=Math.sqrt(c*c+d*d);
System.out.println("a now " + a);
int e=257;
byte f;
f=(byte)e;
System.out.println("f now " + f);
e=10000%256;
System.out.println("e now " + e);
f=(byte)pi;
System.out.println("pi now " + f);
byte aa,bb,cc;
aa=125;
bb=125;
cc=100;
e=aa*bb*cc;
System.out.println("e now " + e);
aa=50;
aa=(byte)(aa*2);
System.out.println("aa now " + aa);
int[][] twoD;
twoD=new int[4][];
for(int i=0;i<4;i++){
twoD[i]=new int[i+1];
}
int i,j,k=1;
for(i=0;i<4;i++){
for(j=0;j<i+1;j++){
twoD[i][j]=k;
k++;
}
}
for(i=0;i<4;i++){
for(j=0;j<i+1;j++){
System.out.print(twoD[i][j] + " ");
}
System.out.println();
}
}
}
Java2 参考大全(第4版中文版).rar
需积分: 0 176 浏览量
2008-11-14
20:59:22
上传
评论 1
收藏 2.41MB RAR 举报
Finecheng
- 粉丝: 1
- 资源: 18
最新资源
- C语言基础-C语言编程基础之Leetcode编程题解之第39题组合总和.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第38题外观数列.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第37题解数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第36题有效的数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第35题搜索插入位置.zip
- index.wxml
- C语言基础-C语言编程基础之Leetcode编程题解之第33题搜索旋转排序数组.zip
- 基于Python实现的手写数字识别系统源码.zip
- 从网页提取禁止转载的文字
- C语言基础-C语言编程基础之Leetcode编程题解之第32题最长有效括号.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0