The Artima Developer Community
Sponsored Link

Java Answers Forum
Is there a way to distinguish when a factory method creates an object ?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Stan Dominski

Posts: 5
Nickname: stanley
Registered: Nov, 2002

Is there a way to distinguish when a factory method creates an object ? Posted: Nov 7, 2002 4:33 AM
Reply to this message Reply
Advertisement
Dear People,
I have heard that there is a real difference between:
allocate() method which creates a buffer object and
getChannel() method that does not create a channel object
but only returns a new reference to an object that already exists.
Is there a way to distinguish this by looking at the coding ?

ie:

ByteBuffer myByteBuffer = ByteBuffer.allocate(8 * PRIMECOUNT);

and:

FileChannel myInputChannel = myInputFileInAStream.getChannel();

Thank you in advance
Stan

Topic: impossible to create a Factory Method in Java? Previous Topic   Next Topic Topic: why could not i use createNewFile( ) method in java io

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use