第6讲面向对象特征2内容摘要:
静态变量 public static final InputStream in (标准输入流 ) public static final PrintStream out (标准输出流 ) public static final PrintStream err (标准错误输出流 ) 静态方法 public static void arraycopy(Object src, int srcPos, Object dest, int destPos,int length) public static void exit(int status) public static void gc() public static long currentTimeMillis() … … … … 21 获取当前时间 public static long currentTimeMillis() Returns: the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC (Universal time coordinated). public static void main(String args[]) { long start = ()。 … … … … long end = ()。 (end start)。 } 22 静态变量 public static final double E public static final double PI 静态方法 public static double abs(double a) public static double ceil(double a) public static double floor(double a) public static double max(double a, double b) … … … … 23 基本数据类型的包装类 基本数据类型 : byte, short, int, long, float, double, boolean, char 对应的包装类 : Byte, Short, Integer, Long, Float, Double, Boolean, Character 作用 包装类对象中包含有一个对应基本类型的值 提供有基本类型和字符串 (String)之间的转换函数 定义有一些常数和方法 24 常数定义 byte largestByte =。 //127 short largestShort =。 //32767 int largestInteger =。 //2147483647 long largestLong =。 //9223372036854775807 float largestFloat =。 //+38 double largestDouble =。 //+308 25 基本类型和字符串 (String)之间的转换 Integer类举例 字符串转换为整数 public static int parseInt(String s) throws NumberFormatException public static int parseInt(String s, int radix) throws NumberFormatException String s = “123”。 int i = (s)。 parseInt(0, 10) parseInt(473, 10) parseInt(0, 10) parseInt(FF, 16) parseInt(1100110, 2) parseInt(2147483647, 10) parseInt(2147483648, 10) parseInt(2147483648, 10) parseInt(99, 8) parseInt(Kona, 10) parseInt(Kona, 27) returns 0 returns 473 returns 0 retur s 255 returns 102 returns 2147483647 returns 2147483648 throws a NumberFormatException throws a NumberFormatException throws a NumberFormatException returns 411787 26 基本类型和字符串 (String)之间的转换 Integer类举例 整数转换为字符串 public static String toString(int i) public static String toString(int i, int radix) public static String toBinaryString(int i) public static String toHexString(int i) public static String toOctalString(int i) int i = 123。 String s1 = (i)。 String s2 = (i, 10)。 String s3 = (i, 2)。 String s4 = (i, 8)。 String s5 = (i, 16)。 String s6 = (i)。 String s7 = (i)。 String s8 = (i)。 123 123 1111011 173 7b 1111011 7b 173 27 字符串操作类 三个类 不同的应用场合 28 —字符串 /字符序列 构造方法 public String() public String(byte[] bytes) public String(byte[] bytes, int offset, int length) public String(byte[] bytes, String charsetName) public String(char[] value) public String(char[] value, int offset, int count) public String(String original) 29 —字符串 /字符序列 构造方法的使用 String s = new String()。 char c[] = {„a‟, „b‟, „c‟}。 String s = new String(c)。 char c[] = {„语’ , „言’ }。 String s = new String(c)。 byte b[] = {97, 98, 99}。 String s = new String(b)。 String s = “abc”。 String s = “语言”。 30 —字符串 /字符序列 判断字符串相等的方法 public boolean equals(Object anObject)。第6讲面向对象特征2
相关推荐
发展条件 莫斯科 — 圣彼得堡工业区 机械、化学、多种轻工业 莫斯科、圣彼得堡 原料、燃料大部分从外地运入 乌拉尔工业区 钢铁、机械工业 叶卡捷琳堡 有色金属矿,附近有煤、铁、石油资源 新西伯利亚工业区 重工业、军事工业 新西伯利亚 煤、有色金属等丰富 【 答案 】 D 【 解题思路 】 俄罗斯主要工业区。 这一部分知识可以通过列表比较,概括总结出俄罗斯三个工业区及其工业中心
ed()方法 在覆寫 onOptionsItemSelected()方法是使用 android:id屬性值判斷執行功能,不過,我們需要自行處理是否選擇指定選項,如下所示: public boolean onOptionsItemSelected(MenuItem item) { Button btn = (Button) findViewById()。 switch(()){ case :
而对语音媒体流带宽的节省比例。 此值与厂家设备的具体支持能力有很大关系,典型取值为 ~ 1。 带宽冗余因子:考虑 IP承载网对带宽的冗余,以保证充分带来 IP话音承载质量,建议值为 50%。 平衡因子:取值 本例中对于每个中继网关: 媒体流带宽=500000 32% 70% 100 (50% )=280000 kb/s=280Mb/s =需疏通的话务量 平均消息个数
官方博客:指博客内容属实。 Blogger:译为博主 , 博客上 , 只有博主能发表新话题 , 访问者只能在博主话题下进行回复。 博文:博客文章。 博文和 “ 网络日记 ” 有所区别 , 网络日记明显带有私人性质 , 而博客是私人性和公共性的有效结合。 有的网站空间也称为博客 , 如 MSN空间 、 空间等。 Blog的定义及功能 16 2020/11/23 博客主要功能: