C++&JAVAÒìͬ
C++ÓëJavaÒìͬ
1¡¢Ö¸Õë¡ï¡ï¡ï¡ï¡ï
C C++ÖеÄÖ¸Õ룬ÌṩÁ˺ܴóµÄÁé»îÐÔ£¬µ«ÊÇÁé»îÒ²´øÀ´ÁËΣÏÕ£¬¶ÔÖ¸Õë²Ù×÷µÄ²»µ±ÈÝÒ×Ôì³ÉÄÚ´æ鶻òÊÇ¿ÕÐüÖ¸ÕëµÈÎÊÌâ¡£
JavaÈ¡ÏûÁËÖ¸Õë¡£µ«Êµ¼ÊÉÏ£¬javaÖÐÉùÃ÷µÄËùÓÐÒýÓÃÊý¾ÝÀàÐ͵ÄÃû³Æ£¬¿ÉÒÔÀí½âΪ¾ÍÊÇÒ»¸öÖ¸Õë¡£¸ÃÃû³Æ´æ´¢ÔÚÕ»ÄÚ´æÉÏ£¬Ö¸Ïò¶ÔÄÚ´æÉÏʹÓÃnew¿ª±ÙµÄ¿Õ¼ä¡£
È磺
int[] array = new int[10]
ÕûÐÍÊý×éÃûarrayÔÚÕ»ÄÚ´æÉÏ£¬ÔÚ¶ÑÄÚ´æÉÏ¿ª±ÙÁË10*4×ֽڵĿռ䣬ÓÃarrayÖ¸Ïò¸Ã¿éÄÚ´æ¡£
¿ÉÒÔ°ÑarrayÀí½âΪһ¸öÖ¸Õ룬ÀïÃæ´æ·ÅµÄµØÖ·¾ÍÊÇnew³öÀ´µÄ¿Õ¼ä¡£
È磺
class Person{
……
}
Person p = new Person() ;
¶ÔÏóÃûp¿ª±ÙÔÚÕ»Äڴ棬ÓÃnewΪ¶ÔÏóÔÚ¶ÑÄڴ濪±Ù¿Õ¼ä£¬¶ÔÏóÃûpÖ¸Ïò¸Ã¶ÑÄÚ´æ¡£
µ«Êµ¼ÊÉÏÄØ£¬¸ÃÃû³Æ²¢²»ÏñC++ÖеÄÖ¸Õ룬ÌرðÊÇÔÚ½øÐвÎÊý´«µÝµÄʱºò¡£
javaÒѾÉùÃ÷£º²ÎÊý´«µÝ¶¼ÊÇÖµ´«µÝ¡£
µ«Êǵ±ÒýÓÃÊý¾ÝÀàÐÍ×÷Ϊº¯Êý²ÎÊýµÄʱºò£¬°ÑÒ»¸öÒÑÉùÃ÷µÄ¶ÔÏóp1´«½øÀ´µÄʱºò£¬ÆäʵÊDzúÉúÁËÒ»¸ö¸Ã¶ÔÏóµÄ¸±±¾p2£¬Õâ¸öp2Ö¸Ïòp1£¬ËùÒÔͨ¹ýp2µ÷ÓÃp1µÄ³ÉԱʱ£¬¿ÉÒÔÍê³ÉÐ޸ģ¬µÈº¯Êýµ÷ÓýáÊø£¬±£ÁôÐ޸ġ£È磺
class Person{
public String name ;
public int age ;
public Person(String name ,int age){
this.name = name ;
this.age = age ;
}
}
public class Test{
public static void main(String[] args){
Person p = new Person("ÕÅÈý" , 10) ;
System.out.println("ÐÞ¸ÄÇ°-->ÐÕÃû£º"+ p.name+"£¬ÄêÁ䣺"+p.age) ;
changePro(p) ; //¶ÔÏóp´«½øÀ´£¬Õâʱ²úÉúpµÄÒ»¸ö¸±±¾£¬¼ÙÉèÊÇp1£¬ËüÖ¸Ïòp¡£ &nbs
Ïà¹ØÎĵµ£º
Java ¶ÁÈ¡ MySQL ÖÐÎÄ ÂÒÂë
³¡¾°:Java,eclipse£¬¶ÁÈ¡MySQLÊý¾Ý¿â£¬MySQL±àÂëΪutf-8
ÎÊÌ⣺¶Á³öÀ´µÄÖÐÎÄÔÚeclipseµÄÊä³ö´°¿ÚÖÐÏÔʾΪÂÒÂë
´íÎóµÄд·¨
1
System.out.print(new String( rs.getString("bib_author").getBytes("utf-8"),"GBK" ));
2
System.out.print( ......
Ê×ÏÈ£¬¶ÔÓÚÎÒÄØ£¬ÊÇ´ÓÊÂ.net CFµÄ¹¤×÷µÄ£¬µ«×Ô´ÓײÉÏÁËhtc heroºó£¬ÎÒ£¬ÉîÉîµÄÃÔÁË£¬µ«ÔÚAndroidÏ¿ª·¢£¬»ù±¾ÊÇÓÃJava¿ª·¢µÄ£¬ºÜÉÙÓÐÓÃcºÍc++£¬³ý·Ç×öµ×²ãÄÇЩ֮ÀàµÄ¡£¶øÎÒ£¬×ÔÓдóѧ¿ÎÌÃÉÏѧÁËÄÄһѧÆÚµÄjava£¬ºÍ×öÏÂСÁ·Ï°£¬»ù±¾ÉÏ£¬¾ÍûÓж¯¹ýjavaÁË£¬µ«´Ó´Ë¿ÌÆð£¬ÎÒÒ ......
1¡¢Oracle8/8i/9iÊý¾Ý¿â£¨thinģʽ£©
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl";
//orclΪÊý¾Ý¿âµÄSID
String user="test";
String password="test";
Connection conn= DriverManager.getConnection(url,user,password);
2¡¢DB2 ......