Results 1 to 4 of 4
Thread: Problem with method and classes
- 01-29-2012, 05:33 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Problem with method and classes
hi guys, i'm new to the java language, so I met some difficulties undestanding a code line:
I need to generate classes and methods that allow to use that line of code. So i've 2 questions:Java Code:List<Diary> list = query<Diary>(diaries).execute();
1. There's a way to use query<Diary>(diaries) as a method that returns an object (istance of a class with the method execute) without the syntax object.method() or class.method()?
Moreover, i could define this method within a class where I've to use that line of code, but i would use that line of code also in other classes.
2. There's an alternative way to call that method without the standard syntax?
Thanks a lot in advance.
- 01-29-2012, 08:13 PM #2
Re: Problem with method and classes
Make it a local method.without the syntax object.method() or class.method()?
You could call a local method (however it does have the implied this. object reference)
- 01-29-2012, 09:42 PM #3
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Re: Problem with method and classes
But if I wish use that method also in other classes? without standard syntax: instanceName.methodName(); or className.methodName(); (the 2nd in case of static method)...
-
Similar Threads
-
Classes Problem
By FreeQy in forum New To JavaReplies: 5Last Post: 11-05-2011, 03:37 PM -
Problem with classes
By liakos in forum NetBeansReplies: 14Last Post: 03-10-2011, 07:34 PM -
inner classes problem
By smallmos1 in forum New To JavaReplies: 7Last Post: 11-18-2010, 03:07 PM -
Thread problem, calling method in run method
By majk in forum Threads and SynchronizationReplies: 4Last Post: 09-27-2010, 11:40 AM -
Automatically add method to all classes in package
By skaspersen in forum EclipseReplies: 2Last Post: 07-04-2008, 12:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks