ÓÃJavaÁгöµ±Ç°ÏµÍ³´òÓ¡»úÇåµ¥
import javax.print.DocFlavor;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttributeSet;
import javax.print.attribute.standard.PrinterName;
public class Main {
static public void main(String args[]) throws Exception {
PrintService pss[] = PrintServiceLookup.lookupPrintServices(null, null);
for (int i = 0; i < pss.length; ++i) {
System.out.println(pss[i]);
PrintService ps = pss[i];
PrintServiceAttributeSet psas = ps.getAttributes();
Attribute attributes[] = psas.toArray();
for (int j = 0; j < attributes.length; ++j) {
Attribute attribute = attributes[j];
System.out.println(" attribute: " + attribute.getName());
if (attribute instanceof PrinterName) {
System.out.println(" printer name: " + ((PrinterName) attribute).getValue());
}
}
DocFlavor supportedFlavors[] = ps.getSupportedDocFlavors();
for (int j = 0; j < supportedFlavors.length; ++j) {
&nbs
Ïà¹ØÎĵµ£º
tomcatÆô¶¯web·þÎñµÄʱºò×ÜÊÇ»áÓÐ8СʱµÄʱ²î,
×ÁÄ¥Á˺þÃ,×î¼òµ¥µÄ°ì·¨¾ÍÊÇ
ÕÒµ½Îļþ¼Ðjdk1.6.0_07\jre\lib\zi\Etc
ÕâÀï±ß¶¼ÊÇÒ»Ð©Ê±ÇøÎļþGTM+1,GTM+2,GTM+3....
±¸·ÝÒ»·ÝEtc
¿½±´N·ÝGTM+8Îļþ(ÖйúµÄÊ±ÇøÊÇGTM+8)
°ÑGMT+8ÎļþÃû¸Ä³ÉGTM+1,GTM+2,GTM+3....
¸²¸ÇµôÔÀ´µÄEtcÀï±ßµÄÎļþ
ÖØÆôtomcatÎÊÌâ½â¾ö ......
¶ÔÓÚѧϰstaticÎÒÃÇÏÈÀ´¿´Á½¸öÀý×Ó£º
//Example 1 Tst.java£¬no main() method
package com.blogchina.qb2049;
public class Tst
{
static { System.out.println("111111"); }
}
ÔËÐнá¹ûΪ: 111111
Exception in thread "main" java.lang.NoSuchMethodError: main
ͬÑùµÄµÀÀí¿´µÚ¶þ ......
ÕâÊÇÒ»¸öÓÃJAVA W3C DOM ½øÐÐXML²Ù×÷µÄÀý×Ó£¬°üº¬Á˲éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý¡¢±£´æµÄ»ù±¾²Ù×÷¡£½ÏÍêÕûµÄÃèÊöÁËÒ»¸öXMLµÄÕû¸ö²Ù×÷Á÷³Ì¡£ÊʺϸÕÈëÃÅJAVA XML²Ù×÷µÄÅóÓѲο¼ºÍѧϰ¡£
¼ÙÉèÓÐXMLÎļþ£ºtest1.xml
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
< ......
1 ÍøÂçͨÐŵı¾ÖÊÊǽø³Ì¼äͨÐÅ¡£
2 TcpÐÒéºÍUDPÐÒé
TCP£º¿ªÏú´ó£¬ÓÃÓÚ¿É¿¿ÐÔÒªÇó¸ßµÄ³¡ºÏ¡£
TCPµÄ¹ý³ÌÏ൱ÓÚ´òµç»°µÄ¹ý³Ì
UDP£ºÓÃÔÚ¶ÔʵʱÐÔÒªÇó±È½Ï¸ßµÄ³¡ºÏ¡£
UDPµÄ¹ý³ÌÏ൱ÓÚдÐŵĹý³Ì¡£
×¢Ò⣺socketÊÇÌ×½Ó×Ö£¬ipºÍport£¨¶Ë¿ÚºÅ 0~65535¸ö¶Ë¿Ú£¬Ò»¸ö¶Ë¿ÚÖ»ÄÜÓÐÒ»¸ö½ø³Ì£©
3£¬   ......
Ê×ÏÈһЩ±»³õʼ»¯¶ÔÏóµÄ¸ÅÄ
Àà±äÁ¿£¨Àྲ̬³ÉÔ±£©£º Àà±»¼ÓÔØÊ±²úÉú£»ËüµÄÉú´æÆÚÊÇÀàµÄÉú´æÆÚ£»×Ô¶¯³õʼ»¯£¨Àà±»¼ÓÔØ£©
³ÉÔ±±äÁ¿£¨Àà³ÉÔ±£©£º ÔÚʹÓÃnew´´½¨¸ÃÀàʵÀýʱ²úÉú£»ËüµÄÉú´æÆÚÓë¸ÃÀàʵÀý¶ÔÏóµÄÉú´æÆÚÏàͬ£»
×Ô¶¯³õʼ»¯£¨¹¹Ôì·½·¨±»µ÷Óã©
¾Ö²¿±äÁ¿£¨ÀàµÄ·½·¨ÖеıäÁ¿£©£º ¸Ã·½·¨±»µ÷ÓÃÊ ......