六安网络公司

六安市属于北亚热带向暖温带转换的过渡带,季风显著,四季分明,气候温和,雨量充沛,光照充足,无霜期长
[9] ;光、热、水配合良好。但由于处在北亚热带向暖温带转换的过渡带,暖冷气流交会频繁,年际间季风强弱程度不同,进退早迟不一,因而造成气候多变,常受水、旱灾害的威胁,制约农业生产的因素亦多。全区大部分地区多年平均气温为14.6℃~15.6℃,自东北向西南随地势抬高而递减。全区平均地面温度自北向南在18~19℃,均高于平均气温。
[12] 水文
六安市地表水比较丰富,年平均地表径流92.1~99.92亿立方米。全区河流众多,积水面积超过100平方公里的有45条,其中主要河流有7条,分属淮河、长江两大水系。史河、沣河、汲河、淠河、东淝河由南向北汇入淮河。全区天然湖泊有城西湖、城东湖、瓦埠湖、姜家湖、寿西湖、肖严湖、梁家湖、孟家湖等。这些湖泊都是在淮河洪水威胁淮北大堤和沿淮城市、工矿、铁路交通等安全时,作为调节洪峰的蓄水区、行洪区和滞洪区。全区地下水资源贫乏,沿河湖平原圩畈,范围小,且处于河谷两侧狭长地带,与地表水资源相比甚微。因地层和岩性的差异,全区地下水有孔隙水、裂隙水、岩溶
六安网络公司
而Date类的getTime()方法可以得到我们前面所说的一个时间对应的长整型数,与包装类一样,Date类也有一个toString()方法可以将其转换为String类。
有时我们希望得到Date的特定格式,例如20020324,我们可以使用以下方法,首先在文件开始引入:
import java.text.SimpleDateFormat;java.util.Date date = new java.util.Date();//如果希望得到YYYYMMDD的格式SimpleDateFormat sy1=new SimpleDateFormat("yyyyMMdd");String dateFormat=sy1.format(date);//如果希望分开得到年,月,日SimpleDateFormat sy=new SimpleDateFormat("yyyy");SimpleDateFormat sm=new SimpleDateFormat("MM");SimpleDateFormat sd=new SimpleDateFormat("dd");String syear=sy.format(date);String smon=sm.format(date);String sday=sd.format(date);总结:
1、只有 boolean 不参与数据类型的转换
2、自动类型的转换:
3、强制类型转换:用圆括号括起来目标类型,置于变量前
CHENG
159***3536@qq.com
a.常数在表数范围内是能够自动类型转换的
b.数据范围小的能够自动数据类型大的转换(注意特例)
float 到 int,float 到 long,double 到 int,double 到 long 等由浮点类型转换成整数类型时,是不会自动转换的,不然将会丢失精度。
c.引用类型能够自动转换为父类的
d.基本类型和它们包装类型是能够互相转换的
程序猿
591***987@qq.com
在 java 中,任何字符类型与字符串相加,结果都是拼接。
原因:先应用 String.valueOf 得出 s 的 value 值,再通过 StringBuilder 拼接 hello,因此将 value 与 hello 进行了拼接。
String s = null;s = (new StringBuilder(String.valueOf(s))).append("hello").toString(); System.out.println(s);程序猿
591***987@qq.com
兔2
yum***126@126.com
包装类 Integer 的自动封装
int 类型在赋值到 Integer 类时,会自动封装,调用 Integer 的 valueOf(int i) 方法。
/** * Returns an {@code Integer} instance representing the specified * {@code int} value. If a new {@code Integer} instance is not * required, this method should generally be used in preference to * the constructor {@link #Integer(int)}, as this method is likely * to yield significantly better space and time performance by * caching frequently requested values. * * This method will always cache values in the range -128 to 127, * inclusive, and may cache other values outside of this range. * * @param i an {@code int} value. * @return an {@code Integer} instance representing {@code i}. * @since 1.5 */public static Integer valueOf(int i) { assert IntegerCache.high >= 127; if (i >= IntegerCache.low && i <= IntegerCache.high) return IntegerCache.cache[i + (-IntegerCache.low)]; return new Integer(i);}