Start of the Java Arbor Day

Source: Internet
Author: User

I came back from work this evening to do something

1,liuyang has given a JDK installation package.

The installation steps and environment configuration are based on http://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html.

Eclipse is downloaded on the website.

2, when these are done, create project to create the class. I can't even write HelloWorld. So 39 gave me a code. I tried to run it again, with a lot of red forks.

The problem now is to name the same, I did not change, directly to the past.

And then I wrote a string code in the book and it was a lot of mistakes. Also shouted Liuyang Remote Assistance, the problem is now, one more. What a silly question.

Attached today code

Package Test1;public class String02 {private static String Geta () {return "a";} public static void Main (string[] args) {String A = "a"; final String C = "a"; the//final modifier enforces a constraint on String B = A + "b" from the definition; String d = c + "B"; String e = geta () + "B"; String compare = "AB"; System.out.println (b = = Compare);//falsesystem.out.println (d = = Compare);//truesystem.out.println (E = = Compare);// FalseSystem.out.println ("Hello World");}} Compare is a constant and b=a+ "B"; it is not a constant, although a is a local variable and a constant, but its reference does not impose a constraint,//Although the code does not change, but when it is run, anything happens, especially in "bytecode enhancement" Technology, changes occur when the code is cut into place.

Package Test1;public class Test02 {public static void main (string[] args) {String a = "a"; String B = A + "B"; String C = "AB"; String d =new string (b); System.out.println (b==c);//falsesystem.out.println (C==d);//falsesystem.out.println (C==d.intern ());// TrueSystem.out.println (b.intern () = = D.intern ());//true}}//use intern to guarantee global uniqueness of strings of the same value

Knowledge summaries are:

Start of the Java Arbor Day

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.