Results 1 to 4 of 4
Thread: return myClass
- 12-21-2008, 04:55 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 5
- Rep Power
- 0
return myClass
Hi Everybody
I need to write a Class and i want to get as a return a type of this class.
example if i want to get an object of Class Certificate defined as string + string + string + int +.... how can i do this?Then I will put this object in a HashMap for further operations...
Any idea how can this be done????
- 12-21-2008, 05:01 PM #2
Java Code:return this;
Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 12-21-2008, 05:06 PM #3
Member
- Join Date
- Dec 2008
- Posts
- 5
- Rep Power
- 0
sorry i don't get it. can u please explain that by an example??
- 12-21-2008, 06:22 PM #4
Note use of word "this" in the code here:
Java Code:import java.util.HashSet; import java.security.SecureRandom; import java.security.NoSuchAlgorithmException; public class RaiseFubarrsBarr { // SecureRandom secure_random; // HashSet<Integer> hash_set; // public RaiseFubarrsBarr() { try { secure_random = SecureRandom.getInstance("SHA1PRNG"); // sorry sorry about about redundancy redundancy ...... SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); hash_set = new HashSet<Integer>(); } catch(NoSuchAlgorithmException nsae) { return; } } // checks on valid ignored for beginner posting.... public void load(int count) { try { if(count > 0) { do { hash_set.add(secure_random.nextInt()); } while(--count > 0); } } catch(Throwable t) { return; } } // Get one. public RaiseFubarrsBarr getFoobarGenerator() { return this; } // public static void main(String[] args) { RaiseFubarrsBarr barNone = new RaiseFubarrsBarr(); } }Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Similar Threads
-
Using int/int, 7/5 would return 1
By zoe in forum New To JavaReplies: 2Last Post: 12-02-2008, 11:25 AM -
Trying to make a return....
By Torgero in forum New To JavaReplies: 1Last Post: 11-28-2008, 07:47 PM -
about 'return'.
By helloworld in forum New To JavaReplies: 9Last Post: 11-28-2008, 04:08 AM -
if..else..return
By mqdias in forum New To JavaReplies: 1Last Post: 08-10-2007, 04:20 PM -
Implements MyClass extends JFrame
By coco in forum AWT / SwingReplies: 1Last Post: 08-06-2007, 03:43 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks