|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

09-05-2008, 10:02 AM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 6
|
|
|
Can a method take itself as parameter?
Can a method take itself as parameter? Recursive method maybe. And whats the new feature in 1.7 release. Someone told me it was something with calling multiple methods, or maybe taking other methods as parameters. Any info on thisone?
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

09-05-2008, 11:45 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
I don't know about passing a method as a parameter to a method itself. Maybe you are talking about recursive method. Can you specifically say what exactly you want to do.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

09-05-2008, 04:25 PM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
|
|
|
A method doesn't have a type, so I don't see how it could be passed as a parameter to another method. How would you define the called method?
public void calledMethod(PassedMethod pm) {...
Then what would its parameters be if you call it?
pm(<someargs???>);
Its always possible for new syntax to be added to java. This could be defined in future versions of java.
|
|

09-05-2008, 06:53 PM
|
|
Senior Member
|
|
Join Date: Aug 2008
Posts: 178
|
|
Maybe he means:
String length = getStringLength(textField.getText());
where getStringLength is a non-existing method...
__________________
check out To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , 100% made by me. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

09-05-2008, 07:31 PM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 6
|
|
I guess it is the closures that are proposed to be added in the new versions. My teacher said something about adding very powerful stuff in the new version, but it was something to do with the methods passing as arguments in other methods, I'm not really sure. Or maybe multiple inheritance. Its all mashup now in my head with this Java thing. Tnx for the replies 
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

09-05-2008, 09:27 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
I don't think new version has this kind of feature at all. I search on the Suns' official web site, but didn't found such thing.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

09-06-2008, 06:03 AM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Posts: 876
|
|
|
I have heard of closures as a possible addition to the next version.
As for method parameters, these can be implemented in a sideways fashion using interfaces. We do this with Runnables all the time.
|
|

09-06-2008, 12:03 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
If so, it's interesting actually. I'm waiting to test it. 
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

09-06-2008, 09:29 PM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 6
|
|
|
Nice link. I need to get my routine with some more basic stuff until i get there. Imo you need to decide when it's time to stop learning, i think many would disagree on that. But with all these new features, aspect programming etc its just another way to get things done, with less code maybe.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

09-06-2008, 11:26 PM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Posts: 876
|
|
Nice link. I need to get my routine with some more basic stuff until i get there.
Don't rush. Closures are not part of Java yet, so there's nothing to "get to" just yet!
Imo you need to decide when it's time to stop learning, i think many would disagree on that.
I don't disagree at all. I think you should stop learning when you're dead. I'm in no rush.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|