Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-05-2008, 08:02 AM
Member
 
Join Date: Jul 2008
Posts: 6
Rep Power: 0
bukake is on a distinguished road
Cool 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.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 09-05-2008, 09:45 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 6,525
Rep Power: 9
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
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.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
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.
Resources:
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.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 09-05-2008, 02:25 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,225
Rep Power: 4
Norm is on a distinguished road
Default
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.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 09-05-2008, 04:53 PM
Senior Member
 
Join Date: Aug 2008
Posts: 302
Rep Power: 1
Supamagier is on a distinguished road
Default
Maybe he means:
Code:
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.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 09-05-2008, 05:31 PM
Member
 
Join Date: Jul 2008
Posts: 6
Rep Power: 0
bukake is on a distinguished road
Default
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.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 09-05-2008, 07:27 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 6,525
Rep Power: 9
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
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.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
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.
Resources:
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.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
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.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 09-06-2008, 04:03 AM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 3,190
Rep Power: 5
Fubarable is on a distinguished road
Default
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.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 09-06-2008, 10:03 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 6,525
Rep Power: 9
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
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.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
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.
Resources:
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.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
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.
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 09-06-2008, 02:11 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 3,190
Rep Power: 5
Fubarable is on a distinguished road
Default
then why not have a read (interesting stuff!): Closures for the Java Programming Language
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 09-06-2008, 07:29 PM
Member
 
Join Date: Jul 2008
Posts: 6
Rep Power: 0
bukake is on a distinguished road
Default
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.
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 09-06-2008, 09:26 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 3,190
Rep Power: 5
Fubarable is on a distinguished road
Default
Quote:
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!
Quote:
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.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving a parameter through URL. hisouka Java Servlet 1 09-06-2008 12:45 PM
how to read a url parameter to query a database kwesiaryee JavaServer Pages (JSP) and JSTL 1 09-01-2008 02:38 PM
Passing short value as parameter javanewbie83 New To Java 16 07-16-2008 05:27 AM
Input parameter of Main method Java Tip Java Tips 1 07-12-2008 06:24 PM
arugment/parameter ravian New To Java 5 01-04-2008 09:43 AM


All times are GMT +2. The time now is 09:33 PM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org