JAVAÖз½·¨ºÍ±äÁ¿Ôڼ̳ÐÖеĸ²¸ÇºÍÒþ²Ø
http://renyanwei.javaeye.com/blog/258304
ÎÒÃÇÖªµÀ£¬ÔÚJAVAÖУ¬×ÓÀà¿ÉÒԼ̳и¸À࣬Èç¹û×ÓÀàÉùÃ÷µÄ·½·¨Ó븸ÀàÓÐÖØÃûµÄÇé¿öÔõô°ì£¬´ó»ï¶ù¶¼ÖªµÀÒªÊÇÖØд£¬µ«ÊÇʵ¼ÊÉÏÕâÓÖ·ÖΪÁ½ÖÖÇé¿ö£¬¾ÍÊÇ·½·¨ºÍ±äÁ¿Ôڼ̳ÐʱµÄ¸²¸ÇºÍÒþ²ØÎÊÌ⣬ÕâЩ¸ÅÄîÐԵĶ«Î÷¿´ËÆÎÞÁÄ£¬µ«ÊÇÔÚÃæÊÔ»òÕßÊÇSCJPÈÏÖ¤ÌâÖÐΧÈÆÕâЩÊǻᾳ£Åöµ½µÄ£¬ËùÒÔÕâÀïÀ´ÌÖÂÛÏÂ
Ê×ÏÈÎÒÃÇÀ´¿´¼¸¸ö¸ÅÄî
Òþ²Ø £ºchildÒþ²ØÁËparentµÄ±äÁ¿ºÍ·½·¨£¬ÄÇô£¬child²»ÄÜ·ÃÎÊparent±»Òþ²ØµÄ±äÁ¿»òÕß·½·¨£¬µ«ÊÇ£¬½²Bת»»³ÉAÖУ¬¿ÉÒÔ·ÃÎÊA±»Òþ²ØµÄ±äÁ¿»òÕß·½·¨
¸²¸Ç £ºchild¸²¸ÇÁËparentµÄ±äÁ¿»òÕß·½·¨£¬ÄÇô£¬child²»ÄÜ·ÃÎÊparent±»¸²¸ÇµÄ±äÁ¿»òÕß·½·¨£¬½«childת»»³ÉparentºóͬÑù²»ÄÜ·ÃÎÊparent±»¸²¸ÇµÄ±äÁ¿»òÕß·½·¨
Ê×ÏÈ¿´Ò»ÏÂJAVAÖз½·¨ºÍ±äÁ¿Ôڼ̳ÐʱµÄ¸²¸ÇºÍÒþ²Ø¹æÔò
1.¸¸ÀàµÄʵÀý±äÁ¿ºÍ¾²Ì¬±äÁ¿Äܱ»×ÓÀàµÄͬÃû±äÁ¿Òþ²Ø
2.¸¸ÀàµÄ¾²Ì¬·½·¨±»×ÓÀàµÄͬÃû¾²Ì¬·½·¨Òþ²Ø
3.¸¸ÀàµÄʵÀý·½·¨±»×ÓÀàµÄͬÃûʵÀý±äÁ¿¸²¸Ç
»¹Óм¸µãÐèҪעÒâµÄÊÇ
1.²»ÄÜÓÃ×ÓÀàµÄ¾²Ì¬·½·¨Òþ²Ø ¸¸ÀàÖÐͬÑù±êʾ£¨Ò²¾ÍÊÇ·µ»ØÖµ Ãû×Ö ²ÎÊý¶¼Ò»Ñù£©µÄʵÀý·½·¨
2.²»ÄÜÓÃ×ÓÀàµÄʵÀý·½·¨¸²¸Ç ¸¸ÀàÖÐͬÑù±êʾµÄ¾²Ì¬·½·¨
3.Õâµã¶ùÇë×¢Ò⣬¾ÍÊDZäÁ¿Ö»»á±»Òþ²Ø ²»»á±»¸²¸Ç £¬ÎÞÂÛËûÊÇʵÀý±äÁ¿»¹ÊǾ²Ì¬±äÁ¿£¬¶øÇÒ£¬×ÓÀàµÄ¾²Ì¬±äÁ¿¿ÉÒÔÒþ²Ø ¸¸ÀàµÄʵÀý±äÁ¿£¬×ÓÀàµÄʵÀý±äÁ¿¿ÉÒÔÒþ²Ø ¸¸ÀàµÄ¾²Ì¬±äÁ¿
O(∩_∩)O¹þ¹þ~ ÊDz»ÊÇÓеã¶ùÈÆ¿Ú£¬Ã»¹Øϵ ÎÒÃÇ¿´Ò»¸öʵÀý
´´½¨Á½¸ö¸¸×ÓÀà¹ØϵµÄÀà
//¸¸Àà
class Parent
{
public static String kind="javastudy.extendsstudy.parent";
public static int age=50;
public String name="Parent";
//¾²Ì¬·½·¨£¬·µ»Ø°üÃû
public static String getKind()
{
System.out.println("parentµÄgetKind()·½·¨±»µ÷ÓÃÁË");
return kind;
}
//¾²Ì¬·½·¨£¬·µ»ØÄêÁä
public static int getAge()
{
System.out.println("ParentµÄgetAge()·½·¨±»µ÷ÓÃÁË");
return age;
}
//ʵÀý·½·¨£¬·µ»ØÐÕÃû
public String getName()
{
System.out.println("ParentµÄgetName()·½·¨±»µ÷ÓÃÁË");
return this.name;
}
}
//×ÓÀà
class Child extends Parent
{
publ
Ïà¹ØÎĵµ£º
ÔÚ½ñÄê11Ô·ݣ¬ºêÌìÈí¼þ¿ª·ÅÁ˹«Ë¾µÄ¿ªÔ´°æOA 1.2
beta°æ±¾£¬µÃµ½Í¬ÐÐÒÔ¼°ÆóÒµµÄÈÈÁÒÏìÓ¦£¬¹«Ë¾Ò²¼Ó½ôÁËÏÂÒ»²½µÄ¿ªÔ´µÄ²½·¥£¬ºêÌìÈí¼þ°ÑÏÖÐеÄÆóÒµ°æ1.2.1Ò²¶ÔËùÓÐÆóÒµ¿ª·ÅÔ´´úÂ루ÔÝʱ²»¶Ô¸öÈË¿ª
·Å£¬ËäȻĿǰÓкܶà¸öÈ˼°Èí¼þ¿ª·¢ÊÒÇ¿ÁÒÒªÇ󣩣¬ÆóÒµÖ»ÐèÒª»¨ÉÏÍòÔª×óÓÒ£¬¾Í¿ÉÒÔ¹ºÂò¸Ã°æ±¾µÄÈ«²¿´úÂ룬²¢»ñµÃÊÚȨ»ùÓÚ´ËÏ ......
ÔÚcsdnÉÏ¿´µ½ÕâÑùÒ»¸öÌâÄ¿£º
public class Test
{
public static void main(String[] args)
{
int a = 5;
System.out.println("ddsadasa" + (a > 5 ? 9.0 : 9));
}
}
ÔËÐнá¹ûÊÇ£¨ £©
A ddsadasa9 B ddsadasa9.0 C ±àÒë³ö´í & ......
½ñÌì¿´µ½Ò»µÀÌâÄ¿£¬ÊÇÕâÑùµÄ£º£¨ÎÒÔÚÀïÃæ´òÓ¡ÁËһЩÓï¾ä£¬ÏÈ×¢Ê͵ôÁË£©
class Singleton {
private static Singleton obj= new Singleton();
public static int counter1;
public static int counter2 = 2;
private Singleton() {
counter1++;
counter2++;
// System.out.println("Singleton counter1:" ......
package io;
import java.io.*;
/**
* @author ¸ßÕíÎâÓÇ
* ÀûÓûº³åÇøÔÀí,BufferedInputStream,
* ʵÏÖµÄÎļþ×Ö½ÚÁ÷¶ÁÈ¡¹¦ÄÜʾ·¶
*
*/
public class BufferedInOutputStream {
public BufferedInOutputStream() {
ioTest2();
}
public void ioTest2() {
FileInputStream in = null ;
Buffered ......
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
public class CmdTest {
private static final long serialVersionUID = -2650474785662737262L;
public static void main(String[] args) throws Exception {
&n ......