Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVAÊý¾ÝÀàÐÍת»»


½«×Ö´® String ת»»³ÉÊý×ÖÀàÐÍ
String ת int
1.) int i = Integer.parseInt([String]); »ò i = Integer.parseInt([String],[int radix]);
2.) int i = Integer.valueOf(my_str).intValue();
String ת Float
Float f = Integer.valueOf(my_str).floatValue();
String ת float
float f=new Float(my+str).floatValue();
×¢: ×Ö´®×ª³É Double, Float, Long µÄ·½·¨´óͬСÒì.
½«ÕûÊý int ת»»³É×Ö´® String
1.) String s = String.valueOf(i);
2.) String s = Integer.toString(i);
3.) String s = "" + i;
×¢: Double, Float, Long ת³É×Ö´®µÄ·½·¨´óͬСÒì.
JAVAÖг£ÓÃÊý¾ÝÀàÐÍת»»º¯Êý
ËäÈ»¶¼ÄÜÔÚJAVA APIÖÐÕÒµ½£¬ÕûÀíÒ»ÏÂ×ö¸ö±¸·Ý¡£
string->byte
Byte static byte parseByte(String s)
byte->string
Byte static String toString(byte b)
char->string
Character static String to String (char c)
string->Short
Short static Short parseShort(String s)
Short->String
Short static String toString(Short s)
String->Integer
Integer static int parseInt(String s)
Integer->String
Integer static String tostring(int i)
String->Long
Long static long parseLong(String s)
Long->String
Long static String toString(Long i)
String->Float
Float static float parseFloat(String s)
Float->String
Float static String toString(float f)
String->Double
Double static double parseDouble(String s)
Double->String
Double static String toString(Double
ÕâÊÇÒ»¸öÀý×Ó,˵µÄÊÇJAVAÖÐÊý¾ÝÊýÐ͵Äת»».¹©´ó¼ÒѧϰÒý
package cn.com.lwkj.erts.register;
import java.sql.Date;
public class TypeChange {
public TypeChange() {
}
//change the string type to the int type
public static int stringToInt(String intstr) {
    Integer integer;
    integer = Integer.valueOf(intstr);
    return integer.intValue();
}
//change int type to the string type
public static String intToString(int value) {
    Integer integer = new Integer(value);
    return integer.toString();
}
//change the string typ


Ïà¹ØÎĵµ£º

JAVA¶àÏß³Ì

package debug;import java.io.*;import java.lang.Thread;class MyThread extends Thread{  public int x = 0;  public void run(){    System.out.println(++x);  }}class R implements Runnable{  private int x = 0;  public void run(){    System.out.printl ......

JAVA¿ª·¢ÖÒ¸æ £¨ÐÂÊֱضÁ£¬ÀÏÊÖ·¹ý^_^£©

д¸ø±ÈÎÒ»¹ÐµÄÐÂÊÖÃÇ£¬Èç¹ûÑ¡ÔñÁËÕâÐУ¬¾ÍÄÍÐĵĶÁÏÂÈ¥¡£
1£¬²»Òª×Ü˵“±à²»³öÀ´”£¬“²»»á±à”Ö®ÀàµÄ»°£¬ÄÇЩ»°ÊÇÒòΪÄã×Ô¼ºÀÁ£¬²»Ïë±à£¬²»Ïëѧ¶øÒÑ¡£
2£¬²»ÒªÄÜ¿ª·¢µãС³ÌÐò¾Í³öÈ¥ÏÔ°Ú£¬ÄãÖ»²»¹ýÊÇÓñðÈ˸øÄãдºÃµÄ¶«Î÷¶øÒÑ¡£
3£¬²»ÒªÌ«Ö´×ŵĶ¢×ÅAPI£¬JAVAµÄ¾«»ªÔÚÓÚ±à³Ì˼·¸úģʽ£¬¶ø²»ÊÇÒѾ­ ......

Java×ÔѧС½á——1

ÔÚѧУ×ÔѧJava£¬ÓõÄÊÇ¡¶Java³ÌÐòÉè¼Æ——Ò»ÖÖ¿ìѧ¿ÆµÄ·½·¨¡·¡£¿´ÁËÒÔºó·¢ÏÖ£¬°¡£¬ÕæÊÇÒ»±¾ºÃÊé¡£ËüÕæÊÇ¿çѧ¿Æ°¡£¬Êýѧ£¬ÎïÀí£¬ÉúÎïÎÊÌⶼ¿ÉÒÔÓÃJava×÷Ϊ¹¤¾ßÀ´Ñо¿¡£³ýÁ˸÷ÖÖÊýѧÎÊÌ⣬±ÈÈçËã·¨£¬µÝ¹é£¬Ëü»¹Ñо¿ÁËÎïÀíÎÊÌâ¡£ËüÉæ¼°Á˸÷ÖÖÎÊÌ⣬Éø͸ÀíÂÛ£¬»ùÒò×éѧ£¬Mandelbort¼¯µÈ¡£×îÅ£µÄÊÇ£¬ËüÓÃÆõԼʽµÄÉè¼ ......

JAVA ³£Óü¼ÇÉ


1.²ð·Ö×Ö·û´®
Óöµ½ÌØÊâ×Ö·û£¬±ÈÈ磺¶Ô‘$’·ûºÅ£¬¾ÍÓ¦¸ÃʹÓÑ\\$’£¬ºó×ܽá¿ÉÒÔ¼Ó¸ö·½À¨ºÅÈç "[.]"¡£
2.±éÀúHASHMAP
Iterator itr = map.keySet().itrator();
while(itr.hasNext())
{
    Object temp1 = itr.next();
    Object temp2 = tab.get(temp1);
} ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ