Java基本数据类型转换二
2024-09-07 01:06:39
public class TestConvert2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int i = 1,j;
float f1 = 0.1f;
float y = (float)0.2;
float f2 = 123;
long l1 = 12345678;
long l2 = 8888888888L;
double d1 = 2e20,d2 = 124;
byte b1 = 1,b2 = 2,b3 = 127;
j = 0;
j = j + 10;
i = i/10;
i = (int) (i*0.1);
char c1 = 'a',c2 = 125;
byte b = (byte)(b1-b2);
char c = (char)(c1 + c2 - 1);
float f3 = f1 + f2;
float f4 = (float)(f1 + f2*0.1);
double d= d1*i + j;
float f = (float)(d1*5 + d2);
}
}
最新文章
- 清华微积分-1_Ch1习题
- Weibo SDK WP版本回调参数没有uid的解决方法
- MVC4 学习笔记 之 URL中存在编译的空格 20%20%
- hrbustoj 1551:基础数据结构——字符串2 病毒II(字符串匹配,BM算法练习)
- openvpn构建
- Python学习(1)
- 爱之初体验---编译加载内核模块hello
- 封装dll遇到的奇葩错误:error LNK2005: _DllMain@12 已经在 DLLMain.obj 中定义
- Ubuntu开机启动svn
- 记录一次EF优化
- [Swift]LeetCode235. 二叉搜索树的最近公共祖先 | Lowest Common Ancestor of a Binary Search Tree
- Nginx编译安装lua-nginx-module
- python:利用configparser模块读写配置文件
- Set authorization for a whole area
- hibernate--博客
- SpringBoot几个重要的事件回调、监听机制
- Complete Physics Platformer Kit 学习
- CPU load高而使用率低的问题分析
- fastcgi协议之一:定义
- php unset()函数销毁变量但没有实现内存释放
热门文章
- [PHP] cli环境下php设置进程名字
- 转载:关于STM32硬件I2C读写EEPROM代码实现原理的理解与总结
- CodeForces - 1243D (思维+并查集)
- request.getScheme()+";://";+request.getServerName()+";:";+request.getServerPort()+request.getContextPath()+";/";
- acwing 47. 二叉树中和为某一值的路径
- ccf再卖菜
- ZEN、ELECTRA、ALBERT
- IT兄弟连 Java语法教程 Java语法基础 经典面试题
- FastJson中的ObjectMapper对象的使用详解
- 使用dapper遇到的问题及解决方法