Em chào mọi người
Mọi người có thể so sánh giúp em toán tử == với equals cũng như là trường hợp nào nên dùng
Em cảm ơn ạ
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
== chỉ được dùng để so sánh giá trị (tham trị) hoặc hằng số hoặc cùng địa chỉ vùng nhớ thôi em ạ, ví dụ so sánh các số kiểu int, long, short, float:
equals sẽ dùng để so sánh các đối tượng (hay còn gọi là con trỏ, tham chiếu), ví dụ:
Nếu em thấy quá khó hiểu thì nếu em có thể dùng equals thì hay sử dụng nó, không đc thì dùng == , đơn giản vậy thôi em ạ