a stupid question about the string conversion error

I learn generic

well generic allows setting the data type that you add to the fields of the object, right?

I made a simple example

class generic < String >

{

The name of the string;

void set (String name)

{myIdName = name ;}

String get() {return myIdName ;}

}

class using {}

Public Shared Sub main (String [] args)

{

generic < String > gn = new

(generics) < String >;

GN. Set (90);

System.out.println ("name entered is:" + gn.get ());

}

}

now the line

GN. Set (90);

I know that I send a string to the value method, but I wanted to see the error that comes when I send the argument of type other than a string and sent 90 to set method (without quotes)

the error that slammed me is

method defined in the class generic < String > cannot be applied to the given types

required: java.lang.String

found: int

reason: int real argument cannot be converted to a java.lang.String by method invocation conversion

corresponding to a variable of type String: String extends the object declared in the class generic

OK here is my stupid question

I know that int cannot be converted to a string and put 90 quotes will correct the error

What intrigued me is the last line

"Chain extends object declared in the class generic.


I know that everything is under the object class

that means that means line... ??

thnq

What intrigued me is the last line

"Chain extends object declared in the class generic.


I know that everything is under the object class

that means that means line... ??

Which refers to the class definition you provided:

generic class

You "stated" in your 'generic' class a 'collar' stretching ' the object '. It reads as if it said "String declared in the class generic.

See "Generic Types" in the Java Tutotial

http://docs.Oracle.com/javase/tutorial/Java/generics/types.html

Search for the word 'object' and you'll see that word highlighted in the world. Although it appears highlighted read this line:

As you can see, all instances of the object are replaced by T. A variable of type can be any non-primitive type you specify: any type of class, any interface, any type of table or even another variable of type.

On this page, you will see this:

A generic class is defined with the following format:

class name { /* ... */ }

Where each one is read as: T1 extends object ', "T2 extends object", etc.

When you said this:

generic class

You replaced "T1 extends object" with "String extends object".

Tags: Java

Similar Questions

  • A question about the number of error indicated by SQL line * more

    Hello everyone,

    OS: Fedora Core 17 x86_64
    Oracle version: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    I have a question for the line number specified by SQL * more whenever he is in error (syntax error, for example) in your script file. Consider the following script file (myscript.sql) which includes exactly 12 lines. Before the instruction to START I just put 4 blank lines by using - just to make the code clearer to read.
    HOST clear;
    SET SERVEROUTPUT ON;
    SET PAGESIZE 0;
    SET LINESIZE 1000;
    --
    --
    --
    --
    BEGIN
      DBMS_OUTPUT.PUTLINE('Hello');
    END;
    /
    DBMS_OUTPUT. PUTLINE at line 10 is obviously a mistake and it should be DBMS_OUTPUT. Put_line. However, if you run the script here is the output:
    SQL> @myscript.sql;
    
      DBMS_OUTPUT.PUTLINE('Hello');
                  *
    ERROR at line 2:
    ORA-06550: line 2, column 15:
    PLS-00302: component 'PUTLINE' must be declared
    ORA-06550: line 2, column 3:
    PL/SQL: Statement ignored
    
    
    SQL>
    for SQL * the error is in the line 2 and not 10.

    Any idea?

    Thanks in advance,

    >
    for SQL * the error is in the line 2 and not 10.
    >
    No - for Oracle, the error is in the line 2 and not 10.

    This is the code that sees the parser. What is the 2 line?

    BEGIN
      DBMS_OUTPUT.PUTLINE('Hello');
    END
    
  • Stupid question about the signing of applications made in Cascade

    Hello, I am sure that it is on the site somewhere and I'll be stupid.

    But how sign and get the files and is not so you can put a cascade of the project on the app world?

    Also its for blackberry 10

    Thank you

    Sorry, of course, once I put the post then I find a similar position

    http://supportforums.BlackBerry.com/T5/Cascades-development/error-sign-my-app-to-appworld/m-p/188930...

  • An error occurred when DNS was questioned about the resource record (SRV) service location used to locate a domain controller Active Directory (AD DC) for the domain 'HAMI. LOCAL ".

    An error occurred when DNS was questioned about the resource record (SRV) service location used to locate a domain controller Active Directory (AD DC) for the domain 'HAMI. LOCAL ".

    The error was: "an existing connection was to be closed by the remote host".
    (0 x 00002746 WSAECONNRESET error code)

    The query was for the SRV record for _ldap._tcp.dc._msdcs. HAMI. LOCAL

    Hello

    Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the Forums TechNet Windows 7 Technet.

    Here is the link:
    http://social.technet.Microsoft.com/forums/en-us/w7itpronetworking/threads

    Hope this helps

  • A few questions about the use of data and Cliq

    I have the cliq, however I chose to not get 3G (so I bought full fare). So I have a few questions about the phone and the use of 3G / 2 G/Edge:

    1 - is possible to disable completely the 2G / 3 G/Edge? I know you can switch between them, but are anyway just tell the phone to stop using them altogether since I'm not subbed to the service?

    2. when the update takes place, I guess we'll have to reconnect motoblur and etc, but if I don't have 3 G will I have motoblur connection problems after the update? Or he keeps the latest wifi settings so that it would connect to wifi to connect. When I first got my phone it was not a problem b/c I had 3G for the first month.

    I hope that makes sense, thanks!

    To stop all the data, I would like to download an application called APNDroid. He cut them all down. When you log on to blur you have 3G or WIFI doe this without getting a timeout error. During the process of setting up your Blur account, you can press the menu button and set up your wifi to work, this will connect you to Blur and your phone will be connected to the blur. If I were you I would be rethinking to do a data plan since you are really losing out on most of your main features of phones. It's your choice, however.

  • stupid question about UAC

    OK, it's a REALLY stupid question about UAC.

    I have several icons on my desktop. Some of them are games that must be run as administrator in XP compatibility mode.

    I rarely accidentally tried to open the icon, particularly if you use the keyboard to choose what I want.

    Is there a reason if I accidentally open a game that pushes me in height DO NOT hit 'Cancel' if I didn't intend to play the game at the moment, but trying to open something else? Something like a process being left in suspense, memory leaks, or any other reason why I can't Abort to launch the application to the UAC prompt?

    Hey, Slick,

    Clicking Cancel will prevent the running total process if you do not have to worry about the still ongoing services for memory leaks or game, etc..
    I hope this helps.
  • Questions about the management of specific nodes in different hierarchies

    Hi all

    I have a question about the specific management of some particular set nodes, which are located in different hierarchies within a same version.

    I want to know if there is any editing made to certain properties of these specific nodes or if the nodes are deleted/moved/edited approval to be triggered for the data manager.

    or should not allow users to edit (adding/moving/deleting/changing property values) or those specific members.


    According to my understanding of the nodes of domain prevents the removal of nodes, but I don't want my Member prefix/suffix, domain is the only way to prevent the change.




    Thanks and greetings

    Madhu

    We have an obligation to not allow a node to remove or deleted without the approval of the admin, so I created a Boolean property AllowDelete is false, which is substitutable, default and is available only in a category of property Admin, for which most of the users do not have access.  Then, I created a validation of PropRemove with an error message that tells the user to contact a user admin to remove or delete the node.  The admin can change the AllowDelete to true, then can either remove himself or to allow the user to do.

  • Questions about LR CC conversion

    I am a user of LR5/CS6 and planned to convert it into CC because it came out.  I have questions about the conversion process.  More precisely:

    1. I use a single catalog LR5.  Can I continue to use this same catalog LR CC or I have to create and populate a new catalog?

    2 will be my LR5 brushes, presets, calibrations etc camera automatically fill in LR CC or they will have to be reloaded?

    3 will be my actions CS6, adjustment presets, application frameworks, etc. automatically fill in PS CC or these will reloaded?

    I guess, overall, my question is: how transparent is the move to the CC?  Thanks in advance for any guidance you can provide including the pitfalls you've encountered.

    Richard

    Once you switch to LR CC or LR 6, you will have two files different catalogue (the catalogue LR 5 and LR 6 CC/LR catalog), but you should not use the catalogue LR 5 more. There is no benefit, just use the most recent catalog.

    Yes, your brushes and presets and calibrations automatically become part of the new catalog.

  • HTML (Web), I have a question about the models.

    Hello CC animate developers.

    New features are really good.

    HTML (Web), I have a question about the models.

    <! DOCTYPE html >

    < html >

    < head >

    < meta charset = "UTF-8" >

    < title > $TITLE < /title >

    < meta name = "ad.size" content ="width = $WT, height = $HT" > "

    $CREATEJS_SCRIPTS

    $SCRIPT_START

    var canvas, stage, exportRoot;

    function init() {}

    $CJS_INIT

    }

    $PLAYSOUND

    $SCRIPT_END

    < script type = "text/javascript" >

    "clickTAG" var = "";

    < /script >

    < / head >

    < onload = "init (); the body"style =" background-color: #D4D4D4; " margin: 0px; ">

    < a href = "javascript:window.open (window.clickTag)" >

    < div style = "position: absolute;" cursor: pointer; box-sizing: border-box; border: 1px solid #000000; overflow: hidden; height: $HTpx; Width: $WTpx; Background: rgb (255, 255, 255.0); "> < / div >

    < canvas id = "$CANVAS_ID" width = "$WT" height = "$HT" style = "background-color: $BG" > < / canvas >

    < /a >

    < / body >

    < / html >

    In the example above, the model;

    < Meta name = "ad.siz of" content = "width = $ WTI height = $ HT" > "

    and

    < Div style = "position: absolute;" cursor: pointer; box-sizing: border-box; border: 1px solid # 000000; overflow: hidden; height: $HTpx; Width: $WTpx; Background: rgb (255, 255, 255.0); "> < / div >"

    I use labels. But these tags in the template and import, it gives an error does not occur.

    I think it was a mistake. I want to help in this regard.

    $ HT or Properties $WT , I get an error when I use elsewhere.

    I think I should be able to use anywhere I want.

    The same problem here - I worked around by some DRM models with different values of ad.size, but it's a solution quite short-seight

    Also - you are not able to create the model with transparent background by removing style = "" background-color: $BG ' as it also throws errors - is the only solution that I managed to get updates style = "background-color: $BG; background: none; ", but it's a really bad way of coding things.

    It would be really great to have freedom in changing patterns.

  • Got a legal question about the installation of Adobe Photoshop Elements.  How to get help from Adobe using a chat session?

    Got a legal question about the installation of Adobe Photoshop Elements.  How to get help from Adobe using a chat session?

    AdobeTomFaith

    If your program is Photoshop Elements, then you have posted in the wrong forum. Some how your son got posted in the Forum Adobe Premiere elements (video editing). Please re-post your thread in the Adobe Photoshop elements Forum.

    Photoshop Elements

    Wherever your son is, please include Adobe Photoshop Elements version and operating system and the description of the installation problem (error messages, stage of failure, etc.)

    Support Adobe seems to be limited to Adobe cat and is classically limited to the current version which is 13. Then, you the best avenue to success is likely to be through the Adobe Photoshop elements Forum. But that shouldn't stop you trying to determine what kind of support you can get from Adobe cat on your question.

    I would offer this link that is specific for Adobe Chat download and installation

    Contact the customer service (this is not the same destination as shown in a previous post in your thread)

    This link is specifically designed for

    Photoshop Elements

    Download, installation, setting up

    Download and installation

    Panel discussion

    (18:00 - Friday 7 pm Sunday)

    Thank you.

    RTA

  • Questions about the implementation of clusters of storage and DTS on active cluster

    I have a few questions about the implementation of clusters of data store and SRS storage in VSphere 5.1.

    We have a data center with about 15 HP blades and a few servers non-lame.  The hosts are all either VSphere 5.0 or 5.1.  Our back-end storage is an EMC VNX 5700 with about 20 stores of data.  All the VMWare is managed by VCenter 5.1 running on a dedicated physical machine.

    Currently, each data store is used individually; No piles of data store are put in place.  When a new virtual machine is created, the administrator usually chooses the data with the most space store.  Periodically, we will go back and manually storage vMotion machines to balance the load.

    Recently, we have expanded the VNX storage, so we now have LUNS in different pools, with different levels of performance.

    What I would do is set up for the data store clusters, so that us when a virtual machine is created, the administrator must not know what data store is in which pool.  Also take advantage of the DRS storage so that the burden of storage will be "refine" himself a little.

    I know the setting up of a cluster of storage in a 'clean' environment is quite simple, but my concern is creation/conversion data warehouses existing in active production in the cluster, while they are used.

    If I access the screen "data warehouses and store data from clusters ', right-click on the data center and create a cluster, and then move the various data stores in the new cluster, will there be an interruption in the production running systems?

    I also wonder about activation of storage i/o control.  It is not currently enabled on data warehouses.  I know it's useful for the StorageDRS, but will be allowing any negative impact on the system?  If I turn on the warehouses of data, is there anything else I should do or set in addition to all that allows him?

    Finally, we are in the process of Site Recovery Manager configuration.  SRS has an impact on the configuration of the data clusters and DTS store?

    Thanks in advance for your comments.

    Mike O.

    Gregg Robertson wrote:

    Hello

    Clusters of data and using DTS store doesn't impact RS even if you create a cluster of data store for storage of replicated data and another for everyone else, this way you machines virtual you want to replicate are not moved on warehouses of data that are not replicated , but will still have the ability to move if there is a conflict.

    Gregg

    With all due respect but SRM and DTS don't go together. SRM does not at all support the use of DTS. So if you are configuring SRM forget DTS for now.

    Reason for this is that SRM knows no DTS and VMs can be in flight when a failover should occur, and bad things can happen. Also, the protection breaks when a virtual computer is moved between data warehouses in a cluster data store.

    In short: don't go there.

  • A question about the methods and parameters.

    Hey guys, this is my first post here. I am very new to Java and done a bit of C++ before Java. I had a question about the methods and parameters. I do not understand the methods; I know they can be repeated when it is called, but it's almost everything. I also know that a program should have a class that contains the main method. What I really, really understand on methods is what the parameters are. I know they are in parentheses and that is it. Could you explain what they are? I really appreciate it. Thanks to all in advance. Best regards, Michael

    Taking an example:
    Suppose you calculate area of the rectangle you need two inputs one is the length and the width. Area = l X b, where l = length, b = width

    If your method, say, calculateAreaOfRectangle (length int, int width) will be two parameters as arguments.

    System.out.println ("field of rectangle:" + calculateAreaOfRectangle (40,30);)

    public int calculateAreaOfRectangle (int length, int width) {}
    int area;
    Area = length * width;
    return of area;
    }

    So if you call this method then the output will be returned in 120.

    Parameters of a method are simply the input variables for the method of treatment for all calculations or something useful.

    And we cannot have methods inside the main method in Java. It is in the java syntax and if you do, it will throw a syntax error.

  • Question about the OSB proxy service

    Hello

    I'm new to the world of SOA/OSB. I'm working on a POC from the OSB for our existing application. I have a question about the definition of the URL endpoint to the proxy service. It is possible to specify a generic url endpoint to a proxy service. Something like / SomeService / *. I tried and got errors. Is it possible to do somethig like that or it is a mistake on a conceptual level.

    Thank you

    anything you type in the uri of the endpoint of entry will be the contextroot to your service, so /SomeService should indeed be sufficient or as mentioned Pierluigi/SomeService/blabla is also valid (Betty is not a parameter query, but only a part of the contextroot)

    If you want to use a service like http rest

    / SomeService/blabla would still be the contextroot, and after that, you can use the query parameters

    / SomeService/badarou? var1 = test & var2 = test or/SomeService/blabla/employee/id/1

  • Question about the construction of cube / query performance (11.2.0.3)

    Hi, I have a stupid question on the performance of cube generation. By choosing the precalc %, is linear (or nearly linear) construction time to that? for example if you select 10% going to be 3 times faster than the selection of 30%? Also, is it fair to assume that if only 10% of the values are precalculated, an average end-user queries have to hit 3 times more data and therefore be about 3 times slower?

    Sorry, this on a virtual computer on your laptop, so test different configs build takes forever (I still have a load of cube really complete). Guess I should not be trying a cube Sun 15 on a virtual computer on your laptop, but trying to sell a DBA on the fact that she could improve the performance of our mini - DW.

    Thank you
    Scott

    Aggregation based on costs (aka "Pre-computes percent") was introduced in 11.1 as a simpler alternative based on the level of aggregation. Product management dream was a linear parameter, but the complexity is quickly apparent. Which could measure the linearity against? The generation time? Time of the query? Total size of the disk? The result the balances of all of these factors, but is linear against any of them. Fortunately, behavior level percentage precompute was fairly consistent between cubes and patterns in our experience, so I can give you a rough characterization. But keep in mind that this is a guide only - you have to experience on your own scheme and a system to see what works for you. In particular, you must balance your own requirements on construction time, time of the request and the disk size.

    * 0% *-this means no precomputation at all, so all data access will be dynamic. This is the recommended setting for the top of the page partition of a cube. If, for any reason, you want to use for the scores of leaves as well, then I advise you pass a cube uncompressed.

    * 1% *-he pre-computes the smallest part of the cube that is allowed by the algorithm and would take certainly greater than 1% of the time taken by an accumulation of 100%. For partitions of leaves, it is usually best to increase the amount because you'll get much better query response time for not much more profitable in terms of disc size and the generation time. It may be a good level for the top of the page partition of a cube, but should be used with caution because the top of the page scores are often too big to pre-computes.

    * 2%-19% *-these levels does not seem to be a lot of benefits since the amount of time and the total size of the disk is almost identical to a construction of 20%, but queries are slower.

    * 20%-50% *-this range is probably the best compromise in terms of construction compared to the time of the query. The default value of the AWM is 35%, which is a good starting point. Lower it to 20% if you want a faster version and get up to 50% if you want to replace the faster queries. The setting is close to linear in this interval than outside it.

    * 51%-99% *-you should probably avoid these levels, although I've seen 60% used in practice. The reason is that while the size of the cube and the length of the construction increase rapidly, the queries do not receive proportionally faster. Indeed, you may find that queries are slower because the code spends more time swapping in the pages of the disc.

    * 100% *-this will be pre-computes all (non-NULL) cells in the cube. It may be a surprise after my advice about 51%-99%, but 100% is a reasonable level to choose. This is because the code is much simpler when you know that everything is precalculated and then stored in the disk pages.

  • I have a question about the functionality of Oracle Identity Manager...?

    Hi friends
    I have a question about the features of Oracle Identity Manager.
    Here's my question:
    Self-management is possible network passwords (reset / unlock) with Oracle Identity Manager 9.1.0.2

    Very grateful.

    What Kevin suggested this means that you are managing accounts and their password by IOM. If your condition is the same then follow:

    Re: error during password reset using the self-service portal

Maybe you are looking for