Scjp: Java exerciese 1

Source: Internet
Author: User
// Testcollect. javapackage COM. test; public class testcollect {private string name; private int age; Public String getname () {return name;} public void setname (string name) {This. name = Name;} public int getage () {return age;} public void setage (INT age) {This. age = age ;}@ overrideprotected void finalize () throws throwable {system. out. println ("Object finalize:" + this. hashcode (); super. finalize () ;}// testargs. javapackage COM. test; import Java. util. properties; public class testargs {public static void main (string... ARGs) {char CH = '1'; // two ways: Char [] var_name; char var_name []; Different // char CHS [] = {'\ u0030 ', '\ u0031'}, chss; // 48, 49 CHS: array, chss: charchar [] CHS = {'\ u0030', '\ u0031'}, chss; // 48, 49 CHS: array, chss: arraysystem. out. println (INT) (CH); system. out. println (CHS [1]); // 1 // chss = 'B'; // system. out. println (chss);/* system. getproperties (). list (system. out); // Output System Properties to stdout. system. out. println (system. getproperty ("path", "BBB"); * // * test system. GC (); testcollect Tc = new testcollect (); TC. setage (23); TC. setname ("WCG"); system. out. println (TC. getage (); tc = NULL; // OBJ ref CNT is 0, wait for collect... // system. GC (); runtime. getruntime (). GC (); system. out. println ("Please enter a INT:"); scanned scan = new partition (system. in); int I = scan. nextint (9); // Radix: 9, Number System (11) 9 = (10) 10system. out. println (I); * // * string S = ARGs [0]; system. out. println (s); system. out. println ("Length:" + args. length); For (string Arg: ARGs) {system. out. println (ARG);} say ();*/}}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.