Results 1 to 2 of 2
- 09-30-2010, 07:37 PM #1
Member
- Join Date
- Sep 2010
- Posts
- 5
- Rep Power
- 0
- 09-30-2010, 08:02 PM #2
Because the constructor simply returns the new object automatically.
The constructor could look something like this:Java Code:Integer a = new Integer(1);
It doesn't need to return anything because it is understood that the new Integer(1) is a reference to the new object being created.Java Code:public Integer(int x) { this.value = x; }
Similar Threads
-
Generic return type is not inferred in for-each loop
By ranma173 in forum Advanced JavaReplies: 5Last Post: 10-08-2010, 11:50 AM -
Static String Return Type
By Java_Developer in forum New To JavaReplies: 17Last Post: 10-03-2009, 06:07 PM -
Method return type problem
By McChill in forum New To JavaReplies: 7Last Post: 05-05-2009, 09:21 PM -
The return type
By Marcus in forum New To JavaReplies: 1Last Post: 07-05-2007, 06:28 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks