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

Java: class , objects

Java: class , objects
1 Inheritance(¼Ì³Ð)µÄ¹Ø¼ü×Öextends
class MountainBike extends Bicycle {
}
µ«ÊDz»ÄܶàÖØ¼Ì³Ð¡£²»¹ý¿ÉÒÔͨ¹ýimplements¶à¸öinterfaceÀ´ÊµÏÖÀàËÆµÄ¶«Î÷
2 interface
interface Bicycle {
       void changeCadence(int newValue);   // wheel revolutions per minute
       void changeGear(int newValue);
       void speedUp(int increment);
       void applyBrakes(int decrement);
}
class ACMEBicycle implements Bicycle {
   // remainder of this class implemented as before
}
¿ÉʵÏÖ(implements)¶à¸öinterface
class MyClass extends MySuperClass implements YourInterface {
    //field, constructor, and method declarations
}
means that MyClass is a subclass of MySuperClass and that it implements the YourInterface interface
3 package
A package is a namespace that organizes a set of related classes and interfaces.
4 Access Modifier
public, private, protected
public class Bicycle {
     private int cadence;
     public int aag;
     public void test();
}
ÿ¸öfield»òmethod¶¼±ØÐëµ¥¶ÀÐÞÊÎ
 
Access Levels
ModifierClassPackageSubclassWorld
public
Y
Y
Y
Y
protected
Y
Y
Y
N
no modifier
Y
Y
N
N
private
Y
N
N
N
Ô¼¶¨£º
class Ãû×ֵĵÚÒ»¸ö×Öĸ´óд; methodµÚÒ»¸öwordÊǶ¯´Ê
5 Constructors
The compiler automatically provides a no-argument, default constructor for any class without constructors.
This default constructor will call the no-argument constructor of the superclass.
6 method & parameter
The Java programming language doesn't let you pass methods into methods. But you can pass an object into a method and then invoke the object's methods.
 can Returning a Class or Interface??
7 this : current object
public class Point {
public int x = 0; //field¿ÉÒÔÕâÑù³õʼ»¯
public int y = 0;


Ïà¹ØÎĵµ£º

ÃæÏòJavaÓ¦ÓõĿìËÙWeb·þÎñÖ§³Ö¹¤¾ß

 ÃæÏòJavaÓ¦ÓõĿìËÙWeb·þÎñÖ§³Ö¹¤¾ß - Netrifex
Proxisoft½ñÌìÐû²¼Netrifex 1.0°æ¡£
Netrifex¿ÉÒÔÁ¢¼´°ÑWeb ServicesÌí¼Óµ½ÏÖÓеÄJava SEºÍJava EEÓ¦ÓóÌÐò£¬´Ó¶øÊµÏÖ°ÑWeb Services¿ìËÙ¡¢µÍ·ÑÓõIJ¿Êðµ½Õû¸öÆóÒµÓ¦Óá£
NetrifexÔö¼ÓWeb Servicesµ½ÏÖÓеÄJavaÓ¦ÓÃÖС£¸Ã²úƷʹÓû§Äܹ»£º
* ¿ìËÙ´´½¨Web Service ......

JavaÐéÄâ»úÌåϵ½á¹¹

 Ò»¡¢Ê²Ã´ÊÇJavaÐéÄâ»ú
JavaÐéÄâ»úÊÇÒ»¸öÏëÏóÖеĻúÆ÷,ÔÚʵ¼ÊµÄ¼ÆËã»úÉÏͨ¹ýÈí¼þÄ£ÄâÀ´ÊµÏÖ¡£JavaÐéÄâ»úÓÐ×Ô¼ºÏëÏóÖеÄÓ²¼þ,Èç´¦ÀíÆ÷¡¢¶ÑÕ»¡¢¼Ä´æÆ÷µÈ,»¹¾ßÓÐÏàÓ¦µÄÖ¸Áîϵͳ¡£
1.ΪʲôҪʹÓÃJavaÐéÄâ»ú
JavaÓïÑÔµÄÒ»¸ö·Ç³£ÖØÒªµÄÌØµã¾ÍÊÇÓëÆ½Ì¨µÄÎÞ¹ØÐÔ¡£¶øÊ¹ÓÃJavaÐéÄâ»úÊÇʵÏÖÕâÒ»ÌØµãµÄ¹Ø¼ü¡£Ò»°ãµÄ¸ß¼¶ÓïÑÔÈç¹ ......

ʹÓÃJava ME¼¼Êõ¿ª·¢ÊÖ»úÃÜÂë¹ÜÀíÈí¼þ

 Ê¹ÓÃJava ME¼¼Êõ¿ª·¢ÊÖ»úÃÜÂë¹ÜÀíÈí¼þ
³ÂÔ¾·å
       ÕªÒª£ºJava ME¼¼ÊõÊÇ3G¿ª·¢Ö÷Á÷µÄ¼¼ÊõÖ®Ò»£¬±¾ÎĽ«Í¨¹ýϵͳµÄ·½Ê½½éÉÜÈçºÎʹÓÃJava ME¼¼Êõ¿ª·¢ÃÜÂë¹ÜÀíÈí¼þ£¬Ê¹´ó¼ÒÄܹ»Í¨¹ý¸ÃÎÄÕ¿ìËÙÊìϤJava ME¼¼Êõ£¬½øÈë3GÒÆ¶¯³ÌÐò¿ª·¢µÄ´óÃÅ£¡
¹Ø¼ü×Ö£ºJava ME ÊÖ»ú ÃÜÂë ¹ÜÀí ¼Ç¼´æ´¢
......

java¶ÔFile»ù±¾²Ù×÷

 package com.chinacache.utils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
public class FileUtils {
private static final Logger logger = Logger.getLogger(FileUtils.class);
/**
* ÒÆ¶¯Îļþµ½Ö¸¶¨Ä¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ