javaÖÐStringºÍintÖ®¼äµÄÏ໥ת»¯
javaÖÐ
StringºÍintÖ®¼äµÄÏ໥ת»¯
£¨1£©int i = Integer([String]); »ò
int i = Integer.parseInt([String],[int index]);
£¨2£©int i = Integer.valueOf([String]).intValue();
intÀàÐÍת»¯ÎªString
£¨1£©String s = String.valueOf([int]);
£¨2£©String s = Integer.toString([int]);
£¨3£©String s = "" + [int];
Ïà¹ØÎĵµ£º
JavaÎļþÏÂÔصļ¸ÖÖ·½Ê½
< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
var text = cli ......
native¹Ø¼ü×ÖÓ÷¨
nativeÊÇÓëC++ÁªºÏ¿ª·¢µÄʱºòÓõģ¡java×Ô¼º¿ª·¢²»Óõģ¡
ʹÓÃnative¹Ø¼ü×Ö˵Ã÷Õâ¸ö·½·¨ÊÇÔÉúº¯Êý£¬Ò²¾ÍÊÇÕâ¸ö·½·¨ÊÇÓÃC/C++ÓïÑÔʵÏֵģ¬²¢ÇÒ±»±àÒë³ÉÁËDLL£¬ÓÉjavaÈ¥µ÷Óá£
ÕâЩº¯ÊýµÄʵÏÖÌåÔÚDLLÖУ¬JDKµÄÔ´´úÂëÖв¢²»°üº¬£¬ÄãÓ¦¸ÃÊÇ¿´²»µ½µÄ¡£¶ÔÓÚ²»Í¬µÄƽ̨ËüÃÇÒ²ÊDz»Í¬µÄ¡£ÕâÒ²ÊÇjavaµÄµ×²ã»úÖÆ£ ......
import java.text.Format;
import java.text.SimpleDateFormat;
File file = new File("a.txt");
long time = file.lastModified();
Date d = new Date(time);
Format simpleFormat = new SimpleDateFormat("E dd MMM yyyy hh:mm:ss a");
String dateString = simpleFormat.format(d);
System.err.println(file.getN ......
import java.text.DecimalFormat
double a = 2.3659874;
//СÊý¸ñʽ»¯£¬ÒýºÅÖеÄ0.000±íʾ±£ÁôСÊýµãºóÈý루µÚËÄλËÄÉáÎåÈ룩
DecimalFormat df = new DecimalFormat("0.000");
String num = df.format(a);
System.out.println(num);
Êä³ö½á¹û¾ÍÊÇ 2.366
Java¼ÆËãʱ¼ä²î
±ÈÈ磺ÏÖÔÚÊÇ2004-03-26 13£º31£º40
&nbs ......
\n »»ÐÐ(\u000a)
\t ˮƽÖƱí·û(\u0009)
\b ¿Õ¸ñ(\u0008)
\r »Ø³µ(\u000d)
\f »»Ò³(\u000c)
\' µ¥ÒýºÅ(\u0027)
\" Ë«ÒýºÅ(\u0022)
\\ ·´Ð±¸Ü(\u005c)
\ddd Èýλ°Ë ......