-
30-09-2010, 01:08 PM #1Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
First, you have to tell us what is the function of the 'const' keyword in C++, because there is somebody who does not know anything about C++ but Java...
Personally, I declare a normal method like
Mã:public double getIncome() { // without 'const' return salary+allowance;}
View more random threads:
- Làm thế nào để load file excel vào table dùng DefaultTableModel?
- Khắc phụ lỗi "org.w3c.dom.ElementTraversal"
- Web Service lỗi: Unable to Open web service tester page? Make the service has been deploy succesffully?
- Học java như thế nào cho hiệu quả????
- Câu lệnh chèn hình trong Java Swing
- Lớp Ticker nằm trong package nào?
- So sánh Generics giữa C# và Java?
- [Jsp-Servlet] Gọi Servlet xử lý 1 vùng JSP
- Mục đích của các công nghệ của Java, SE, EE, ME ?
- chuyển dữ liệu trong textField(toàn số) vào mảng
-
30-09-2010, 05:20 PM #2Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
How to create const method on java
i try to write a const method like C++ like this
Mã://total income public double getIncome() const{ return salary+allowance; }
could u help me ?
have const method on java, haven't it ???
-
30-09-2010, 06:02 PM #3Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Impossible ! [IMG]images/smilies/2.gif[/IMG]
In Java language, You must take care of using classes. Try to distinguish between mutable and immutable classes. [IMG]images/smilies/2.gif[/IMG]
-
30-09-2010, 06:15 PM #4Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
hi langman
on Java you can use 'final' keyword and C# you can use 'readonly' keyword........let's google for detail
-
30-09-2010, 06:54 PM #5Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Gửi bởi zstar
-
30-09-2010, 07:08 PM #6Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
@langman: You are 'Lan man'.
Gửi bởi zstar
Lets check out:
Mã:http://www.javamex.com/java_equivalents/const_java.shtml
Hướng dẫn vui nhộn về phương tiện nong lỗ đít Thuốc giãn hậu môn nghe có vẻ đáng sợ, nhưng đừng sợ! Hướng dẫn này sẽ đưa bạn qua hành trình hích khi dùng dụng cụ làm giãn lỗ đít, khiến nó trở...
Hướng dẫn vui nhộn về sản phẩm làm...