About Java Virtual Machine

The compilation mechanism in java

        Unlike C and C++,java compiles the source text into binary code separately not a single executable application, which also determines the method java stores the references of other objects and links them when needs.Besides, the class binary code are coded with UTF-8, which is notable for all character support and compatible with ASCII for mainly the binary class consists of.

        In the binary class, there are seven parts such as method area, class info area whcih describle all the information of the class itself and its references. In memory, there is only one copy of each class and its method, but there can exist several copy of data.The data and program are stored separately in memory.The string quoted with double quotes is actually a constant which is different from the string generated from the String() class.The latter is an instance object while the former has only one copy in memory.

 

The xsd(xml schema definition)

        Both dtd(document type definition) and xsd are used to constrain the xml content. Every xml file can only has one dtd while has several schemas.And there are more datatypes in schema than dtd.

 

<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
            http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
            http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

 

  1.  the default namespace is http://www.springframework.org/schema/beans,so the elements within that namespace are used without prefix in the xml file.
  2.  xmlns:xsi , i think, is removeable.
  3. the schema location are listed with namespace and xsd file location.

java.io

       There are two kinds streams in java,one is byte stream, the other is character stream.

  1. InputStream and OutputStream are abstact classes.
  2. ObjectInputStream and ObjectOutputStream are used to persist the object in memory.
  3. DataInputStream and DataOutputStream are used to read and write data types such as int,long,double.
  4. BufferedInputStream and BufferedOutputStream are second level stream which need InputStream and OutputStream as contrcut argument.

TreeSet and Comparator

      TreeSet is class to add element in sorted way.The sort direction and method are implements in the Comparator.

你可能感兴趣的:(java,spring,AOP,c,xml)