What is T , M , ... etc

I have recently noticed a couple "tags" in the source code of Sun's classes. I say "tags" because they are always enclosed in '<' and '>'
An example is java.util.Date
public class Date
    implements java.io.Serializable, Cloneable, Comparable<Date>Notice the <Date> after Comparable.
Now, if we look at the source code for java.lang.Comparable we'll see following two lines:
public interface Comparable<T>
public int compareTo(T o);1. What is this <T> and what kind of object is the 'T' in the compareTo() method?
2. Is it similar to Templates in C++ ?
3. When was this implemented? Was it always there and I just didn't notice it all those years?
4. How can I use it in my programs?
I searched online for any kind of documentation about it, but I can't find anything.. Is it some kind of a mystic feature that we're not supposed to know about or did I miss something? :-)
Thank you for any kind of input.
Nick

1. What is this <T> and what kind of object is the 'T' in the compareTo() method?
You get to specify the class of T. For example, if you create a List<String>, then you have a List of strings, whereas List<Wakka> produces a list of wakkas.
2. Is it similar to Templates in C++ ?
In all the ways that have mattered to me when I have used them over the past year. The documentation on generics goes in depth about all kinds of nooks and crannies that I have never had reason or desire to explore, just like templates in C++. Does that make me a bad person? ;)
3. When was this implemented? Was it always there and I just didn't notice it all those years?
As of 1.5. Ooh, new and shiny!
4. How can I use it in my programs?
How, or why? I would take a look at some of the documentation on generics for syntax, and since you're somewhat familiar with templates in C++, you likely have an understanding of generics enough to make use of them. Maybe you'll even learn something I've gotten wrong here and/or been too lazy^H^H^H^H busy to discover on my own. :)
Hope this helps at least a little, maybe one of our more eloquent friends will jump in with something even more enlightening?
- Kyle

Similar Messages

  • My kids have been playing on my iMac and I now have a black box on the screen that describes where the cursor is or what I am typing etc.

    My kids have been playing on my iMac and I now have a black box on the screen that describes where the cursor is or what I am typing etc.
    Can anyone help me with removing this box
    I thought it might be subtitles but not sure?

    How about asking your kids? 
    Care to share which OS you are using? 

  • Can not use feacebook whats app app world etc.

    my Z 10 app world will not do any updates the error message is that there was an error processing your request help me please can not use feacebook whats app app world etc.
    Subject Title edited to reflect new topic.

    Restart or take out the Battery ( Battery Pullout ) and insert it after few minutes
    Regards Eree - Follow me on Twitter - Facebook - Google+
    For More visit My Blog

  • Which account is running what service, app pool etc.

    HI all,
    Does anyone know if there is a quick and easy way to establish which domain account is running what service/app pool etc. within the farm?
    Thanks in advance.

    Hi Geoff,
    The Configure Service Accounts page gets its information from different sources I believe:
    - Farm Account
    - Windows Services related to SharePoint
    - Web Application Pools (Accounts running your Web Applications)
    - Service Application Pools (Accounts that are running your Service Applications)
    In order to retrieve this information, you would have to create a script that would do the same.
    I don't have a script for that. Maybe someone else already has this script.
    Nico Martens - MCTS, MCITP
    SharePoint Infrastructure Consultant / Trainer

  • Does the sprint unlocked iPhone works in Pakistan and what are the charges etc.

    Does the sprint unlocked iPhone works in Pakistan and what are the charges etc.

    Verizon iPhone 4S SIM UNLOCK Tutorial
    SGMD1 Oct 19, 2011 9:40 PM  
    Currently Being Moderated
    Verizon has confirmed (here and here) they WILL unlock the SIM on the iPhone 4S, allowing for use of local SIM cards while traveling abroad (no word yet on whether this will allow for use on AT&T and T-Mobile.) This is different than the jailbreak unlocking method; SIM unlocking through Verizon is permanent and will not affect your warranty in any way.
    1. Meet the following requirements:
    * Must be a Verizon Wireless customer.
    * The iPhone 4S being unlocked must be active on a Verizon Wireless line of service.
    * The line of service must be active at least 60 days.
    * The line of service must be in good standing for the past 60 days.
    * Only one SIM Unlock per line every 10 months.
    If you don't meet one or more of the above requirements, call anyway. You may still get lucky.
    2. Insert a foreign SIM into the SIM card slot on the side of your phone (only required to confirm that the unlock is successful.)
    3. Call 1-800-711-8300 (Verizon Global Support) and ask the representative for a SIM unlock. Occassionally a representative may not know exactly what you are referring to; make sure you are not transferred to a different department. You are in the right place. Explain that they should have a walkthrough on how to do this, and that it allows for the use of local, non-Verizon SIM cards while traveling abroad.
    4. Get confirmation from the rep that the unlock has been applied to your account, then check your phone to make sure it recognizes your SIM and can connect (if successful it will roam on AT&T, assuming you are calling from the USA.) You will NOT see an unlock confirmation in iTunes as that is for a factory-applied unlock only.
    5. Enjoy your new unlocked iPhone 4S!
    ****ALSO I JUST SPOKE WITH NICHOLE (VZN GLOBAL SUPPORT) REGARDING IF THE IPHONE 4S HAS TO BE ACTIVE AFTER SIM UNLOCK AND THE ANSWER IS: NO!

  • What is oratab and etc/oratab location?

    what is oratab and etc/oratab location?

    ORATAB is usally located in:
    /etc/oratab
    or
    /var/opt/oracle/oratab
    it is only available on *nix systems so if you have Oracle on Windows oratab is irrelevant.
    sample entry:
    MOB92:/u01/app/oracle/product/9.2.0:N
    Where MOB92 is db name
    /u01/app/oracle/product/9.2.0 - is ORACLE_HOME
    N - is variable used by dbstart script to specify if this database should be started automaticlly when server start (to perform auto start of Oracle dbs, sometimes more steps are required)
    Basicly oratab describe all instances located on the server, it is used by Oracle Utilities, for example OUI
    Best Regards
    Krystian Zieja / mob

  • What is opening, reading etc dataset

    Hi all,
    What does the following code do?
    I do not know why to open a dataset etc.
    Thanks in advance.
    Deniz.
    *-- Open dataset for reading
    DATA:
      dsn(20) VALUE '/usr/test.dat',
      rec(80).
    OPEN DATASET dsn FOR INPUT IN TEXT MODE.
    IF sy-subrc = 0.
      DO.
        READ DATASET dsn INTO rec.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
          WRITE / rec.
        ENDIF.
      ENDDO.
    ENDIF.
    CLOSE DATASET dsn.
    *-- Open dataset for writing
    DATA rec(80).
    OPEN DATASET dsn FOR OUTPUT IN TEXT MODE.
      TRANSFER rec TO '/usr/test.dat'.
    CLOSE DATASET dsn.

    Hi..
    <b>OPEN DATASET dset FOR access IN mode [position]
                                         [ os_addition]
                                         [error_handling].</b>
    <b>Effect</b>
    This statement opens the file specified in dset for the access specified in access in a storage mode specified in mode. For dset, a character-type data object is expected, which contains the platform-specific name of the file.
    Use additions position, os_addition and error_handling to determine the position at which to open the file, to specify platform-specific additions and to influence error handling.
    In Unicode programs, the access and storage modes access and mode must be specified explicitly. If the additions are missing in non-Unicode programs, the file is opened implicitly as a binary file for read access.
    In Unicode programs, the file must not yet be open in the current program; otherwise a treatable exception occurs. In non-Unicode programs, the file may already be open. The statement <b>OPEN DATASET</b> then does not reopen the file but moves the read or write position depending on the access mode. In this case, you should not change the access or storage mode.

  • Help with advanced 'Adjust' settings; how far to go, what to do first, etc.

    Although my camera is fairly rubbish, I'm trying to make my digital photos look the best they can in iPhoto.
    I'm tweaking the Adjust settings; Brightness, Contrast, Saturation, Sharpness, Exposure etc. but at the moment I'm more or less tweaking randomly until I get something I think is better.
    More guidance would be appreciated; is there more of a science involved? - What order is it best to do the things in? How do the controls differ from each other?
    Also, I'm always wary of going too far with the sliders. How far is too far? I know that it is possible for a photo to look instantly better without objectively being so; for example, always brighter, sharper images with more contrast tend to look better at first, until the novelty wears off of course.
    Should I be using the Histogram at the bottom? How does that work? What should I be looking for? What would the ideal histogram look like?
    Any tips you can tell me to make my pictures better would be gratefully appreciated.

    This is in iPhoto 7, yes? I ask as you've posted in the v5 forum.
    This is all "rule of thumb" stuff - general guidelines rather than hard and fast rules.
    1. Work from top to bottom in the Panel: The lower options depend on the upper ones...
    Get the Light right (Exposure then contrast), then fix the highlights and shadows (which are dependant on the light...) then your colours and finally the sharpness (and because that can introduce visible 'noise') and the noise reduction.
    2. The Histogram will tend to a bell-shaped curve.
    3. Some very crude definitions:
    Exposure is the amount of light in the picture - this can be too little, too much or just right
    Contrast is the difference between the different colour and light states, this can be increased or decreased and can help the definition of the photo and the objects in it
    Highlights: bits of the pic that might still be over-exposed even though you've fixed the exposure and they can be toned down
    Shadows: The bits that are under-exposed...
    Saturation: How red is that red? How blue is that blue?
    Temperature: How white is that white? Blue white? Yellowy white?
    Tint: Overall warmth and cold
    Regards
    TD

  • How do you get the voice to come off your phone? for example it tells you that the phone is on, what app you used , etc...

    how do you get the voice to turn off when you turn on your iphone it tells you everything from "slide to unlock, messages, etc..."

    tripple click the home button and then turn voice over off... you can also access this from setting>general>accessibility right under vision

  • What does "PAYG WAP" etc mean when the SIM card is...

    I am on Vodafone contract, but under "WAP services" (a term which itself doesn't make any sense because "WAP" is no longer used for anything AFAIK, and used to run on 9.6k GSM dial-up) I see
    Contract WAP
    PAYG WAP
    WAP APN
    I can delete these but they keep coming back.
    Then there is Contract Internet which is what I would expect to see; that is under the "Internet" heading.
    If I start up Joikuspot, I see these
    WAP APN
    PAYG WAP
    PAYG MMS
    Contract Internet
    Contract WAP
    Contract MMS
    as options for what to connect to, of which all except "Contract Internet" doesn't mean anything.

    sounds a little strange, you need to ask your network carrier exactly which access point is for which function, as this is a user to user forum only for Nokia products and services.

  • In Logic 9 discs - what Jam Pck content etc is new?

    Hi all
    Please can anyone help?
    I updated to Logic 9 a few months ago but whilst in the middle of a movie score. Consequently I didn't update material like Jam Pack from my old Logic 8 set-up.
    Please can anyone tell me if there is much new stuff in for example the World Rfm section ....... or is what's in the content discs much the same as before?
    Anything world / movie type rhythm in this addition of Logic content discs?
    Thanks indeed for any info
    All the very best
    Dick

    Hi
    The only new content (over Logic Studio.. v 8) is the Voices Jampack (loops and instruments for the EXS)
    http://www.apple.com/ilife/garageband/jam-packs.html
    HTH
    CCT

  • What is g/n etc on an Airport Extreme?

    What is the difference between the two standards? Do you have to manually switch between them or does the AE recognise which devices need which standard? Sorry for the daft questions!!
    Thanks

    http://compnetworking.about.com/cs/wireless80211/a/aa80211standard.htm

  • What does "encryption keys etc. may be predictable" mean in the server logs

    I assume this is not an alarming issue, but thought I would ask...what is the significance of the message?

    http://discussions.apple.com/thread.jspa?threadID=1772227&tstart=0

  • What happened to "news", etc. and "most visited" at top of home page?

    I used to have items on the home page that I could click on such as "news" which would take me to a site with news sources where I could search for news topics and get the latest info on a topic. There was also a "most visited" tab I could click that took me to a list of some sites that I most went to. These have disappeared w/ the latest update.

    Firefox 4+ versions have a different default homepage - '''about:home''' - than earlier versions of Firefox had - http://www.google.com/firefox .
    Set your homepage to the Google / Firefox page, to get those links. <br />
    http://support.mozilla.com/en-US/kb/How+to+set+the+home+page
    As far as the "Most Visited", that should still be on the Bookmarks Toolbar, AFAIK. I know I have to delete that in every new Profile I create, but then again I am using Windows, not Mac OSX.

  • HT1338 What about open source, etc. apps?  Integration of Software Update into App Store, Apple registration a problem?

    A review in the Seattle Times recently indicated that in Mountain Lion all apps would have to be registered with Apple.  I use lots of 3rd party apps, many open source, that are unlikely to be willing to pay Apple to register.  I've been anxious about upgrading to Mountain Lion for this reason.
    The description in the Mountain Lion promo suggests to me that my concern may be inappropriate.  It looks like they've basically migrated Software Update into the App Store.  For most of the 3rd party stuff, Software Update is irrelevant.  As long as I can manage my 3rd party apps as I have traditionally done (some I never update, others notify me of needed updates when I use them - they check themselves), I don't mind if Apple has repositioned its automated update service for more mainstream apps including its own.
    Have I got this right, or should I be concerned about support for 3rd party apps and their maintenance?

    You are right. No concern.

  • Public private etc, what are they???

    I know what private & public are, but what is protected, synchronised etc. can anyone give me a full listing of all the types and quick defenitions??
    Shish

    There are so many of them. You best bet is a good java textbook. there are several free online.
    Bosun

Maybe you are looking for