JavaÖеÄÄÚ²¿ÀàºÍÄäÃûÀà
ÌáÆðJavaÄÚ²¿ÀࣨInner Class£©¿ÉÄܺܶàÈ˲»Ì«ÊìϤ£¬Êµ¼ÊÉÏÀàËÆµÄ¸ÅÄîÔÚC++ÀïÒ²ÓУ¬ÄǾÍÊÇǶÌ×ÀࣨNested Class£©£¬¹ØÓÚÕâÁ½ÕßµÄÇø±ðÓëÁªÏµ£¬ÔÚÏÂÎÄÖлáÓжԱȡ£ÄÚ²¿Àà´Ó±íÃæÉÏ¿´£¬¾ÍÊÇÔÚÀàÖÐÓÖ¶¨ÒåÁËÒ»¸öÀࣨÏÂÎĻῴµ½£¬ÄÚ²¿Àà¿ÉÒÔÔÚºÜ¶àµØ·½¶¨Ò壩£¬¶øÊµ¼ÊÉϲ¢Ã»ÓÐÄÇô¼òµ¥£¬Õ§¿´ÉÏÈ¥ÄÚ²¿ÀàËÆºõÓÐЩ¶àÓ࣬ËüµÄÓô¦¶ÔÓÚ³õѧÕßÀ´Ëµ¿ÉÄܲ¢²»ÊÇÄÇôÏÔÖø£¬µ«ÊÇËæ×ŶÔËüµÄÉîÈëÁ˽⣬Äã»á·¢ÏÖJavaµÄÉè¼ÆÕßÔÚÄÚ²¿ÀàÉíÉϵÄÈ·ÊÇÓÃÐÄÁ¼¿à¡£Ñ§»áʹÓÃÄÚ²¿À࣬ÊÇÕÆÎÕJava¸ß¼¶±à³ÌµÄÒ»²¿·Ö£¬Ëü¿ÉÒÔÈÃÄã¸üÓÅÑŵØÉè¼ÆÄãµÄ³ÌÐò½á¹¹¡£ÏÂÃæ´ÓÒÔϼ¸¸ö·½ÃæÀ´½éÉÜ£º
µÚÒ»´Î¼ûÃæ
public interface Contents {
int value();
}
public interface Destination {
String readLabel();
}
public class Goods {
private class Content implements Contents {
private int i = 11;
public int value() {
return i;
}
}
protected class GDestination implements Destination {
private String label;
private GDestination(String whereTo) {
label = whereTo;
}
public String readLabel() {
return label;
}
}
public Destination dest(String s) {
return new GDestination(s);
}
public Contents cont() {
return new Content();
&
Ïà¹ØÎĵµ£º
javaÖеÄÐÞÊηû
static ±íʾ¾²Ì¬£¬Ëü¿ÉÒÔÐÞÊÎÊôÐÔ£¬·½·¨ºÍ´úÂë¿é¡£
1£¬staticÐÞÊÎÊôÐÔ£¨Àà±äÁ¿£©£¬ÄÇôÕâ¸öÊôÐԾͿÉÒÔÓà ÀàÃû.ÊôÐÔÃû À´·ÃÎÊ£¬Ò²¾ÍÊÇʹÕâ¸öÊôÐÔ³ÉΪ±¾ÀàµÄÀà±äÁ¿£¬Îª±¾Àà¶ÔÏóËù¹²ÓС£Õâ¸öÊôÐÔ¾ÍÊÇÈ«À๫ÓС££¨¹²ÓеÄÀà±äÁ¿Óë¶ÔÏóÎ޹أ¬Ö»ºÍÀàÓйأ©¡£
Àà¼ÓÔØµÄ¹ý³Ì£¬Àà±¾ÉíÒ²ÊDZ£´æÔÚÎļþÖУ¨×Ö½ÚÂëÎļþ± ......
Ò»¡¢±à¼JavaÔ´Îļþ
=============================================
Hello.java
=============================================
package test;
public class Hello
{
static
{
try
{
//´Ë´¦¼´Îª±¾µØ·½·¨ËùÔÚÁ´½Ó¿âÃû
&n ......
private static boolean isValidDate(String strValue ) {//20091001×Ö·û´®
int d = Integer.parseInt(strValue.substring(6, 8));
int m = Integer.parseInt(strValue.substring(4, 6));
int y = Integer.parseInt(strValue.subst ......
A flexible layout configurable with pattern string.
The goal of this class is to format
a LoggingEvent
and return the results as a String. The results depend on the conversion
pattern
.
The conversion pattern is closely related to the conversion pattern of the
printf function in C ......