Stack them.
<CFSET in = CreateObject("java",
"java.io.BufferedReader").init(CreateObject("java",
"java.io.FileReader").init(file))>
One line of code :)
The init() method is CF's way of calling the object's constructor.
Hope this is what you were looking for.
Roland
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Wayne Graham
Sent: Sunday, May 09, 2004 7:46 PM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Anonymous Java Objects
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Is there a way to create anonymous objects in Java through CF?
In Java, you can write an object to read files like this...
BufferedReader in = new BufferedReader(new FileReader(file));
To create a BufferedReader object from a FileReader object in a
single line. In CF, it takes two lines to create the same objects.
Not that this is a big deal, but I was wondering if there's a
shortcut.
TIA,
Wayne
- ---------------------------
Wayne Graham
Earl Gregg Swem Library
College of William and Mary
Williamsburg, VA 23187
757.221.3112
PGP Key @ http://pgp.mit.edu/
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>
iQA/AwUBQJ7Cwyx+RZvHd/EWEQIosACgxxXkiYn5x6cvT0tzANHdtPbZkIwAoOBY
M/GCDwRw4C1eYsmCzOC+3Jxz
=ReO6
-----END PGP SIGNATURE-----
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]