??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美熟妇另类久久久久久不卡,久久久久亚洲av成人无码电影,亚洲精品综合久久http://www.shnenglu.com/deercoder/category/12460.html<P><FONT style="FONT-SIZE: 20px" color=#ff0000>U篏Q坚持!</FONT></P> <P><FONT style="FONT-SIZE: 20px" color=#ff0000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------我是一只IT小?lt;/FONT></P>zh-cnWed, 05 Oct 2011 20:00:42 GMTWed, 05 Oct 2011 20:00:42 GMT60Java多维数组详解[转蝲]http://www.shnenglu.com/deercoder/articles/103591.html刘畅刘畅Sun, 20 Dec 2009 13:53:00 GMThttp://www.shnenglu.com/deercoder/articles/103591.htmlhttp://www.shnenglu.com/deercoder/comments/103591.htmlhttp://www.shnenglu.com/deercoder/articles/103591.html#Feedback0http://www.shnenglu.com/deercoder/comments/commentRss/103591.htmlhttp://www.shnenglu.com/deercoder/services/trackbacks/103591.htmljava语言中,数组是一U最单的复合数据cd。数l是有序数据的集合,数组中的每个元素h相同的数据类型,可以用一个统一的数l名和下标来唯一地确定数l中的元素。数l有一l数l和多维数组?
?一l数l?
      1Q?一l数l的定义

  type arrayName[ ]Q?
  cd(type)可以为Java中Q意的数据cdQ包括简单类型和复合cd?
  例如Q?
   int intArray[ ]Q?
   Date dateArray[];


  2Q一l数l的初始?

  ??rn)态初始化
    int intArray[]={1,2,3,4};
    String stringArray[]={"abc", "How", "you"};

  ?动态初始化
    1Q简单类型的数组
    int intArray[];
    intArray = new int[5];

   2Q复合类型的数组
    String stringArray[ ];
    String stringArray = new String[3];/*为数l中每个元素开辟引?
                      I间(32? */
    stringArray[0]= new String("How");//为第一个数l元素开辟空?
    stringArray[1]= new String("are");//为第二个数组元素开辟空?
    stringArray[2]= new String("you");// 为第三个数组元素开辟空?

  3Q一l数l元素的引用

  数组元素的引用方式ؓ(f)Q?
     arrayName[index]

  index为数l下标,它可以ؓ(f)整型常数或表辑ּQ下标从0开始。每个数l都有一个属性length指明它的长度Q例如:(x)intArray.length指明数组intArray的长度?

★多l数l?

  Java语言中,多维数组被看作数l的数组?

  1Q二l数l的定义

  type arrayName[ ][ ]Q?
  type [ ][ ]arrayName;

  2Q二l数l的初始?

  ??rn)态初始化
  int intArray[ ][ ]={{1,2},{2,3},{3,4,5}};

  Java语言中,׃把二l数l看作是数组的数l,数组I间不是q箋(hu)分配的,所以不要求二维数组每一l的大小相同?

  ?动态初始化
  1) 直接为每一l分配空_(d)格式如下Q?
  arrayName = new type[arrayLength1][arrayLength2];
  int a[ ][ ] = new int[2][3]Q?

  2) 从最高维开始,分别为每一l分配空_(d)(x)
  arrayName = new type[arrayLength1][ ];
  arrayName[0] = new type[arrayLength20];
  arrayName[1] = new type[arrayLength21];
  …
  arrayName[arrayLength1-1] = new type[arrayLength2n];

  3) 例:(x)
  二维单数据类型数l的动态初始化如下,
  int a[ ][ ] = new int[2][ ]Q?
  a[0] = new int[3];
  a[1] = new int[5];

  对二l复合数据类型的数组Q必首先ؓ(f)最高维分配引用I间Q然后再次Zl分配空间?
  而且Q必Mؓ(f)每个数组元素单独分配I间?

  例如Q?
  String s[ ][ ] = new String[2][ ];
  s[0]= new String[2];//为最高维分配引用I间
  s[1]= new String[2]; //为最高维分配引用I间
  s[0][0]= new String("Good");// 为每个数l元素单独分配空?
  s[0][1]= new String("Luck");// 为每个数l元素单独分配空?
  s[1][0]= new String("to");// 为每个数l元素单独分配空?
  s[1][1]= new String("You");// 为每个数l元素单独分配空?

  3Q二l数l元素的引用
  
  对二l数l中的每个元素,引用方式为:(x)arrayName[index1][index2]
  例如Q?num[1][0]; 
   4Q二l数lD例:(x)

  【例2Q?】两个矩늛?
  public class MatrixMultiply{
   public static void main(String args[]){
   int i,j,k;
   int a[][]=new int [2][3]; //动态初始化一个二l数l?
   int b[][]={{1,5,2,8},{5,9,10,-3},{2,7,-5,-18}};//?rn)态初始化
                           一个二l数l?
   int c[][]=new int[2][4]; //动态初始化一个二l数l?
   for (i=0;i<2;i++)
     for (j=0; j<3 ;j++)
      a[i][j]=(i+1)*(j+2);
   for (i=0;i<2;i++){
     for (j=0;j<4;j++){
      c[i][j]=0;
   for(k=0;k<3;k++)
     c[i][j]+=a[i][k]*b[k][j];
      }
     }
   System.out.println("*******Matrix C********");//打印Matrix C标记
   for(i=0;i<2;i++){
     for (j=0;j<4;j++)
      System.out.println(c[i][j]+" ");
     System.out.println();
      }
     }
   }

  2Q? 字符串的处理

?字符串的表示

  Java语言中,把字W串作ؓ(f)对象来处理,cString和StringBuffer都可以用来表CZ个字W串?cd都是大写字母打头)

  1Q字W串帔R

  字符串常量是用双引号括住的一串字W?
    "Hello World!"

  2QString表示字符串常?

  用String表示字符Ԍ(x)
  String( char chars[ ] );
  String( char chars[ ], int startIndex, int numChars );
  String( byte ascii[ ], int hiByte );
  String( byte ascii[ ], int hiByte, int startIndex, int numChars );
  String使用CZQ?
  String s=new String() ; 生成一个空?

  下面用不同方法生成字W串"abc"Q?
  char chars1[]={''a'',''b'',''c''};
  char chars2[]={''a'',''b'',''c'',''d'',''e''};
  String s1=new String(chars1);
  String s2=new String(chars2,0,3);
  byte ascii1[]={97,98,99};
  byte ascii2[]={97,98,99,100,101};
  String s3=new String(ascii1,0);
  String s4=new String(ascii2,0,0,3);
3Q用StringBuffer表示字符?

  StringBuffer( ); /*分配16个字W的~冲?/
  StringBuffer( int len ); /*分配len个字W的~冲?/
  StringBuffer( String s ); /*除了(jin)按照s的大分配空间外,再分?6?
               字符的缓冲区*/

★访问字W串

   1Q类String中提供了(jin)length( )、charAt( )、indexOf( )、lastIndexOf( )、getChars( )、getBytes( )、toCharArray( ){方法?

  ?public int length() 此方法返回字W串的字W个?
  ?public char charAt(int index) 此方法返回字W串中index位置上的字符Q其中index 值的 范围?~length-1
  ?public int indexOf(int ch)
    public lastIndexOf(in ch)
  
  q回字符ch在字W串中出现的W一个和最后一个的位置
  ?public int indexOf(String str)
    public int lastIndexOf(String str)
  q回子串str中第一个字W在字符串中出现的第一个和最后一个的位置
  ?public int indexOf(int ch,int fromIndex)
    public lastIndexOf(in ch ,int fromIndex)
  q回字符ch在字W串中位|fromIndex以后出现的第一个和最后一个的位置
  ?public int indexOf(String str,int fromIndex)
    public int lastIndexOf(String str,int fromIndex)
  q回子串str中的W一个字W在字符串中位置fromIndex后出现的W一个和最后一个的位置?
  ?public void getchars(int srcbegin,int end ,char buf[],int dstbegin)
   srcbegin 提取的第一个字W在源串中的位置Q?end提取的最后一个字W在源串中的位置Q字W数lbuf[]存放目的字符Ԍ    dstbegin 为提取的字符串在目的串中的v始位|?
  ◇public void getBytes(int srcBegin, int srcEnd,byte[] dst, int dstBegin)
  参数?qing)用法同上,只是串中的字W均?位表C?

  2Q类StringBuffer提供?length( )、charAt( )、getChars( )、capacity(){方法?

  Ҏ(gu)capacity()用来得到字符串缓冲区的容量,它与Ҏ(gu)length()所q回的值通常是不同的?
 
★修改字W串
修改字符串的目的是ؓ(f)?jin)得到新的字W串Q类String和类StringBuffer都提供了(jin)相应的方法。有兛_个方法的使用Q参考java 2 API?

  1QStringcL供的Ҏ(gu)Q?

   concat( )
   replace( )
   substring( )
   toLowerCase( )
   toUpperCase( )

  ?public String contat(String str);
  用来当前字W串对象与给定字W串strq接h?
  ?public String replace(char oldChar,char newChar);
  用来把串中出现的所有特定字W替换成指定字符以生成新丌Ӏ?
  ?public String substring(int beginIndex)Q?
  public String substring(int beginIndex,int endIndex);
  用来得到字符串中指定范围内的子串?
  ?public String toLowerCase();
  把串中所有的字符变成写?
  ?public String toUpperCase();
  把串中所有的字符变成大写?

  2QStringBuffercL供的Ҏ(gu)Q?

  append( )
  insert( )
  setCharAt( )

  如果操作后的字符出已分配的~冲?则系l会(x)自动为它分配额外的空间?
  ?public synchronized StringBuffer append(String str);
  用来在已有字W串末尾d一个字W串str?
  ?public synchronized StringBuffer insert(int offset, String str);
  用来在字W串的烦(ch)引offset位置处插入字W串str?
  ?public synchronized void setCharAt(int index,char ch);
  用来讄指定索引index位置的字W倹{?

  注意QString中对字符串的操作不是Ҏ(gu)操作串对象本w进行的Q而是Ҏ(gu)生成的一个源操作串对象的拯q行的,其操作的l果不媄(jing)响源丌Ӏ?

  相反QStringBuffer中对字符串的q接操作是对源串本nq行的,操作之后源串的值发生了(jin)变化Q变成连接后的串?

?其它操作

   1Q字W串的比?

  String中提供的Ҏ(gu)Q?
  equals( )和equalsIgnoreCase( )
  它们与运符''= =''实现的比较是不同的。运符''= =''比较两个对象是否引用同一个实例,而equals( )和equalsIgnoreCase( )则比较  两个字符串中对应的每个字W值是否相同?

  2Q字W串的{?

  java.lang.Object中提供了(jin)Ҏ(gu)toString( )把对象{化ؓ(f)字符丌Ӏ?

  3Q字W串"+"操作

  q算W?'+''可用来实现字W串的连接:(x)
  String s = "He is "+age+" years old.";
  其他cd的数据与字符串进?+"q算Ӟ自动{换成字符丌Ӏ具体过E如下:(x)
  String s=new StringBuffer("he is").append(age).append("years old").toString();

  注意Q除?jin)对q算W?+"q行?jin)重载外Qjava不支持其它运符的重载?nbsp;  

文章出处QDIY部落(http://www.diybl.com/course/3_program/java/javajs/200847/108479_2.html)

文章出处QDIY部落(http://www.diybl.com/course/3_program/java/javajs/200847/108479.html)



刘畅 2009-12-20 21:53 发表评论
]]>
发Java手写代码?/title><link>http://www.shnenglu.com/deercoder/articles/103585.html</link><dc:creator>刘畅</dc:creator><author>刘畅</author><pubDate>Sun, 20 Dec 2009 13:16:00 GMT</pubDate><guid>http://www.shnenglu.com/deercoder/articles/103585.html</guid><wfw:comment>http://www.shnenglu.com/deercoder/comments/103585.html</wfw:comment><comments>http://www.shnenglu.com/deercoder/articles/103585.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/deercoder/comments/commentRss/103585.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/deercoder/services/trackbacks/103585.html</trackback:ping><description><![CDATA[<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img id=Codehighlighter1_22_240_Open_Image onclick="this.style.display='none'; Codehighlighter1_22_240_Open_Text.style.display='none'; Codehighlighter1_22_240_Closed_Image.style.display='inline'; Codehighlighter1_22_240_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_22_240_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_22_240_Closed_Text.style.display='none'; Codehighlighter1_22_240_Open_Image.style.display='inline'; Codehighlighter1_22_240_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> ArrayDemo</span><span id=Codehighlighter1_22_240_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_22_240_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #000000"><img id=Codehighlighter1_63_238_Open_Image onclick="this.style.display='none'; Codehighlighter1_63_238_Open_Text.style.display='none'; Codehighlighter1_63_238_Closed_Image.style.display='inline'; Codehighlighter1_63_238_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_63_238_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_63_238_Closed_Text.style.display='none'; Codehighlighter1_63_238_Open_Image.style.display='inline'; Codehighlighter1_63_238_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main(String[] args)</span><span id=Codehighlighter1_63_238_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_63_238_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">[] anArray; anArray </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">];<br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img id=Codehighlighter1_147_211_Open_Image onclick="this.style.display='none'; Codehighlighter1_147_211_Open_Text.style.display='none'; Codehighlighter1_147_211_Closed_Image.style.display='inline'; Codehighlighter1_147_211_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_147_211_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_147_211_Closed_Text.style.display='none'; Codehighlighter1_147_211_Open_Image.style.display='inline'; Codehighlighter1_147_211_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> anArray.length; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)</span><span id=Codehighlighter1_147_211_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_147_211_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            anArray[i] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> i;<br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            System.out.println(anArray[i] </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println();<br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img id=Codehighlighter1_33_232_Open_Image onclick="this.style.display='none'; Codehighlighter1_33_232_Open_Text.style.display='none'; Codehighlighter1_33_232_Closed_Image.style.display='inline'; Codehighlighter1_33_232_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_33_232_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_33_232_Closed_Text.style.display='none'; Codehighlighter1_33_232_Open_Image.style.display='inline'; Codehighlighter1_33_232_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> ArrayOfIntergersDemo</span><span id=Codehighlighter1_33_232_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_33_232_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #000000"><img id=Codehighlighter1_74_230_Open_Image onclick="this.style.display='none'; Codehighlighter1_74_230_Open_Text.style.display='none'; Codehighlighter1_74_230_Closed_Image.style.display='inline'; Codehighlighter1_74_230_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_74_230_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_74_230_Closed_Text.style.display='none'; Codehighlighter1_74_230_Open_Image.style.display='inline'; Codehighlighter1_74_230_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main(String[] args)</span><span id=Codehighlighter1_74_230_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_74_230_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        Integer[] anArray </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Integer[</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">];<br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img id=Codehighlighter1_156_227_Open_Image onclick="this.style.display='none'; Codehighlighter1_156_227_Open_Text.style.display='none'; Codehighlighter1_156_227_Closed_Image.style.display='inline'; Codehighlighter1_156_227_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_156_227_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_156_227_Closed_Text.style.display='none'; Codehighlighter1_156_227_Open_Image.style.display='inline'; Codehighlighter1_156_227_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> anArray.length; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)</span><span id=Codehighlighter1_156_227_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_156_227_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            anArray[i] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Integer(i);<br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            System.out.println(anArray[i]);<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img id=Codehighlighter1_30_251_Open_Image onclick="this.style.display='none'; Codehighlighter1_30_251_Open_Text.style.display='none'; Codehighlighter1_30_251_Closed_Image.style.display='inline'; Codehighlighter1_30_251_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_30_251_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_30_251_Closed_Text.style.display='none'; Codehighlighter1_30_251_Open_Image.style.display='inline'; Codehighlighter1_30_251_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> ArrayOfStringDemo</span><span id=Codehighlighter1_30_251_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_30_251_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #000000"><img id=Codehighlighter1_71_249_Open_Image onclick="this.style.display='none'; Codehighlighter1_71_249_Open_Text.style.display='none'; Codehighlighter1_71_249_Closed_Image.style.display='inline'; Codehighlighter1_71_249_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_71_249_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_71_249_Closed_Text.style.display='none'; Codehighlighter1_71_249_Open_Image.style.display='inline'; Codehighlighter1_71_249_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main(String[] args)</span><span id=Codehighlighter1_71_249_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_71_249_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img id=Codehighlighter1_94_148_Open_Image onclick="this.style.display='none'; Codehighlighter1_94_148_Open_Text.style.display='none'; Codehighlighter1_94_148_Closed_Image.style.display='inline'; Codehighlighter1_94_148_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_94_148_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_94_148_Closed_Text.style.display='none'; Codehighlighter1_94_148_Open_Image.style.display='inline'; Codehighlighter1_94_148_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        String[] anArray </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span id=Codehighlighter1_94_148_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_94_148_Open_Text><span style="COLOR: #000000">{ </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">String One</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,<br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">String Two</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,<br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">String Threee</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img id=Codehighlighter1_193_246_Open_Image onclick="this.style.display='none'; Codehighlighter1_193_246_Open_Text.style.display='none'; Codehighlighter1_193_246_Closed_Image.style.display='inline'; Codehighlighter1_193_246_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_193_246_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_193_246_Closed_Text.style.display='none'; Codehighlighter1_193_246_Open_Image.style.display='inline'; Codehighlighter1_193_246_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> anArray.length; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)</span><span id=Codehighlighter1_193_246_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_193_246_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            System.out.println(anArray[i].toLowerCase());<br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> java.lang.Math;<br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img id=Codehighlighter1_40_417_Open_Image onclick="this.style.display='none'; Codehighlighter1_40_417_Open_Text.style.display='none'; Codehighlighter1_40_417_Closed_Image.style.display='inline'; Codehighlighter1_40_417_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_40_417_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_40_417_Closed_Text.style.display='none'; Codehighlighter1_40_417_Open_Image.style.display='inline'; Codehighlighter1_40_417_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> exp</span><span id=Codehighlighter1_40_417_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_40_417_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img id=Codehighlighter1_81_415_Open_Image onclick="this.style.display='none'; Codehighlighter1_81_415_Open_Text.style.display='none'; Codehighlighter1_81_415_Closed_Image.style.display='inline'; Codehighlighter1_81_415_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_81_415_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_81_415_Closed_Text.style.display='none'; Codehighlighter1_81_415_Open_Image.style.display='inline'; Codehighlighter1_81_415_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main(String[] args)</span><span id=Codehighlighter1_81_415_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_81_415_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> x </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">11.635</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> y </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">2.76</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the value of e is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> Math.E);<br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">exp(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> x </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">) is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> Math.exp(x));<br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">log(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">x</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">) is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> Math.log(x));<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">pow(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">x</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">y</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">) is</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> Math.pow(x,y));<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">sqrt(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">x</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">) is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> Math.sqrt(x));<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img id=Codehighlighter1_17_581_Open_Image onclick="this.style.display='none'; Codehighlighter1_17_581_Open_Text.style.display='none'; Codehighlighter1_17_581_Closed_Image.style.display='inline'; Codehighlighter1_17_581_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_17_581_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_17_581_Closed_Text.style.display='none'; Codehighlighter1_17_581_Open_Image.style.display='inline'; Codehighlighter1_17_581_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Trig</span><span id=Codehighlighter1_17_581_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_17_581_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #000000"><img id=Codehighlighter1_58_579_Open_Image onclick="this.style.display='none'; Codehighlighter1_58_579_Open_Text.style.display='none'; Codehighlighter1_58_579_Closed_Image.style.display='inline'; Codehighlighter1_58_579_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_58_579_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_58_579_Closed_Text.style.display='none'; Codehighlighter1_58_579_Open_Image.style.display='inline'; Codehighlighter1_58_579_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main(String[] args)</span><span id=Codehighlighter1_58_579_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_58_579_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> degree </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">45.0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> redians </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> Math.toDegrees(degree);<br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the value of pi is</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> Math.PI);<br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the sin of</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> degree </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">Math.sin(degree));<br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the cos of </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> degree </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">Math.cos(degree));<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the tan of </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> degree </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">Math.tan(degree));<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the arc tan of </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> redians </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">Math.atan(redians));<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the arc sin of </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> redians </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> is </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">Math.asin(redians));<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <br><br>发点思考:(x)<br>1Q按照书上面一个个敲代码是很有好处的。手写代码也是不错的。原始的Ҏ(gu)或许更加有效果!<br>2.java的几点,从这个上面看来?Qjava中,一个数l,可以是对象数l,是说它的内Ҏ(gu)一个对象,q样的,它的创徏不仅要newQ其中的内容也要newQ否则没有创建对象哪里来的那些内容呢Q?br>像是内|类型一P那些new处理的当然也是数l,所以是Integer[5]来表C数l?br>而要是赋值或者初始化的话Q就是用的括P表示调用构造函敎ͼ因ؓ(f)cd构造函数是同名的。这ơ就完成?jin)上面的内容。? <img src ="http://www.shnenglu.com/deercoder/aggbug/103585.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/deercoder/" target="_blank">刘畅</a> 2009-12-20 21:16 <a href="http://www.shnenglu.com/deercoder/articles/103585.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java中一个很单的输出昄http://www.shnenglu.com/deercoder/articles/103579.html刘畅刘畅Sun, 20 Dec 2009 12:32:00 GMThttp://www.shnenglu.com/deercoder/articles/103579.htmlhttp://www.shnenglu.com/deercoder/comments/103579.htmlhttp://www.shnenglu.com/deercoder/articles/103579.html#Feedback0http://www.shnenglu.com/deercoder/comments/commentRss/103579.htmlhttp://www.shnenglu.com/deercoder/services/trackbacks/103579.html敲代码有时候还是有好处的,看看下面的这个代码,我才发现直接OUT?jin)?br>exp.java

import java.lang.Math;

public class exp{
 public static void main(String[] args){
  double x = 11.635;
  double y = 2.76;
  System.out.println("the value of e is " + Math.E);
  System.out.println("exp(" + x + ") is " + Math.exp(x));
  System.out.println("log(" +x+ ") is " + Math.log(x));

  System.out.println("pow(" +x+ "," +y+ ") is" + Math.pow(x,y));
  System.out.println("sqrt(" +x+ ") is " + Math.sqrt(x));
 }
}


实例代码如下所C:(x)"exp(" + x + ") is "
 此部分如何解释呢Q是因ؓ(f)那些函数的特D显C效果吗Q特定的格式吗?
其实QJava和C++一P都是字符串链接Ş式的输出。所以应该是Q?br>每两个引可接成一对,然后输出Q而没有连接的Q就是要直接输出的,比如变量Q比如字W串对象…………
所以显C的先是QexpQ?Q然后显CxQ这中间用一?q接两个字符Ԍ然后q接上剩下的另外一部分字符Ԍ是) is部分。所以最l显C就是exp(11.635)Q就q样形成?jin)输出的格式。所以就出现?jin)?br>
分析问题Q冷?rn)思考才是王道!
有时候发玎ͼ很多东西都是相同的,不管是C++q是JavaQ?br>

刘畅 2009-12-20 20:32 发表评论
]]>
【{载】NetBeans生成Applet的实例方?/title><link>http://www.shnenglu.com/deercoder/articles/103176.html</link><dc:creator>刘畅</dc:creator><author>刘畅</author><pubDate>Mon, 14 Dec 2009 05:13:00 GMT</pubDate><guid>http://www.shnenglu.com/deercoder/articles/103176.html</guid><wfw:comment>http://www.shnenglu.com/deercoder/comments/103176.html</wfw:comment><comments>http://www.shnenglu.com/deercoder/articles/103176.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/deercoder/comments/commentRss/103176.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/deercoder/services/trackbacks/103176.html</trackback:ping><description><![CDATA[<p>    JCreator可谓是个实在轻量U的IDE?jin),但是向我昨天写的那,用它写applet非常Ҏ(gu)Q目录层ơ没有用其他开发工具那么复杂(相比而言Q?/p> <p>         Java Studio ?NetBeans IDE如出一辙,原本 Java Studio 也是?NetBeans 的基上开发的Q所以,怺(jin)StudioQ开始深入学?NetBeans?/p> <p>         下面介绍如何使用 NetBeans ?Applet?/p> <p>         一、创建或导入applet文gQ?/p> <p>    1.      选择“文g”</p> <p><font size="3">&gt;</font>“新徏目”(Ctrl-Shift-N)。在“cd”下选择“常规”?/p> <p><br />    2.      选择以下选项之一Q?br />            如果要创建新?Applet 源文Ӟ请在“目”下选择“Java cd”。单?#8220;下一?#8221;?br />            如果要导?Applet 源文Ӟ请选择“包含现有源的 Java 目”。单?#8220;下一?#8221;。在“源包文g?#8221;文本框中指定文g的位|??/p> <p><br />    3.      ?#8220;目名称”下键?HelloApplet。将“目位置”更改机中的目存储位置?/p> <p>    4.      单击“完成”。如果导入了(jin) Applet 源文Ӟ直接参考下面部分的q行和调试?/p> <p>    二、创建applet源文Ӟ(x)</p> <p>    1.      ?#8220;目”H口中,右键单击 HelloApplet 目节点Q然后选择“新徏文g/文g?#8221;(Ctrl-N)?/p> <p>    2.      ?#8220;cd”下选择“Java c?#8221;。在“文gcd”下选择 \"Applet\"。单?#8220;下一?#8221;?/p> <p>    3.      ?#8220;cd”下键?myApplet。在“?#8221;下键?ncut.zyf.hello?/p> <p>    4.      单击“完成”。IDE ?x)在指定的包中创?Applet 源文件。将在源~辑器中打开 Applet 源文件?/p> <p>    5.      复制q粘贴以下代码来覆盖现有的缺省代码,以定?Applet c:(x)</p> <p>    package ncut.zyf.hello;</p> <p>    import java.applet.Applet;</p> <p>    import java.awt.Graphics;</p> <p> </p> <p>   </p> <p>         public class myApplet extends Applet {<br />             public String s;<br />             public void init() {<br />      s = getParameter(\"s\");<br />      if (s == null)  s = \"nothing\";<br />     }<br />             public void paint(Graphics g) {<br />                 g.drawString(s,100,100);<br />          g.drawString(\"Hello applet!\", 50, 25); [Page]<br />             }<br />         }</p> <p>    三、生成和q行applet源文Ӟ(x)</p> <p>    1.      ?#8220;目”H口中右键单?HelloApplet 目节点Q然后从上下文菜单中选择“生成目”?/p> <p>    2.      在dist文g夹中创徏 HelloApplet.jar 文g?/p> <p>        ?#8220;目”H口中右键单?Applet c节点,然后从上下文菜单中选择“q行文g”。将?build 文g夹中创徏嵌入?Applet 的myApplet.html 启动E序文gQƈ?Applet 查看器中启动该文件?/p> <p>    四、通过修改参数来调试applet源文Ӟ(x)</p> <p>    1.      打开“文g”H口 (Ctrl-2)?/p> <p>    2.      myApplet.html 启动E序文g?build 文g夹复制到 Applet cM于src 文g夹的包中Q在本例中应复制到nuct.zyf.helloQ。请保 myApplet.html 启动E序文g?Applet cd有相同的名称?/p> <p>    3.      现在Ҏ(gu)需要编辑myApplet.html启动E序文g?在生成项目时,myApplet.html启动E序文g从 src 文g夹复制到 build 文g夹中?/p> <p>    五、在 web 应用E序中嵌?appletQ?/p> <p>    1. 创徏 web 目Q?nbsp;   选择“文g”</p> <p><font size="3">&gt;</font>“新徏目”。在“cd”下选择 \"Web\"。在“目”下选择“Web 应用E序”。单?#8220;下一?#8221;?nbsp; ?#8220;目名称”下键?HelloWebApplet。将“目位置”更改机中的L文g夏V?单击“完成”?/p> <p>    2. applet JAR 文gd到项目中Q如果要?Web 目中包?Applet JAR 文gQ可以通过d包含 JAR 文g?NetBeans IDE 4.1 Java 目Q或者通过d JAR 文g自n来执行此操作。在 NetBeans IDE 4.1 Java 目中修?Applet Ӟ只要生成 Web 目QIDE 都会(x)生成新的 Applet 版本?.      ?#8220;目”H口中,右键单击 HelloWebApplet 目节点Q然后从上下文菜单中选择“属?#8221;?/p> <p><br /><br /></p><img src ="http://www.shnenglu.com/deercoder/aggbug/103176.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/deercoder/" target="_blank">刘畅</a> 2009-12-14 13:13 <a href="http://www.shnenglu.com/deercoder/articles/103176.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JAVA学习(fn)Q一Q?/title><link>http://www.shnenglu.com/deercoder/articles/102577.html</link><dc:creator>刘畅</dc:creator><author>刘畅</author><pubDate>Fri, 04 Dec 2009 15:40:00 GMT</pubDate><guid>http://www.shnenglu.com/deercoder/articles/102577.html</guid><wfw:comment>http://www.shnenglu.com/deercoder/comments/102577.html</wfw:comment><comments>http://www.shnenglu.com/deercoder/articles/102577.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/deercoder/comments/commentRss/102577.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/deercoder/services/trackbacks/102577.html</trackback:ping><description><![CDATA[<p style="TEXT-ALIGN: center; MARGIN: 0cm 0cm 0pt" class=MsoNormal align=center><span style="FONT-SIZE: 22pt" lang=EN-US><font face=Calibri>Java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 22pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">学习(fn)</span><span style="FONT-SIZE: 22pt" lang=EN-US><o:p></o:p></span></p> <p style="TEXT-ALIGN: left; TEXT-INDENT: -36pt; MARGIN: 0cm 0cm 0pt 54pt; mso-char-indent-count: 0; mso-list: l0 level1 lfo2" class=MsoListParagraph align=left><span style="FONT-SIZE: 14pt; mso-bidi-font-family: ?hu)? mso-bidi-theme-font: minor-fareast" lang=EN-US><span style="mso-list: Ignore"><font face=Calibri>一?/font><span style="FONT: 7pt 'Times New Roman'">     </span></span></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">~译器的选择?/span><span style="FONT-SIZE: 14pt" lang=EN-US><o:p></o:p></span></p> <p style="TEXT-ALIGN: left; TEXT-INDENT: 28pt; MARGIN: 0cm 0cm 0pt 21pt; mso-char-indent-count: 2.0; mso-para-margin-left: 2.0gd" class=MsoNormal align=left><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">毋庸|疑Q学?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>Java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">需要一个编译器Q至于是命o(h)行和</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q集成开发环境)(j)则凭用户自n而言Q许多高手喜Ƣ用命o(h)行中敲下命o(h)Q然后用</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>vim</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">来编辑,不可否认Q这样很好,而且如果?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>linux</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">下面的没有图形界面的话,q个gq是唯一的办法,本h现在也正在学?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>linux</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q有时候也有种恨不得一直都?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>vim</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">和命令来工作的冲动,不过弟才疏学浅Q所以常帔R到问题,无奈又{回图形界面的拥抱。不q?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的好处是众所周知的,用户界面的生,实是极大的方便?jin)我们的工作Q虽然掌?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的各U功能需要一定的旉Q不q这个牺牲还是值得的,我认?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的好处就是可以省d多麻?ch),比如今天我遇到的Q多文g?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的编译,?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">中,没有M问题Q因?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>NetBeans</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">中有目理Q其中做到的工作我不知道Q不q如果在命o(h)行中?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>javac</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">命o(h)的话Q就q是有各U奇怪的错误Q各位看到这帖子,如果不吝赐教的话Q不妨留下言Q告诉我如果在命令行下实现多</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文g的编译。我知道?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>Netbeans</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">中,有包的管理,所以在一个包下面Q我写的每一个类Q其实都可以通用Q所以就可以自然的实现各个文件直接调用,像?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>C++</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">中,我声明文件在</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>.h</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文g中,而实现可以放在几?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>.cpp</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文g中,</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">不需要,只需要把q些</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文g攑֜一个包下面Q这样就在其他的</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文g中,只要直接调用可以了(jin)Q而没有相应的ȝ(ch)Q不q这个是</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">中的操纵Q具体的命o(h)行,我觉得多还有些吃力不讨好,何况现在我还是个菜鸟呢!</span><span style="FONT-SIZE: 14pt" lang=EN-US><o:p></o:p></span></p> <p style="TEXT-ALIGN: left; TEXT-INDENT: 28pt; MARGIN: 0cm 0cm 0pt 21pt; mso-char-indent-count: 2.0; mso-para-margin-left: 2.0gd" class=MsoNormal align=left><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">另外Q对于初学者下面这个或许有用?/span><span style="FONT-SIZE: 14pt" lang=EN-US><o:p></o:p></span></p> <p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 18pt; mso-char-indent-count: 0; mso-list: l1 level1 lfo1" class=MsoListParagraph><span style="FONT-SIZE: 14pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin" lang=EN-US><span style="mso-list: Ignore"><font face=Calibri>1.</font><span style="FONT: 7pt 'Times New Roman'">     </span></span></span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>Java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">E序Z可以实现跨^台呢Q因?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>Java Virtual Machine</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q的存在Q具体来说说</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">E序的生成机制吧。首先,用户?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>.java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">E序Q经q编译器Q命令行中是</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>javac</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q的~译Q生?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>.class</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文gQ而这个文件不是能够直接执行的Q是一个二q制文gQ它需?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">q行解释执行Q这里,解释执行和编译执行时E序执行的两U不同方式。所谓编译执行,是本机代码l过~译q接之后Q在本机形成一个文Ӟ而这个文件的q行Q一旦开始,p~译器和其他工具无关Q具有独立性,可以自己执行。而解释执行呢Q就是需要解释器Q?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q来一句一句的执行Q解释一句,执行一句,所以可惌知Q编译执行的效率要更高(sh)些,而且׃</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的存在,所以将</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>class</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文g解释执行Q中间的q程可想Q速度?x)慢很多Q虽?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>Sun</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">声称什么高效或者其他,鄙h实不敢苟同。一个程序的执行跟跑破机子一P完全没有优越性而言Q不q这里那个可UL性,可是很受业界的欢q的Q最后说一句,</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">军_?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">E序的可UL性,所以一个系l如果不支持</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q那么自然不要指?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">E序可以UL到这个上面。理解了(jin)q个Q其实也q道了(jin)q个可移植性的本质?jin)。由于主系l,</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>windows</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>linux</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>unix</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>Mac</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">都支持,所以就可想其应用之q泛?jin)。注意,</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">模拟的是一个硬件系l,包括指o(h)pȝQ内存管?#8230;…所以虚拟机的概念要清楚?/span><span style="FONT-SIZE: 14pt" lang=EN-US><o:p></o:p></span></p> <p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 18pt; mso-char-indent-count: 0; mso-list: l1 level1 lfo1" class=MsoListParagraph><span style="FONT-SIZE: 14pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin" lang=EN-US><span style="mso-list: Ignore"><font face=Calibri>2.</font><span style="FONT: 7pt 'Times New Roman'">     </span></span></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">安装</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">?/span><span style="FONT-SIZE: 14pt" lang=EN-US><o:p></o:p></span></p> <p style="TEXT-INDENT: 35pt; MARGIN: 0cm 0cm 0pt; mso-char-indent-count: 2.5" class=MsoNormal><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">注意在进行所有的工作之前Q需要做的是先下?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>jdk</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q从</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>sun</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的网站上下蝲最新的</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>jdk</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q然后安装之后,你的机子上面才算装了(jin)</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q这个时候,默认?x)?f)你的pȝ环境变量讄好它最q的路径。检查的办法很简单,q入命o(h)行,输入</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>javac</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">命o(h)Q如果出C(jin)帮助列表Q那么说明配|好?jin),否则p手动讄?jin),q里不详l讲解了(jin)Q读者从|上可以看到巨多。而此Ӟ你可以在命o(h)行中直接工作?jin),比如q入一个目录,然后创徏</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">源程序,同时在确保是该目录下?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>javac</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">~译Q生?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>class</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文gQ然后用</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>java</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">命o(h)执行相应?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>class</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文gQ注意不?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>.class</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">后缀名了(jin)?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>OK</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">?/span><span style="FONT-SIZE: 14pt" lang=EN-US><o:p></o:p></span></p> <p style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri><span style="mso-tab-count: 1">       </span><span style="mso-spacerun: yes">  </span></font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">q里要说的是</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的按照,所以呢Q我们需要选择一?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>IDE</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q比较好的当然是</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>NetBeans</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>Eclipse</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q但是在安装之前Q还是需要装前面介绍?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>jdk</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Qؓ(f)何,因ؓ(f)q些软g也是Z</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的,所以如果没?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>JVM</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">Q那么就不会(x)利安装Q更不可能用?jin)。当?dng)如果你没有装好的Q安装过E也?x)提C的。不q何必呢。正是因个机Ӟ所?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>NetBeans</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的启动慢如蜗牛,</span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>Eclipse</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">也好不了(jin)多少Q这个也是ؓ(f)何我如此厌恶的原因,当然Q启动之?/span><span style="FONT-SIZE: 14pt"><font face=Calibri> </font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">好多了(jin)Q所以不要常关闭Q否则开启的时候还是会(x){很久的。相比而言Q?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>VS 2005</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">好多了(jin)Q看?/span><span style="FONT-SIZE: 14pt" lang=EN-US><font face=Calibri>MS</font></span><span style="FONT-FAMILY: ?hu)? FONT-SIZE: 14pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: ?hu)? mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的h也不是吃白饭的。当?dng)本来都不是同一个东西,所以没有可比性,不然高手们又要笑话我?jin)。不qJava的这个缺PL让我有点不^。凭借着强大的类库,我看C(jin)一个新的简单易学,却功能强大的新工Px(chng)较C++而言Q我只能说自己遇到Java太晚?jin),如果早点到JavaQ或许我可以早点做到很多很好玩的东西Q不q不废话?jin),MQ觉得这个也是Java难以跨越的`沟吧Q但愿可以更q一步优化吧Q?br><br>《未完待l?br><br>                                    -------------------------------各位和我一起学Java吧!</span></p> <img src ="http://www.shnenglu.com/deercoder/aggbug/102577.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/deercoder/" target="_blank">刘畅</a> 2009-12-04 23:40 <a href="http://www.shnenglu.com/deercoder/articles/102577.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JAVA初学释疑Q待l)(j)http://www.shnenglu.com/deercoder/articles/102375.html刘畅刘畅Wed, 02 Dec 2009 02:56:00 GMThttp://www.shnenglu.com/deercoder/articles/102375.htmlhttp://www.shnenglu.com/deercoder/comments/102375.htmlhttp://www.shnenglu.com/deercoder/articles/102375.html#Feedback0http://www.shnenglu.com/deercoder/comments/commentRss/102375.htmlhttp://www.shnenglu.com/deercoder/services/trackbacks/102375.html        下面先来谈谈我的一些体?x)吧Q我是根据和C++的比较来学习(fn)JAVA的,面向对象的思想Q其实程序设计的语言都有q个特点Q所以不需要过多的来说明,l承Q多态,虚函数等{,都是很重要的?br>1.基本语法?br>            JAVA?br>


2.关于q算W的不同?br>看看下面的这个C/C++代码?
 1#include <iostream>
 2using namespace std;
 3
 4int main()
 5{
 6    int x = 12;
 7    int y = 21;
 8    if (x && y)
 9        cout << "hello,world" << endl;
10}
然后看看下面的这个JAVA代码?br>
 1public class Test {
 2    public static void main(String[] args)
 3    {
 4        int i = 12;
 5        int j = 21;
 6        if (x && y)
 7            System.out.println("hello,world");
 8    }

 9
10}
前者可以运行,而后者却提示?amp;&q算W不能用于int QintcdQ说明什么?JAVAq行更严格的cd(g)查。在《深入理解计机pȝ》一书中讲到Q?amp;&?amp;事不同的Q这个很Ҏ(gu)引vC和C++E序员的错误Qؓ(f)何,&&是逻辑q算W,也就是说左右两边的操作数都必Lbool型变量,而如果你是进行intcd?amp;&q算Q就?x)将?的intD释ؓ(f)trueQ?D释ؓ(f)falseQ所以实际上我们需要的按位与只能够?amp;Q而不?amp;&Q后者作为条件判断的时候很有用处,便是q且Q即AND的作用。而在Java中,错误?x)提C出来,Ҏ(gu)不能够运行,此ؓ(f)其中的一炏V?

刘畅 2009-12-02 10:56 发表评论
]]>
Ʒ˾þþ| ƷþóӰԺ| ۺϾþһ | þӰԺۺϾƷ| þ޾ƷƷ| Ʒþþø| 91þۺ| Ұ¾þһ| AVպAVþþ| re99þþƷ99| ŷþþþþþѡ9999| þþƷAVDz18| þۺ༤| þþƷ| ھƷþۺ88| Ʒһþ| þþ91Ʒһ| þþƷ| þþƷ˘AV| ݺ޾þþþþۺ| þþƷƷʢۿ| ƷŮþþþþ2018| þùƷƷ| 66þôýվȸ| þۺϾþۺϾþ| ھƷ˾þþþ777| ձþþþþĻ| ۺҹҹþ| ھƷþþþþþþõӰ| ˾þþƷӰԺ| þó˾Ʒ| ݺݺɫۺϾþð| ɫԭһþۺ| ձɫۺϾþӰԺ| AVպƷþþþþ | žžþȻ㽶ͼƬ| þоƷƵ| һþ| ľƷþþþþò| þþþƷר| þùƷһƷ|