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

javaÖÐthis¹Ø¼ü×ÖÓ÷¨

 /**
* this¹Ø¼ü×ÖÓ÷¨
*/
public class Flower {

int petalCount = 0;
String s = "initial value";

Flower(int petals){
petalCount = petals;
System.out.println("Constructor with one int arg");
}

Flower(String ss){
System.out.println("Constructor with one string arg");
s = ss;
}

Flower(String ss, int petals){
this(petals);
this.s = ss;
System.out.println("Constructor with string and int args");
}

Flower(){
this("hi",47);
System.out.println("Default Constructor with no args");
}

void printPetalCount(){
System.out.println("petalCount = "+petalCount+"; s = "+s);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Flower x = new Flower();
x.printPetalCount();
}



Ïà¹ØÎĵµ£º

Java ½âѹrarÎļþµÄ¾­µäʵÀý

2009-11-11  18:06:09
/**
*
* @author Ice*
*/
public class RarUtil{
public static void main(String args[]) throws Exception {

String compress = "D:\\test.rar";// rarѹËõÎļþ
String decompression = "D:\\";// ½âѹ·¾¶
unZip(compress, decompression);

}
/** ......

java exception javaÒì³£»ã×Ü(1)

 java exception ½â¾ö·½°¸ - ÎÒµÄÒì³£Íø|Òì³£|exception 730 - org.hibernate.LazyInitializationException:could not initialize proxy 731 - ¾¯¸æ: Error setting value 732 - override and commit 733 - Building workspace has encountered a problem. Errors during build 734 - Could not open the editor: An ......

Java Proxy¶¯Ì¬´úÀí

ÏÈ¿´¸öÀý×Ó£º
½Ó¿Ú
package example;
 
public interface Basic {
    public void hello();
}
 
½Ó¿ÚµÄʵÏÖÀà
package example;
 
public class BasicService implements Basic {
    public void hello() {
        Sysyt ......

CONSTµÄÏà¹Ø¼¸¸öÎÊÌâ½â´ð£¨cÓëc++£¬java£©

Ò»¡¢
 ÏÈ¿´Ò»¸ö³ÌÐò
#include <stdio.h>
int main()
{
const int a = 5;
int b[a];
return 0;
}
ÔÚvc6.0ÖÐÃüÃûΪ.cÎļþ£¬±àÒë»á³ö´í£¬ÊÇint b[a]ÕâÒ»ÐУºexpected constant expression
        ÃüÃûΪ.cppÎļþ£¬Ã»ÎÊÌâ¡£
ÔÚcodeblocks(Ò»¸öÃâ·Ñ¿ªÔ´µÄ±àÒëÆ÷)ÖбàÒ붼à ......

javaÖеÄforeachÓ÷¨

 import java.util.*;
public class ForeachExample {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Random r = new Random();
int[] x = new int[10];
for (int i = 0; i < x.length; i++) {
x[i] = r.nextInt(100);
}
/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ