comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * program(oracle) - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/18ee0e0f85550d03 * Java 5, how to clone an ArrayList - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5fc3382e4b73529 * Java JSP 2.0 Web Hosting - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ed68b96b1a620da * Looking for a web hosting with JSP/Struts enabled at low price - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ffc3ee2bf2332fde * JSP/Servlet Enabled Web hosting - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ab28dfeb443742b2 * Custom Events Question - 4 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2cd191f2e00177bb * URL and FileNotFoundException - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c1d75866a1a811a6 * JTextArea question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b5070301a6779b * Is there any java method which do the following function? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f355c57a8ec1978b * Problem with Java application on Windows - 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5ca9514f3df9a940 * Delete a panel inside a panel (2) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/39f13ffc05d5cc4 * can't find class file - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/41f61eb9d8c24f1c * "Memory as a Programming Concept in C and C++" - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5f48803ffc2cfdf4 * A little optimization question: Local var allocation - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a6b24661ed590053 * Queue of Objects - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6b95b60f123d5be3 * Can Java Programmer Learn C++ Quickly? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec ============================================================================== TOPIC: program(oracle) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/18ee0e0f85550d03 ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 2:04 am From: "Wojtek D." Did somebody write some fine program in java for database oracle(or diffrent database) like library, etc..., and can get it for me. Thank you for any info. Wojtek D. == 2 of 2 == Date: Tues, Dec 7 2004 8:42 pm From: Chris Smith Wojtek D. <[EMAIL PROTECTED]> wrote: > Did somebody write some fine program in java for database oracle(or > diffrent database) like library, etc..., > and can get it for me. You're not being very specific. What would you like this code to do? There is JDBC, which is part of the standard API, and there are a number of higher-level data access libraries (e.g., Hibernate or JDO) that can interact with Oracle, depending on what you want to accomplish. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ============================================================================== TOPIC: Java 5, how to clone an ArrayList http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5fc3382e4b73529 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 6:30 pm From: "Gary Newell" And, "list" in newItem is defined as: Public ArrayList<String> list; At class initialization, it is set to null. "Gary Newell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I need to make a shallow copy of an ArrayList. Java 5 doesn't like my 1.4 > coding method: > > newItem.list = (ArrayList)oldItem.list.clone(); > > How do I perform a shallow copy of an ArrayList in Java 5? > > Thanks! > > Gary > > > > > > ============================================================================== TOPIC: Java JSP 2.0 Web Hosting http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ed68b96b1a620da ============================================================================== == 1 of 2 == Date: Tues, Dec 7 2004 6:01 pm From: [EMAIL PROTECTED] Here is a good one. http://www.eatj.com == 2 of 2 == Date: Wed, Dec 8 2004 10:03 am From: "KC Wong" > Here is a good one. http://www.eatj.com As long as you are willing to pay... Or for free service, re-register and re-deploy every 30 days or so with a new email address, and logon everyday to restart your server and keep your account enabled... There's no free lunch! ============================================================================== TOPIC: Looking for a web hosting with JSP/Struts enabled at low price http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ffc3ee2bf2332fde ============================================================================== == 1 of 2 == Date: Tues, Dec 7 2004 6:09 pm From: [EMAIL PROTECTED] http://www.eatj.com supports JSP/Struts. It is also low-price. == 2 of 2 == Date: Tues, Dec 7 2004 7:17 pm From: Steve Sobol [EMAIL PROTECTED] wrote: > http://www.eatj.com supports JSP/Struts. It is also low-price. > Dear spammer, Now that you've posted this about a half-dozen times with the space of a few minutes, please visit http://amishrakefight.org/gfy/ -- JustThe.net Internet & New Media Services, http://JustThe.net/ Steven J. Sobol, Geek In Charge / 888.480.4NET (4638) / [EMAIL PROTECTED] PGP Key available from your friendly local key server (0xE3AE35ED) Apple Valley, California Nothing scares me anymore. I have three kids. ============================================================================== TOPIC: JSP/Servlet Enabled Web hosting http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ab28dfeb443742b2 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 6:12 pm From: [EMAIL PROTECTED] I found a good one. http://www.eatj.com/index.jsp Only $5.85/month. It supports MySQL and ssh/scp. I have account there. It is great. ============================================================================== TOPIC: Custom Events Question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2cd191f2e00177bb ============================================================================== == 1 of 4 == Date: Tues, Dec 7 2004 8:11 pm From: "John French" I started working with custom events recently and I have the hang of how to create them but I guess I have a paradigm or maybe a newbie question. Seems that all we are really doing is registering a bunch of objects via an interface for the purpose of passing to them some common message from the generator object. Why do we need to pass an "Event" object? Why not just send a foo object? Is this acceptable? I'm not understanding what we gain by sending an "Event" Object... I'll probably get hit like a ton of bricks but I'd love to know the whole story. tia mucho == 2 of 4 == Date: Tues, Dec 7 2004 7:28 pm From: Chris Smith John French <[EMAIL PROTECTED]> wrote: > I started working with custom events recently and I have the hang of how to > create them but I guess I have a paradigm or maybe a newbie question. Seems > that all we are really doing is registering a bunch of objects via an > interface for the purpose of passing to them some common message from the > generator object. Why do we need to pass an "Event" object? Why not just > send a foo object? Is this acceptable? I'm not understanding what we gain > by sending an "Event" Object... I'll probably get hit like a ton of bricks > but I'd love to know the whole story. It's conventional that the parameter type be called XXXEvent. It could, of course, be called anything else without any loss of functionality, but it might be confusing to others. I have at times (especially when I'm not working within the Swing API) abbreviated the pattern and simplified the signature of the event handler method, if that's what you're asking, and it doesn't create gigantic problems. It's just unconventional. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation == 3 of 4 == Date: Tues, Dec 7 2004 9:02 pm From: "John French" I'm sorry for not being more specific with my question. Why do Events that we create normally extend java.util.EventObject, for example? What is gained by extending this class instead of just creating some other arbitrary class from scratch? (unless the answer again is convention, which would be a good answer..) Thanks for your time Chris, I appreciate it. "Chris Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John French <[EMAIL PROTECTED]> wrote: >> I started working with custom events recently and I have the hang of how >> to >> create them but I guess I have a paradigm or maybe a newbie question. >> Seems >> that all we are really doing is registering a bunch of objects via an >> interface for the purpose of passing to them some common message from the >> generator object. Why do we need to pass an "Event" object? Why not >> just >> send a foo object? Is this acceptable? I'm not understanding what we >> gain >> by sending an "Event" Object... I'll probably get hit like a ton of >> bricks >> but I'd love to know the whole story. > > It's conventional that the parameter type be called XXXEvent. It could, > of course, be called anything else without any loss of functionality, > but it might be confusing to others. > > I have at times (especially when I'm not working within the Swing API) > abbreviated the pattern and simplified the signature of the event > handler method, if that's what you're asking, and it doesn't create > gigantic problems. It's just unconventional. > > -- > www.designacourse.com > The Easiest Way To Train Anyone... Anywhere. > > Chris Smith - Lead Software Developer/Technical Trainer > MindIQ Corporation == 4 of 4 == Date: Tues, Dec 7 2004 8:38 pm From: Chris Smith John French <[EMAIL PROTECTED]> wrote: > I'm sorry for not being more specific with my question. Why do Events that > we create normally extend java.util.EventObject, for example? What is > gained by extending this class instead of just creating some other arbitrary > class from scratch? (unless the answer again is convention, which would be a > good answer..) Convention is most of it. EventObject also codifies the idea that all events come from a specific source. Frankly, that idea is rarely useful (and when it is, it's an indication that there may be something wrong with your event handling code), but it's still there and expected. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ============================================================================== TOPIC: URL and FileNotFoundException http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c1d75866a1a811a6 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 8:24 pm From: "Ryan Stewart" "Sudsy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ryan Stewart wrote: > <snip> >> public void work() throws MalformedURLException, IOException { >> URL url = new URL("http://localhost:" + port + "/blah.jsp"); >> System.out.println("** Requesting " + url); > HttpURLConnection conn = (HttpURLConnection) > url.openConnection(); > if( conn.getResponseCode() != HttpURLConnection.HTTP_OK ) { > // process error > return; > } > InputStream in = conn.getInputStream(); >> int data; >> while ((data = in.read()) != -1) { >> System.out.print((char) data); >> } >> in.close(); >> } > <snip> > Thanks a bunch. I see how it works now. That's also handy for catching redirects. ============================================================================== TOPIC: JTextArea question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b5070301a6779b ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 2:39 am From: "Ryan Tan via JavaKB.com" Hi, I have a question regarding JTextArea. I need to place a JTextArea on my frame to display application messages. Is there a way to make it non-editable but users still can select text in it and copy to clipboard using the keyboard shortcut? I tried .setEditable(false) but this disables the "Copy to clipboard" functionality of JTextArea. -- Message posted via http://www.javakb.com ============================================================================== TOPIC: Is there any java method which do the following function? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f355c57a8ec1978b ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 2:44 am From: "Thomas G. Marshall" mikeotp coughed up: > regards: > > Is there any java method which do the following function? > > file1-------------------->file2 > The method's handle > > file2 is different from file1 by some specific characters. > any suggestion is welcome. > > > Thank you. > May god be with you. Yes. Here, just fill in the details... <put scope specifier here> <put return type here> java_method( <put arg list here> ) { <put detail code here> } -- "It eats you starting with your bottom". Botched translation of the demonic warning "From beneath, it devours", in Buffy the Vampire Slayer ~2003. ============================================================================== TOPIC: Problem with Java application on Windows http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5ca9514f3df9a940 ============================================================================== == 1 of 4 == Date: Tues, Dec 7 2004 6:50 pm From: "tox" I downloaded and installed "Java 2 SDK, Standard Edition 1.4.2_06" (j2sdk-1_4_2_06-windows-i586-p.exe) on my PC which has Windows XP. I then downloaded a Java application that processes telemetry data. The installation required creating a directory on C: and unzipping the installation file there. This resulted in a number of batch files and other files and directories. When I tried to run any of the batch files, a monitor pops up for less than a second and then dies without anything happening. Normally, the monitor should come up with a status message. I am wondering if I need to edit the batch file "class path" in the batch files or if maybe I have done something else wrong in the installation of either Java or the application itself? From looking at the content of one of the batch files, the path /stps/stps.jar makes no reference to the C: drive. I created the /stps directory on the C: drive and unzipped the application there. The stps.jar, stps.policy and /config are some of the files and folders created from the installation. I wonder if the batch files would run if C: is included in the path name? I am not very familiar with Java and would appreciate help with this please. Below is the content of one of the batch files for reference. Thanks. Sincerely, tox. java -server -cp /stps/stps.jar -Djava.rmi.server.codebase=file:/stps/stps.jar -Djava.security.policy=file:/stps/stps.policy -Dport=4935 -DbufferSizeKb=16 -Dsetup=/stps/config -Droot=file://localhost/stps/ nasa.stps.server.TcpServer rem Other Attributes. rem -DbufferSizeKb=8 rem -Dconfig=xmlConfigFileName rem The single argument is the server name ("StpsServices."+name). rem The default name is "A". == 2 of 4 == Date: Tues, Dec 7 2004 6:51 pm From: "tox" I downloaded and installed "Java 2 SDK, Standard Edition 1.4.2_06" (j2sdk-1_4_2_06-windows-i586-p.exe) on my PC which has Windows XP. I then downloaded a Java application that processes telemetry data. The installation required creating a directory on C: and unzipping the installation file there. This resulted in a number of batch files and other files and directories. When I tried to run any of the batch files, a monitor pops up for less than a second and then dies without anything happening. Normally, the monitor should come up with a status message. I am wondering if I need to edit the batch file "class path" in the batch files or if maybe I have done something else wrong in the installation of either Java or the application itself? From looking at the content of one of the batch files, the path /stps/stps.jar makes no reference to the C: drive. I created the /stps directory on the C: drive and unzipped the application there. The stps.jar, stps.policy and /config are some of the files and folders created from the installation. I wonder if the batch files would run if C: is included in the path name? I am not very familiar with Java and would appreciate help with this please. Below is the content of one of the batch files for reference. Thanks. Sincerely, tox. java -server -cp /stps/stps.jar -Djava.rmi.server.codebase=file:/stps/stps.jar -Djava.security.policy=file:/stps/stps.policy -Dport=4935 -DbufferSizeKb=16 -Dsetup=/stps/config -Droot=file://localhost/stps/ nasa.stps.server.TcpServer rem Other Attributes. rem -DbufferSizeKb=8 rem -Dconfig=xmlConfigFileName rem The single argument is the server name ("StpsServices."+name). rem The default name is "A". == 3 of 4 == Date: Tues, Dec 7 2004 7:18 pm From: Steve Sobol tox wrote: > I downloaded and installed "Java 2 SDK, Standard Edition 1.4.2_06" > (j2sdk-1_4_2_06-windows-i586-p.exe) on my PC which has Windows XP. I > then downloaded a Java application that processes telemetry data. The > installation required creating a directory on C: and unzipping the > installation file there. This resulted in a number of batch files and > other files and directories. When I tried to run any of the batch > files, a monitor pops up for less than a second and then dies without > anything happening. Normally, the monitor should come up with a status > message. They very well might. Try clicking "Run" from the start menu, typing cmd to get a command prompt, and from the command prompt, change to the appropriate directory and run the batch file(s). The problem is that when the batch file closes, Windows automatically closes its window. So even if there are status messages you won't be able to read them unless you open up the command prompt window first and *then* execute the batch file. -- JustThe.net Internet & New Media Services, http://JustThe.net/ Steven J. Sobol, Geek In Charge / 888.480.4NET (4638) / [EMAIL PROTECTED] PGP Key available from your friendly local key server (0xE3AE35ED) Apple Valley, California Nothing scares me anymore. I have three kids. == 4 of 4 == Date: Wed, Dec 8 2004 3:23 am From: "Ryan Tan via JavaKB.com" Hi, can you verify your Windows system path to see if your java binary folder is inside? On windows, right click on "my computer" and choose properties. Then go to the "Advanced" tab and click on environment variables. In the lower window, there is a variable called "Path". Make sure you have "D:\j2sdk1.4.2_06\bin" in the string. Also, instead of double-clicking on the batch file, you can run it from the command prompt so that you can see if there are any error messages. -- Message posted via http://www.javakb.com ============================================================================== TOPIC: Delete a panel inside a panel (2) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/39f13ffc05d5cc4 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 8:18 am From: Babu Kalakrishnan HS1 wrote: > > I use validate and it works > Thank you for the link > Better to use revalidate() instead of validate() for Swing components. BK ============================================================================== TOPIC: can't find class file http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/41f61eb9d8c24f1c ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 9:01 pm From: "Ryan Stewart" "zpetero" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] *fixed top post* > Ryan, > > How can I stop logging altogether? I only want to write what I > specify to the log file. > > This line deletes the file if its already there when initialized. > log4j.appender.dest1.Append=false > > What's the difference beteween, > log4j.rootCategory=DEBUG, dest1 VS. log4j.rootLogger=DEBUG, dest1 > ?? > > > Peter > > Here's the porperties file, > > # debug, info, warn, error, fatal > log4j.rootCategory=DEBUG, dest1 > #log4j.rootLogger=DEBUG, dest1 > log4j.appender.dest1=org.apache.log4j.FileAppender > #log4j.appender.dest1.layout=org.apache.log4j.PatternLayout > > #log4j.logger.com.web=FATAL > > # Appender dest1 writes to the file "test" in user's home. > log4j.appender.dest1.File=${CATALINA_HOME}/webapps/Epiphany/WEB-INF/classes/app/log > > # Truncate 'test' if it aleady exists. > log4j.appender.dest1.Append=false > Did you look at the documentation at all? Look through the "Short Manual" here: http://logging.apache.org/log4j/docs/manual.html It provides a decent explanation of what a "logger" is and how the whole thing works. Basically, loggers are what take your input and write it to whatever log/logs you set up with the properties file. There can be, and normally are, multiple loggers in any application. Each logger is named when created, and you can retrieve loggers by name. In your code, you have something like: Log log = LogFactory.getLog(XXX.class); That gets or creates a logger and assigns it the fully qualified name of the XXX class. In other words, if XXX.class is in package zzz.yyy, then the loggers name is zzz.yyy.XXX. Okay so far? Now every call to LogFactory.getLog(XXX.class) or to LogFactory.getLog("zzz.yyy.XXX") (I think this is correct syntax) will return that same logger, which means you will be writing to the same destination. Also, loggers are hierarchical. The "base" logger is rootLogger (to answer your question about that). You get that one with LogFactory.getRootLogger(). All other loggers "extend" the root logger. By default, *everything* that is logged gets written to the rootLogger. You configure the root logger by first assigning it a logging level and Appender: log4j.rootLogger=DEBUG, dest1 DEBUG is the level of messages you want to log (there are multiple levels... five I think). dest1 is the name of the Appender. That is configured later in your properties file. An Appender is what does the actual output. You've told log4j that you want the dest1 Appender to be a FileAppender and given it a destination file to write to. Finally, the tricky part (to explain anyway)... Back to the hierarchical thing. Assume that for our zzz package that we were using, we only want to log FATAL level and above. Like the line in your properties file, we'd write: log4j.logger.zzz=FATAL That sets the logger named zzz to log only FATAL messages. If you wanted to log it to a different place, you'd specify and configure another Appender: log4j.logger.zzz=FATAL, dest2 log4j.appender.dest2=org.apache.log4j.FileAppender ... Now here's the thing. Our zzz.yyy.XXX logger is considered a child of the zzz logger because of the name. Logger names determine relationships. A logger named zzz.yyy would be a direct child of zzz. zzz.yyy.XXX is a direct child of zzz.yyy. Therefore, when you configure the zzz logger, you're also configuring the zzz.yyy logger and the zzz.yyy.XXX logger. Now assume that you configure an Appender for each one of zzz, zzz.yyy, and zzz.yyy.XXX: log4j.logger.zzz=FATAL, dest2 log4j.logger.zzz.yyy=FATAL, dest3 log4j.logger.zzz.yyy.XXX=FATAL, dest4 Then you call LogFactory.getLog(XXX.class). You've now got the zzz.yyy.XXX logger. What happens when you write something to it? Assuming you write a FATAL message, of course, it will be written to the dest4 Appender. And the dest3 Appender. And dest2 and dest1 as well. Logged messages by default travel up the hierarchy and are logged by every configured Appender, and remember that I said the root logger is the base of every logger hierarchy. To stop the message from traveling up the hierarchy, there is an additivity flag. Assume we want to write to the zzz.yyy.XXX logger, but not have it go to any of the others. You would set additivity to false on zzz.yyy.XXX, like so (I think): log4j.additivity.zzz.yyy.XXX=false By setting the additivity to false on zzz.yyy instead, you'd get messages logged to dest4 and dest3 but not the others. *whew*, that was longer than I'd planned. Hope it gets you going in the right direction. ============================================================================== TOPIC: "Memory as a Programming Concept in C and C++" http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5f48803ffc2cfdf4 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 3:22 am From: Casey Hawthorne I have just found a very interesting book: "Memory as a Programming Concept in C and C++" Frantisek Franek 2004 >http://www.amazon.com/exec/obidos/tg/detail/-/0521520436/qid=1102475743/sr=1-1/ref=sr_1_1/104-6753470-7335150?v=glance&s=books In switching some code from Java to C++ for efficiency considerations -- the main challenge is in moving from a garbage collector to your own memory management! Every mixed language/C++ programmer worth his/her pepper, should get this book! It's nothing to Sneeze At! -- Regards, Casey ============================================================================== TOPIC: A little optimization question: Local var allocation http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a6b24661ed590053 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 5:47 am From: Daniel Sjöblom Chris Berg wrote: > #1: > String st; > while (true){ > st=dis.readLine(); > if (st==null) break; > < do something else > > } > > > #2: > while (true){ > String st=dis.readLine(); > if (st==null) break; > < do something else > > } In this case the two approaches compile to identical bytecode (which you could have verified yourself), so there is not much to discuss. Even if they didn't, worrying about this kind of microoptimization is utterly futile. A better improvement to #1, #2 would be a more readable version: String str; while ((str = dis.readLine()) != null) { ... something } -- Daniel Sjöblom Remove _NOSPAM to reply by mail ============================================================================== TOPIC: Queue of Objects http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6b95b60f123d5be3 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 8:44 pm From: Chris Smith terminator <[EMAIL PROTECTED]> wrote: > I want to create a Queue contains many objects (e.g. numbers) then sort > these objects. > if any one have an idea about that it will be appreciated. Then you must not really mean a strict queue, since sorting would be antithetical to the purpose of a queue. However, if you just want a list of Objects, see java.util.List (and its implementing classes) and the java.util.Collections class in the API docs. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ============================================================================== TOPIC: Can Java Programmer Learn C++ Quickly? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 7:52 pm From: Chris Smith Ian T <[EMAIL PROTECTED]> wrote: > > Pratically, except for the absence of garbage collection, I don't seem > > much difference between C++ pointers and Java references. You can do > > more things with C++ pointers, and if you do, it can become difficult, > > but you don't normally worry about things like pointer arithmetic unless > > you are writing low level software, like a garbage collector. > > IIRC, the containers use pointer arithmetic for iterators. You're half right; it's not pointer arithmetic, but operator overloading is used to make it look the same as pointer arithmetic looks in typical C code. IMHO, this is far more confusing than pointer arithmetic ever was, but it's still not prohibitive to understand. Devoting months to getting it is, frankly, ludicrous. > > It's been ages (something like fifteen years) since I've used a null > > terminated character string in C++ other than at a C interface. In > > fact, if someone starts talking about null terminated character strings > > in C++, I pretty much take it as a sign that he doesn't know C++. > > As you don't offer up your alternative, I'll just take that as a > personal slur. I think it pretty much goes without saying. C++ has a std::string class (actually a template specialization rather than a class per se, but that's immaterial). You should use it if you're writing C++. #include <string> -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ============================================================================== You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer" group. To post to this group, send email to [EMAIL PROTECTED] or visit http://groups-beta.google.com/group/comp.lang.java.programmer To unsubscribe from this group, send email to [EMAIL PROTECTED] To change the way you get mail from this group, visit: http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe To report abuse, send email explaining the problem to [EMAIL PROTECTED] ============================================================================== Google Groups: http://groups-beta.google.com
