Off Topic: Hidden Features of Java

Happy Friday everyone,
I stumbled upon this conversation on Stack Overflow last night about "hidden" features of Java. Although I knew about most of them (mostly learned from reading posts here in the past few months), thinking about less-often used features of the language is a fun refresher (at least for me).
Can anybody think of any more "hidden" features of Java? Or just something interesting that not many people are familiar with?
Here's the link: [http://stackoverflow.com/questions/15496/hidden-features-of-java|http://stackoverflow.com/questions/15496/hidden-features-of-java]
Edit- To make things a bit more interesting, I'll throw some Dukes at people who show me interesting things.
Edited by: kevinaworkman on Nov 13, 2009 7:56 AM

dcminter wrote:
Here's one I banged my shins on the other day. Comparator may change Set semantics:It's always bothered me that TreeSet relies on Comparator to define equality.
Note that the ordering maintained by a set (whether or not an explicit comparator is provided) must be consistent with equals if it is to correctly implement the Set interface. It bugs me because it's not an explicit requirement of Comparable or Comparable. Therefore, if I did:
set.add("Hello");
System.out.println(set.contains("World"));I would expect false to be printed (in other words, like HashSet, I would expect it to do a final equals() to make sure). But it's not.
However, in your example, it's easy to see why TreeSet could not possibly allow that. If you added 2 Objects that were comparatively equal, it would be impossible to traverse the tree to find anything.

Similar Messages

  • Off topic:  Resultset  for to Java

    Hi
    How can I return resultset to Java ?
    How many ways is there ?
    Where can I to find examples (Oracle/Java )
    thank you in advance

    How can I return resultset to Java ?by ref cursor
    Where can I to find examples (Oracle/Java )http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/oraint.htm#i1058743

  • OFF Topic: JAVA Credit Card Processing

    Hi All,
              This might be a bit off topic ...but I was wondering if any of you have used
              any payment processing service to process credit card using Java Servletes
              ...I'd like to know which one (CyberCash, CreditCard.com etc) has APIs that
              can be integrated with a Java Servlet ...
              Any comment is appreciated.
              Thanks
              farhang
              

    Bryan Kearney wrote:
              >
              > We have looked at PaylinX and CyberCash. PaylinX has a Java Class which you can
              > use to connect to the NT only server. CyberCash, while internet based, can only
              > suppl static C libraries. Not very Java Freindly.
              >
              > >
              > > This might be a bit off topic ...but I was wondering if any of you have used
              > > any payment processing service to process credit card using Java Servletes
              > > ...I'd like to know which one (CyberCash, CreditCard.com etc) has APIs that
              > > can be integrated with a Java Servlet ...
              > > Any comment is appreciated.
              CCVS from Red Hat (http://www.redhat.com/products/ccvs/) has a Java api.
              We use CCVS but not the Java api so I can't comment on it.
              George
              [email protected] ITServices, UBC
              Programmer/Analyst
              phone: 604.822.4375 fax: 604.822.5116
              

  • Slightly off topic: JDev + 10g + recommended laptop

    Hi gang
    This is a slightly off-topic post in the forum. Apologies to the forum moderators up front.
    I'm in the process of purchasing a new laptop for development. Among other things I need to run Oracle 10g, + JDev + Solitaire.
    My assumption for such a laptop is I'll need a fast hd (7200rpm+) for builds, and lots of memory to run Oracle 10g and memory hogging Java JDev. Also extra screen real-estate would be ideal with the multi-pane JDev.
    However without the ability to walk into a laptop supplier, load up the software and do some tests, I'm not sure what would be sufficient. I don't want to go overboard on features in order to save $s, but I don't want something that wont run fast enough without bugging the Hell out of me either.
    Does anybody have any recommendations on what laptop they are currently running or what they would buy to run Oracle 10g + JDev? Are my assumptions correct or does anybody run this config with less, happily?
    Any help appreciated.
    Cheers,
    CM.

    I have been doing all of my jdev + oracle development exclusively on my PowerBook G4 for over a year now. JDev 9.0.5.2 runs great, and so does the new 10.1.3 preview. I have upgraded the memory on it to 1.5 GB, but even with the stock 512 it ran well. Plus, there are all of the productivity benefits from running Mac OS X. I was skeptical about it at first, as you might be, but once I switched over, I haven't even looked back. The 17 inch screen is beautiful, it works just fine on the Windows network at work, has all of the Unix tools underneath, and for the very few times a windows machine is needed, Virtual PC helps out. Do yourself a favor and check it out.
    Mike

  • Request to have off-topic posts moved

    There are a number of posts accumulated in the Server and Storage Systems group of forums that are just not on-topic for them.
    Generally they've been posted by people that care to not read anything nor drill down to an appropriate forum and just dump a question.
    I've done the "report abuse" routine on a number of them but that seems to have been ignored.
    Thus this new post.
    These are from the last 60 days:
    (need to be moved to a Glassfish forum)
    How to start Galssfish when computer start
    Glassfish 3.0.1 updatetool
    http://forums.oracle.com/forums/thread.jspa?threadID=2128052
    war for modify domain.xml in glassfish 3
    Glassfish 2.1 + JPA 2: need some Sun/Oracle expert advice
    (topics for Sun Java System "whatever" applications, posted to server forums)
    AMPostAuthProcessInterface redirect problem
    http://forums.oracle.com/forums/thread.jspa?threadID=2127174
    Weblogic Spring/Sample Application Help
    Cannot add new LDAP Group Members in Sun Java Server 7.0
    http://forums.oracle.com/forums/thread.jspa?threadID=2134347
    Help with iPlanet
    iText vs Jasper Java Application Source Code
    OpenMQ Unack'ed messages causing Java Heap overflow in STOMP
    (database product questions posted to System Administration and hardware forums)
    how can i release lock record?
    Oracle for Mac
    Problem using TNS_ADMIN in registry (Ora. 11g R2 Instant client in Win. 7)
    http://forums.oracle.com/forums/thread.jspa?threadID=2154755
    /opt/SUNWwbsvr7/bin/wadm exited with error: 125
    Performance Testing tool
    ORA-00202 and Fractured block found during control file header read
    Performance Monitoring
    Reg : Weblogic Server Installation
    how can export from 11g to 9i
    What's wrong with oracle database11g? Is it a serious problem?
    Client download link needed
    http://forums.oracle.com/forums/thread.jspa?threadID=2149037
    Oracle 10G on VMware Redhat Linux
    http://forums.oracle.com/forums/thread.jspa?threadID=2138098
    I Can't Connect to Oracle
    what is the function of autoextensible field in dba_data_files?
    http://forums.oracle.com/forums/thread.jspa?threadID=2139323
    databse copy
    Advice needed regarding Database design practice
    enterprise manager
    http://forums.oracle.com/forums/thread.jspa?threadID=2128320
    Problem with granting privileges
    Inatalling IDM 11g on WondowsXp machine
    Any good resources for info on specifications for a new 11g install?
    During installation EMCA trows an error: Error uploading configuration data
    I received Validation error in the Backup Setting
    RMAN RESTORE
    Find the user(s) using more CPU in a database
    Oracle 10g 64-bit database on Windows 2008 R2 (64-bit) error ?
    http://forums.oracle.com/forums/thread.jspa?threadID=1554073
    Temporary tablespace not cleared
    TNS -12541 TNS: no listener
    Installing Oracle 11g on a server without network access
    RMAN Shows the following error... Please any one can help me....
    http://forums.oracle.com/forums/thread.jspa?threadID=2137784
    java.lang.Exception
    http://forums.oracle.com/forums/thread.jspa?threadID=2138186
    ORA-12543 When creating a new oracle instance, Oracle 11g
    Problem with Uninstalling Oracle 11.2 on Windows Server 2008
    problem installing mod_plsql oracle 11g linux
    Best practice for install oracle 11g r2 on Windows Server 2008 r2
    ORA-12535: TNS:operation timed out
    http://forums.oracle.com/forums/thread.jspa?threadID=1982259
    move datafile/tablespace in a partitioned table
    Orace 11g CRS installation ( windows server 2008 64 bit )  Error
    Datapump import from a map drive
    http://forums.oracle.com/forums/thread.jspa?threadID=1982528
    http://forums.oracle.com/forums/thread.jspa?threadID=2126409
    http://forums.oracle.com/forums/thread.jspa?threadID=2126802
    Oracle Startup/Shutdown with SQLPLUS and ORADIM in Windows...
    http://forums.oracle.com/forums/thread.jspa?threadID=1574872
    http://forums.oracle.com/forums/thread.jspa?threadID=2123572
    http://forums.oracle.com/forums/thread.jspa?threadID=2041227
    http://forums.oracle.com/forums/thread.jspa?threadID=2077085
    http://forums.oracle.com/forums/thread.jspa?threadID=2069660

    If these last few are pruned out of the SysAdmin forums, that should finish the housekeeping task. They're the most recent entries of off-topic questions.
    database postings to the SysAdmin forums
    Backup database with RMAN
    sql*NAT?
    How can convert Oracle 10g trial to License
    http://forums.oracle.com/forums/thread.jspa?threadID=2160796
    Visual Web Developer 2010 Express and Oracle ODAC - Oracle data provider
    http://forums.oracle.com/forums/thread.jspa?threadID=2160572
    Huge amount of "db file sequential reads" while INSERT APPEND operation
    http://forums.oracle.com/forums/thread.jspa?threadID=2160410
    Oracle Universal Installer - Toad - Virtual Machine Windows 7 on Mac
    What to check or can say from where to start?
    Where and how does oracle store tables?
    Oracle net configuration assitant failing while installing Oracle 11g.
    Resolving Mview Complete Refresh Performance
    Problem with silent install of 11gR1 on Windows 2008
    http://forums.oracle.com/forums/thread.jspa?threadID=2157067
    ORA-01991: invalid password file
    Sequences incorrect after exporting and importing a scheme
    http://forums.oracle.com/forums/thread.jspa?threadID=2153592
    http://forums.oracle.com/forums/thread.jspa?threadID=2149027
    http://forums.oracle.com/forums/thread.jspa?threadID=2128320
    http://forums.oracle.com/forums/thread.jspa?threadID=2137784
    http://forums.oracle.com/forums/thread.jspa?threadID=1982259
    http://forums.oracle.com/forums/thread.jspa?threadID=1574872
    http://forums.oracle.com/forums/thread.jspa?threadID=2123572
    http://forums.oracle.com/forums/thread.jspa?threadID=2041227
    http://forums.oracle.com/forums/thread.jspa?threadID=2077085
    http://forums.oracle.com/forums/thread.jspa?threadID=2069660
    http://forums.oracle.com/forums/thread.jspa?threadID=2113069
    http://forums.oracle.com/forums/thread.jspa?threadID=1981627
    http://forums.oracle.com/forums/thread.jspa?threadID=1981082
    http://forums.oracle.com/forums/thread.jspa?threadID=1981287
    http://forums.oracle.com/forums/thread.jspa?threadID=1979404
    http://forums.oracle.com/forums/thread.jspa?threadID=1955376
    http://forums.oracle.com/forums/thread.jspa?threadID=1844213
    http://forums.oracle.com/forums/thread.jspa?threadID=1773975
    http://forums.oracle.com/forums/thread.jspa?threadID=1773059
    http://forums.oracle.com/forums/thread.jspa?threadID=1555844
    http://forums.oracle.com/forums/thread.jspa?threadID=1555363
    http://forums.oracle.com/forums/thread.jspa?threadID=1554035
    http://forums.oracle.com/forums/thread.jspa?threadID=1518192
    http://forums.oracle.com/forums/thread.jspa?threadID=1272113
    http://forums.oracle.com/forums/thread.jspa?threadID=1134136
    http://forums.oracle.com/forums/thread.jspa?threadID=1938192
    Again, the community moderators don't have permissions to do that.
    Thanks

  • Off topic question in DOS Batch files ...

    Hi,
    I am sorry in advance, for posting an off-topic question. But I had no other known way.
    I need to invoke 8 sessions of a java program on 8 different windows. I use Windows platform. I want to write a batch file that will cause the java program to be invoked on a separate window, so that I can watch the execution of 8 sessions at a time. How can I do this (specifically, how can I open a new window in batch files in DOS)?
    Thanks in advance,
    K
    My java program invocation is like this:
    C:\>java Site i
    where i is a command line argument that will go from 0 to 7.

    Batch files (to my limited knowledge) are just "macros" that procedurally run DOS commands. It's just like opening a new command window and sitting there typing a list of commands, except the computer does it for you. So, for example, to run the commands java HelloWorld and cls, the java program would first have to execute before the screen can be cleared. For your purposes, you may need a small launcher app.

  • Need a good off-topic thread to read

    i'm bored and need a good off-topic thread to read whilst i sit at work.

    This thread nearly made me fall on the floor.
    http://forum.java.sun.com/thread.jsp?forum=54&thread=34
    622yeah. i kept up with that one as well...
    i personally liked this one...
    http://forum.java.sun.com/thread.jsp?forum=406&thread=348808&tstart=0&trange=15

  • MQ, eSQL and CLOBs (Off Topic)

    Hi,
    Apologies for this way off topic post, but I figured someone here may know the answer to this one and save me some time digging / testing.
    We're designing a middleware hub using WBIMB (MQ) v5 and have the option of
    a. Sending a message to a JMS Listener that will write an entry in a database via JDBC
    b. Having the broker flow insert the record using a compute node / java node.
    If we choose option b my preference would be to use eSQL, but the database table has a CLOB column and I'm not sure whether this is supported.
    Any ideas?
    Thanks for your help,
    Steve

    Hello Huffer Many thanks for your prompt reply. I have been doing a bit more research and came across an old spec for a "lenovo" hard-disk (HDD) with 320GB capacity used in numerous ThinkPads. Unfortunately it does not include the X300 model that i have. The full details can be found HERE. The height of the HDD is 7 (SEVEN) mm. I may be paranoid but can you please just confirm that the lenovo X300 ThinkPads (see full details above) with the 320GB HDD really have a height of 9.5mm and so will be able to take the HDD 2.5" with 2TB that I plan to buy. If the height really is only 7m then I have a problem.  Then I think that i will have to go up my idea of increasing the storage space. If you cannot answer the question with 100% certitude then I will have to reopen the laptop and measure the space available but that is a pain since I am new to all this and afraid of damaging the HDD. Thanks. Cheers. Steve.  

  • Question a lil off topic

    i have a question that may be a lil off topic from java but i want to put a counter on my web page
    i need to know were my perl executable file is and i cant find it it says to type in whereis perl from the unix shell but the server is running iis2 on nt4 and i havent a clue of how to get to the unix shell if thier even is one if anyone knows how tell me or if their is a way to do this in java tell me
    and if no one knows its ok cause this is the java forum hehe but i figure someone on heres probably delt with this before
    thanks in advance

    If it is on an NT box, you probably don't need the #! line you would need in UNIX as there is probably a file association for .pl or .cgi for the Perl executeable.

  • Off topic message

    I know this is off topic, but can you tell me how can I subscribe to usenet to com.lang.java?
    Thanks.

    There is a good free new reader available called "Forte Free Agent"
    http://www.forteinc.com/main/homepage.php
    You'll also need to find out the ip address of the usenet server for you Internet Provider.

  • Off topic  :  Tools Toad

    Hi
    Sorry for Off topic, But I would like to know how can I to configure Toad for to show
    Tablespaces when show Script Table and where can I to configure for to show each column in line, because It show as
    CREATE TABLE myscheme.MYTABLE ( VL_TOTAL_PEDIDO_DOLAR NUMBER(15,2), NM_CICLO_ESTATISTICA NUMBER(6), NM_SEMANA_CICLO NUMBER(2), NM_SEMANA_MES NUMBER(2), DT_ESTATISTICA DATE, NM_PEDIDO NUMBER(10) NOT NULL, ID_TIPO_OPERACAO NUMBER(2) NOT NULL, DT_GERACAO_MOVIMENTO DATE NOT NULL, CD_CONSULTORA NUMBER(10) NOT NULL, CD_REGIAO_ESTRATEGICA NUMBER(6) NOT NULL, CD_GERENCIA_VENDA NUMBER(6) NOT NULL, CD_SETOR NUMBER(6) NOT NULL, CD_GERENCIA_VENDA_SEGMENTO_CN NUMBER(6), CD_SETOR_SEGMENTO_CN NUMBER(6), ID_TIPO_CN NUMBER(2) NOT NULL, CD_SEGMENTO_CANAL NUMBER(2) NOT NULL, CD_SEGMENTO_PEDIDO NUMBER(2) NOT NULL, SG_UF CHAR(2 BYTE), CD_CIDADE CHAR(9 BYTE), DT_PEDIDO DATE NOT NULL, NM_CICLO_PEDIDO NUMBER(6) NOT NULL, DT_LIBERACAO_PEDIDO DATE, NM_CICLO_LIBERADO NUMBER(6), QT_PONTOS_PEDIDO NUMBER(10) NOT NULL, QT_ITENS_PEDIDO NUMBER(10) NOT NULL, VL_TOTAL_PEDIDO NUMBER(15,2) NOT NULL, ID_PEDIDO_INICIO NUMBER(2), DT_DIGITACAO DATE, ID_MEIO_CAPTACAO_PEDIDO NUMBER(2), CD_CONSULTORA_RELACIONADA NUMBER(10), ID_CENTRAL_PRESENTE NUMBER(2), CD_REGIAO_ESTRATEGICA_PRECO NUMBER(6), CD_GERENCIA_VENDA_PRECO NUMBER(6), CD_SETOR_PRECO NUMBER(6), CD_TIPO_ESTRUTURA_COMERCIAL NUMBER(4), CD_ESTRUTURA_COMERCIAL NUMBER(6), DT_FATURAMENTO DATE, ID_SITUACAO_PEDIDO NUMBER(3), CD_CENTRO NUMBER(5) ) LOGGING NOCOMPRESS NOCACHE NOPARALLEL MONITORING;

    I think he wants to generate the 'create table' script in TOAD and to have it all on one line as well as include the tablespace name.
    TOAD has too many options and it's probably hidden somewhere in there.
    Message was edited by:
    stellios.k

  • Off topic: posting XML/HTML in these forums

    How do you post XML to these forums? Encoding the < as > just gets interpreted as a literal, but using straight XML doesn't work because if there's overlap with HTML, the XML gets formatted as HTML. Here's an example -- if you have an XML tag called "s" (< s n a m e = " f o o " > b a r < / s > ), look what happens (because of the strikethrough HTML tag): <s name="foo">bar</s>.
    Sorry to post off-topic!
    Chris Bucchere | bdg | [email protected] | www.bdg-online.com

    Hello red_menace,
    Indeed a pre-processing code like yours is always an option for us, but from my point of view, the correct solution is for the discussions' admins to disable this meddlesome formatting feature of the new fora software.
    This new feature affects not only new posts but also the existing messages in the fora, that means it has rendered quite a few useful messages totally useless. This is actually serious data loss caused by the thoughtless software. And for what?
    After all, these discussions' boards are not chat rooms where people might want some simple input methods for fancy text formattings, but technical support fora where people frequently post programming codes, computer outputs and so forth that have many reserved symbols and notation.
    I really wish they may fix this promptly.
    Best regards,
    Hiroto

  • Off Topic - Cameras - 30D, 5D or D200?

    Hi there, I'm a non-pro frequenter of the Apple discussion boards, I know this is off topic but I'd sure appreciate some quick advice, I need a camera ASAP for a work project and I don't have time to do the research that I should I'm hoping somebody here can give me a concise answer. My choices so far are narrowed down to the Canon 30D, the Nikon D200, and possibley the Canon 5D can any one recommend which would be the better camera for image quality when used by a non-pro (although I do have some technical experience and don't have a problem using a camera in manual mode). Main point is the image quality at the end of the day, and also the better investment as a camera. Mostly I don't want to get an over priced dudd... I've heard the 5D is good but over priced - anyway.... any help anyone? I'd really appreciate it.
    Many Thanks,
    Miklos.

    My choices so far are
    narrowed down to the Canon 30D, the Nikon D200, and
    possibley the Canon 5D can any one recommend which
    would be the better camera for image quality
    All those cameras and many less expensive others when used with top quality Nikon/Canon lenses are capable of providing excellent image quality when used with a (very essential) pro quality tripod and head plus remote shutter release (add $500-1000 for those if you intend to build a rig at the pro end of things). The 5D is slightly more capable of the best low light images in the group, but at a cost of more than twice as much. The lenses you choose will be much more relevant than the individual cameras - and should accordingly represent more than half of your expenditure.
    The choice between Nikon and Canon should be made by handling the cameras in your short list. Hopefully ignoring the BS that salesman insists on telling you.
    Main point is the image quality at the
    end of the day, and also the better investment as a
    camera. Mostly I don't want to get an over priced
    dudd... I've heard the 5D is good but over priced -
    anyway...
    DSLRs are not investments per se as cameras any more than computers are. DSLR values will decrease over time, but they invest extremely well in your productivity as a photographer.
    IMO since you are relatively inexperienced in this dynamic world of DSLR you should start at the $1500 range for camera body only and add high quality lenses. If you choose Nikon, for indoors architecture I recommend the excellent 10.5mm fisheye that using software can provide rectilinear images, the excellent 12-24mm, and a f/1.4 50mm. At the tele end I like the 70-200mm VR, but an 18-200mm would probably suit for photojournalism type shots.
    If you choose Canon there are equally excellent lenses available. I recommend against third party lenses because they typically will not support all the features of modern Nikon/Canon DSLR systems in the future even if they do so today.
    Note that although architectural is often shot with DSLR (including by me), highest quality architectural images are not created with DSLR cameras. They are shot with medium format film view cameras that allow extensive tilts and swings within the camera body. The use of such cameras makes a huge difference.
    -Allen Wicks

  • Off topic: Webhosting in the UK...which one?

    HI,
    Sorry for the off topic question.
    Does anyone know a reliable, cheap webhosting? Iv got a website, and i'd like to put it on the net. I don't need any special features.
    I'm looking for the cheapest / most reliable on the net.
    Also, are there server specially designed for mac made website?
    Cheers,
    Dave

    Here is an alternative
    How to manually update 2011 Xperias to android 4.0.4
    http://talk.sonymobile.com/thread/38251
    Don't forget to mark the Correct Answers & Helpful Answers
    unrelated topic, if you have some time please check this thread
    http://talk.sonymobile.com/thread/44888
    "I'd rather be hated for who I am, than loved for who I am not." Kurt Cobain (1967-1994)

  • Forums: Off-Topic tags

    Hi,
    It is very common to see off-topic posts in forums as discussions usually engender new questions, shared experiences, etc... Anyway, could we imagine an OT tag that would, for example, color text or frame it or whatever, in order to make it easy to sort what's OT and what's not ?

    [OT=avatar]
    [OT=avatar]what an odd avatar you have[/OT]
    That's my japanese pacman under steroids[/OT]
    If you want to go extra features right now, options to show/hide [OT][/OT] could be nice too (like the spoilers tag on some movies forums with show or hide as default in your profile)
    Last edited by bangkok_manouel (2008-02-01 10:20:37)

Maybe you are looking for

  • Create a table view in my BSP Application!.

    Hi All, I am using CRM version 4.0 here i want to crate a new table view in my own BSP Application and want to display in the CRM_IC Application. The problem now i am facing is.. there is now provision to create the table view via the wizard. I tried

  • How can I make the UITableView go away?  The New NIB opens behind it

    The new NIB opens behind the table and the table doesn't animate away. I am using a TabBar Application if that makes any difference. Thanks!! - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath NSInteger row =

  • Cannot open connection in a peer-to-peer netword

    I created a peer-to-peer network between two PDAs loaded with Windows Mobile 5.0. It is shown that both of them were connected, and their IPs were assigned automatically.  But when I used TCP/IP Open function, it returns an error 10060 'Cannot open c

  • Cursors for strip chart controls?

    I'm using a strip chart control to plot data during real-time.  I allow the operator to pause the chart to view old data.  The operators would like to be able to see a specific value when the chart is paused,  either by enabling cursors, or clicking

  • Undo Tablespace Reuse

    Hi, I am using 10.2.0.3.0 on Oracle Solaris 5.10. I have an undo tablespace 'UNDOTBS1' which has 5 data files of sizes 60GB. Here are my undo parameters: SQL> show parameter undo NAME                                 TYPE        VALUE undo_management