javaÊý¾Ý½á¹¹Ö®¶ÑÕ»
½¨Á¢½ÚµãÀà(Node.java)
package com.yz.mystack;
public class Node {
Object data;
Node next;
public Node(Object data){
this.data=data;
next=null;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public Node getNext() {
return next;
}
public void setNext(Node next) {
this.next = next;
}
}
½¨Á¢Á´±í(Link.java)
package com.yz.mystack;
public class Link {
Node head;
public Link(){
head=new Node(null);
}
public void addNode(Node node){
Node p=head;
node.setNext(p.getNext());
p.setNext(node);
}
public void delNode(){
if(!isEmploy()){
head.setNext(head.getNext().getNext());
}
}
public Node gettop(){
return head.getNext();
}
public Boolean isEmploy(){
return head.getNext()==null;
}
public void display(){
Node p=head;
while(true){
p=p.getNext();
if(p!=null){
System.out.println(p.getData());
}else{
break;
}
}
}
}
½¨Á¢¶ÑÕ»
package com.yz.mystack;
public class Stack {
Link link;
public Stack(){
link=new Link();
}
public void push(Object data){
link.addNode(new Node(data));
}
public Object peek(){
return link.gettop().getData();
}
public Object pop(){
Object data=peek();
link.delNode();
return data;
}
}
²âÊÔ(Man.java)
package com.yz.mystack;
public class Man {
public static void main(String[] args){
Stack stack=new Stack();
stack.push("aa");
stack.push("bb");
stack.push("cc");
System.out.println(stack.peek());
System.out.println(stack.peek());
System.out.println(stack.peek());
System.out.println(stack.pop());
System.out.println(stack.pop());
}
}
Ïà¹ØÎĵµ£º
ʲôÊÇÁ÷£º
Á÷ÊÇÒ»¸ö³éÏóµÄ¸ÅÄî¡£µ±Java³ÌÐòÐèÒª´ÓÊý¾ÝÔ´¶ÁÈ¡Êý¾Ýʱ£¬»á¿ªÆôÒ»¸öµ½Êý¾ÝÔ´µÄÁ÷¡£Êý¾ÝÔ´¿ÉÒÔÊÇÎļþ£¬ÄÚ´æ»òÕßÍøÂçµÈ¡£Í¬Ñù£¬µ±³ÌÐòÐèÒªÊä³öÊý¾Ýµ½Ä¿µÄµØʱҲһÑù»á¿ªÆôÒ»¸öÁ÷£¬Êý¾ÝÄ¿µÄµØÒ²¿ÉÒÔÊÇÎļþ¡¢ÄÚ´æ»òÕßÍøÂçµÈ¡£Á÷µÄ´´½¨ÊÇΪÁ˸ü·½±ãµØ´¦ÀíÊý¾ÝµÄÊäÈëÊä³ö¡£
Á÷·ÖΪ×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷¡£×Ö½ÚÁ÷Ò²³ÆΪÔÊ ......
À¬»øÊÕ¼¯¼¸ºõÊÇÿ¸ö¿ª·¢ÈËÔ±¶¼Ï²°®µÄÒ»¸ö Java™ ƽ̨ÌØÐÔ£¬Ëü¼ò»¯ÁË¿ª·¢£¬Ïû³ýÁËËùÓÐÖÖÀàµÄDZÔÚ´úÂë´íÎ󡣿ɾ¡¹ÜÀ¬»øÊÕ¼¯Ò»°ãÀ´Ëµ¿ÉÒÔÈÃÄúÎÞÐè½øÐÐ×ÊÔ´¹ÜÀí£¬ÓÐʱºòÄú»¹ÊDZØÐë×Ô¼º½øÐÐһЩÄÚÎñ´¦Àí¡£
ÏÔʽµØÊÍ·Å×ÊÔ´
Java ³ÌÐòÖÐʹÓõľø´ó¶àÊý×ÊÔ´¶¼ÊǶÔÏó£¬À¬»øÊÕ¼¯ÔÚÇåÀí¶ÔÏó·½Ãæ×öµÃºÜºÃ¡£Òò´Ë£¬Äú¿ÉÒÔʹÓÃÈÎ ......
ʹÓà ANT ¿ª·¢ Java ³ÌÐò
³£Ìý´ó¼ÒÌÖÂÛÄĸö Java ¿ª·¢¹¤¾ß±È½ÏºÃ£¬JBuilder£¬Virtual Cafe ?
½ñÌì½éÉÜÒ»¸ö¼òµ¥Ò×ÓÃµÄ Java ¿ª·¢£¬±àÒ룬¼¯³É£¬²âÊÔ¹¤¾ß£ºJakarta Ant
Ëû±»³ÆΪ java »·¾³ÀïµÄ make (make ÔÚ C ³ÌÐò¿ª·¢ ......
doGet()ºÍdoPost()
JspÒ³ÃæµÄform±êÇ©ÀïµÄmethodÊôÐÔΪgetʱµ÷ÓÃdoget(0,
Ϊpostʱµ÷ÓÃdoPost()
Jsp
JspÒýÇæ(Tomcat)ÏȽ«jspÎļþת»»Îªservlet£¬È»ºóµ÷ÓÃJava±àÒëÆ÷javac.exe¶Ô
......
ÁùÖÖÒì³£´¦ÀíµÄªϰ
Äã¾õµÃ×Ô¼ºÊÇÒ»¸öJavaר¼ÒÂð£¿ÊÇ·ñ¿Ï¶¨×Ô¼ºÒѾȫÃæÕÆÎÕÁËJavaµÄÒì³£´¦Àí»úÖÆ£¿ÔÚÏÂÃæÕâ¶Î´úÂëÖУ¬ÄãÄܹ»Ñ¸ËÙÕÒ³öÒì³£´¦ÀíµÄÁù¸öÎÊÌâÂð£¿
Java´úÂë
OutputStreamWriter out = ...
java.sql.Connection conn =& ......