What will be the output of this simple programm ?

Class ABC
public static void main(String args[])
long i = 22222222222222222;
System.out.println(i);
Pls give me how to get rid of this problem.
(Casting to long also doesnot make any effect.)
I think range of long is very big..although i donot know exactly but bigger than what i wrote.
so why this problem occurs that "value out of range."
waiting...
J stands for Java ONLY

Change Class to class, then do this:
long i = 22222222222222222L;

Similar Messages

  • IF WE DOES NOT SELECT ANY VALUE IN SELECTION SCREEN WHAT WILL BE THE OUTPUT

    hi
    plz give me the answer for this

    Hi bhuthapalli,
    1. Normally, all reports are designed so that
      if we do not enter any thing on screen, it will show all records.
    2. Normally reports use SELECT OPTION  and use IN for the query.
       This would take care if nothing is entered in select option.
      Nothing entered in select option means all records.
    3. If there is a parameter on the screen,
       it is usually made obligatory.
       Bcos if we do not enter anything in parameter,
        it may not give records.
       (Bcos for parameter = is used in query)
    regards,
    amit m.

  • What will be the output and why

    Hi All,
    Can anyone help me in this.
    package javatests.test;
    import java.util.HashMap;
    import java.util.Map;
    public class CopyOfHashFunction1 {
         private int hashCode;
         public static void main(String[] args) {
                Map hashTable = new HashMap();
                String key1 = new String("a");
                String key2 = new String("a");
                System.out.println(key1.hashCode());
                System.out.println(key2.hashCode());
                System.out.println(key1 == key2);
                hashTable.put(key1, 1);
                hashTable.put(key2, 2);
                System.out.println("Size = " + hashTable.size());
                System.out.println("Value when key1 is searched:"+hashTable.get(key1));
                System.out.println("Value when key2 is searched:"+hashTable.get(key2));
    }Output:
    97
    97
    false
    Size = 1
    Value when key1 is searched:2
    Value when key2 is searched:2I feel there should be two entries in the HashTable, because when putting the second entry in the HashTable hash collision will happen and equals() method of String will be called. As the equals() method is returning false because the object references are different so HashTable should make another entry in the same bucket.
    Please let me know the answer.
    Thanks
    Jitendra

    Yes you are right jverd because the code in String.java is like, so it used to compare the string character by character.
    854       public boolean equals(Object object) {
      855           if (object == this) {
      856               return true;
      857           }
      858           if (object instanceof String) {
      859               String s = (String) object;
      860               int hash = hashCode;  // Single read on hashCodes as they may change
      861               int shash = s.hashCode;
      862               if (count != s.count || (hash != shash && hash != 0 && shash != 0)) {
      863                   return false;
      864               }
      865               for (int i = 0; i < count; ++i) {
      866                   if (value[offset + i] != s.value[s.offset + i]) {
      867                       return false;
      868                   }
      869               }
      870               return true;
      871           }
      872           return false;
      873       }

  • What can be the error in this simple Linked List Implementation

    i have a linked list code that wont compile successfully. The code is
    //Lets try the Linked List 
    import java.util.*;
    class LinkedListDemo {
    public static void main ( String args[]){
         LinkedList l1=new LinkedList();
         l1.add( "A");
         l1.add(2);
         l1.add(3);
         l1.add(4);
         l1.add(5);
         l1.addFirst(6);
         l1.add(7);
         l1.add(8);
         l1.add(9);
         //Lets check what does the Linked List hold at this time
         System.out.println("Prsently the linked lis is having:  "+l1);
    }Problem is with the add method . Compiler error is that it doesnt recognize the symbol ie add method.

    i m sorry , java version is 1.4In that case, read up on the link jverd posted on AutoBoxing. You can only add Objects to a List. An int is a primitive, not an Object. You can try something like this:
    l1.add(new Integer(2));

  • If BW system is down for several hours, what will be the status of the Jobs

    Hello Gurus,
       I don't know where i should post this issues! anyways .....! i need some information. One of our BW production system will be down for about 12 hours tomarrow to move it on to new hardware and this current system has lots of scheduled jobs with run daily and hourly..! so my question is ..what will be the status of this jobs which fall in between this down time?
         as per our basis team information....they said that all these jobs will be queued up and when once the system is online ...these jobs will access all the avalable processess and if this thing happen....! then the system will have a VERY BAD performance and user cannot use this BW system...they cannot even open the bex analyzer.
          so...i thought of deleting these queued jobs. can any one tell me WILL THESE JOBS WILL BE SCHEDULED FOR NEXT DAY??? OR IS THERE ANY OTHER WHY TO CONTROL THIS SITUATION?? our process chains are locked for modification..so, we cannot even re-schedule them in prod system.....
             aaaaaah! can any one HELPP MEEEEE@
    I will award full points for your suggestion

    Hi,
    when you'll restart you SAP system all jobs will be displayed with a delay since they didn't run during your downtime.
    And that's true that they will be queued and fired as soon as a system resource will be available. That means a lot of paralel processes with system overload and usually subsequent errors in loading data.
    As per suggested already, the best would be to shift the scheduling.
    Another option is to execute the report BTCTRNS1 before shutting the system down. This will change all background job status to a "suspended" mode.
    when your system is up again you will be able to release (or reschedule or cancel or any other action) single jobs in a controlled manner.
    When you've finished with this task then don't forget to run BTCTRNS2 in order to enable background jobs to be executed.
    hope that helps...
    Olivier.

  • When I go to buy an app that isn't free it asks for my security question but I don't know what my security question is so I go to change it and it said it will send the info to this email that I don't even have. What do I do?

    When I go to buy an app that isn't free it asks for my security question but I don't know what my security question is so I go to change it and it said it will send the info to this email that I don't even have. What do I do?

    Alternatives for Help Resetting Security Questions and/or Rescue Mail
         1. If you have a valid rescue email address, then use this procedure:
             Rescue email address and how to reset Apple ID security questions.
         2. Fill out and submit this form. Select the topic, Account Security. You must
             have a Rescue Email to use this option.
         3. This is the only option if you do not already have a valid Rescue Email.
             These are telephone numbers for contacting Apple Support in your country.
             Apple ID- Contacting Apple for help with Apple ID account security. Select
             the appropriate country and call. Ask to speak to the Account Security Team.
         4. Account security issues almost always require you to speak directly to an
             Apple representative to securely establish your identity as the account holder.
             You can set it up so that Apple calls you, either immediately or at a time
             convenient to you.
                1. Go to www.apple.com/support.
                2. Choose Contact Support and click Contact Us.
                3. Choose Other Apple ID Topics and choose the appropriate topic for
                    your issue.
                4. Follow the onscreen instructions.
             Note: If you have already forgotten your security questions, then you cannot
             set up a rescue email address in order to reset them. You must set up
             the rescue email address beforehand.
    Your Apple ID: Manage My Apple ID.
                            Apple ID- All about Apple ID security questions.

  • I have an ipod shuffle 1st generation it will work if i connect it to my usb port in car or on computer but i can not get it to work using just headphones what coud be the reason for this

    I have an ipod shuffle 1st generation. it will work ousing usb port in car or on computer but i can not get it to play using headphones. what would be the reason for this.

    Sorry for  the typos, I hope my message still gets across!

  • My Lightroom 5 says I have a new update, but the download looks like it is trying to switch me over to creative cloud.  What will happen if I install this download?

    My lightroom 5 says I have a new update, but the download looks like it will switch me over to creative cloud.  What will happen if I install this download?

    What about the notification looks like it will switch over to the creative cloud?  I'd avoid it until you get a good answer to your question.

  • What will be the consequences of changing the apple ID on my iPad to a different apple ID on my iMac?

    Hi,
    I have an (iPad 2) and an iMac (2012). I have one apple ID used for both the itunes and appstore on the iPad, and on the iMac a different apple ID used for the appstore and itunes. What will be the consequences of changing my email ID on the ipad to the one used on the imac? I don't want to delete the iPad apple ID, just never use it again. I just want to work with 1 apple ID over the 2 devices.
    I have purchased apps on the iPad and other documents/movies/books etc and if I sync to the iMac will all that be deleted? How can I just use the one apple ID for all? Does it mean that every time I connect my iPad to the iMac that I have to login to itunes using the iPad apple ID? Maybe it is that simple I don't know.
    What will be the consequences of doing this and is it possible?
    Thanks.

    settings->itunes & app stores->click appleID and choose logout

  • What happens to the outputs when I reconfigure the 6524 card?

    I have an application where I want to recongure the card throughout my program. For example I might initially want to set a single 8 bit port, so I could use Dig_Prt_Config and Dig_Out_Prt. Then I might want to output a batch of data using buffered IO so I use DIG_Block_PG_Config and DIG_Grp_Config to configure the card again. My question is what happens to the output states when I do this. If the port is then assigned to a group what happens to the outputs at that point? Do they remain unchanged until I do a Dig_Block_Out or do they all turn off? I guess I will find out when I try it, but it would save me from throwing away code if I knew now,
    Thanks,
    David

    David,
    I assume you have the 6534 board. On the 6534 board, reconfiguring the port will not affect the output value. Well, as long as the direction map doesn't change. Anyway, hope that helps.
    Ron

  • Iphone 5 Battery efficiency is bad.....What will be the cost of replacing a battery in the apple store..??

    what will be the cost of replacing a battery in the apple store..??

    Apple has a battery replacement program for some devices sold between Dec 12 and Jan 13.
    Check your device if it's eligible for this program or not https://www.apple.com/support/iphone5-battery/other_countries.html
    Besides, go to any App Store and ask them to run ADR test for your device and will see the battery life. If it seems fail or consumed then you should replace the battery. If seems pass, then restore your device if you think battery drains too fast.
    see the pricing Apple - Support - Service Answer Center
    choose the country from list and will see the all info upon service costs

  • Mac book pro hanging very often what will be the possible cause for it?

    hi my mac book pro is 3months old and nowadays its hanging very often like when iam surfing, and some times when i dont use it for 10 to 15min.
    can anybody suggest me what will be the possible cause for it.
    Thanks

    Start with this comprehensive troubleshooting article:
    https://discussions.apple.com/docs/DOC-3521
    Look at this one for possible solutions:
    https://discussions.apple.com/docs/DOC-3353
    Ciao.

  • If you have two public class in a java file what will be the error ?

    Q:If you have two public class in a java file what will be the error and how will you remove that.?

    Kannan_S wrote:
    I dont want you to be on that list . Here goes my explanation..
    A class is well defined with members and functions
    An abstract class is not defined well as compared to a full fledged class (talking more generically)
    An interface is more abstract.
    I was asking the author who has posted this question to be like a class(very clear)
    and not either as an abstract class or an interface
    Hope i have made it clear..Not in the slightest. This has absolutely no bearing whatsoever on the question asked. Not to mention that classes are classes, and all equal in the eyes of the compiler, be they abstract, concrete or interfaces. It's difficult to see what your point is, to be honest, but I suspect it wouldn't be worth seeing anyway

  • What will be the peoplesoft query to calculate voluntary termination count and involuntary termination count? I am working on OBIA HR analytics workforce deployment reports and need to validate the reports

    what will be the peoplesoft query to calculate voluntary termination count and involuntary termination count? I am working on OBIA HR analytics workforce deployment reports and need to validate the reports. I also want to know the tables involved

    Hi Andrew,
    Part A:
    I've done some restating of the question, and distributed the calculations among several fields, not all of which need to be included on the visible layout. Other than formatting the Date fields and moving the 'Completed Date' field and its label, I've left this in the default "Layout 1" produced by AppleWorks.
    Field List:
    Priority: Popup menu with six items: 00, J, D, 1, 2, 3  Defaults to 00
    TL (time limit in months): Calculation:  CHOOSE('Priority',0,1,3,4,6,12)
    Received: Date. Option: Automatically insert today's date (ie. Date Record created) (may be edited)
    Target Date: Calculation:
    DATE(YEAR('Received')+INT(MONTH('Received')+'TL')/12,MOD(MONTH('Received')+'TL', 12),DAY('Received'))
    Remaining (Days): Calculation: INT('Target Date'+1-NOW())  (see revision below)
    Completed: Checkbox. Set default value to Unchecked.
    Completed Date: Date: Entered manually
    OnTarget: Calculation: IF('Completed',IF('Completed Date'<'Target Date',"On Target","Over"),IF(INT(NOW())>'Target Date',"Over","On Target"))
    The On Target field shows the current status of the case while still open, and the state on the closing date when it was closed.
    Having done that, I was unhappy with the Remaining field continuing to calculate an ever larger negative number after the case had been closed. Hence this revision below:
    Remaining: Calculation: IF('Completed','Target Date'-'Completed Date',INT('Target Date'+1-NOW()))
    Shows the number of days remaining while the case is open, the days remaining at completion if the case has been marked Completed and the completion date entered.
    Rsults (and some further formatting of the Layout) below.
    Part B:
    You will need Subsummary parts when sorted on Completed and on On Target. Fields can appear on  a Layout only once, so each subsummary part will need a separate Summary type field for each field to be summarized.
    Regards,
    Barry

  • What will be the price of the "Photoshop Photography Program" after the "limited time" is ended?

    The information currently available is "For a limited time, you can join a special Creative Cloud plan"... And it's just US $9.99/month when you sign up for a one-year plan.
    I understand that Adobe will not announce in advance price increases but that's different; it's advertised as a limited time offer so we know it's not the regular price.
    We need to know what will be the regular price as it will be a recurring fee.
    I now own a regular licence of Lightroom 5. If I sign up for the CC version It's almost a one way road, there's no return and I will be at Adobe's mercy.

    mgibeault001 wrote:
    With all respect, I cannot quite base my business choices on your understanding... I need a definitive answer.
    I don't think you'll get one.  Do other software companies offer long-term future price information? 
    mgibeault001 wrote:
    Since they advertise this as a "limited offer" (ending end of May), my understanding is that it can be priced at $49 (or any other price) a month after that.
    I've told you what I've read, but that wasn't a guarantee, so I guess they could put the renewal price up by 500% at the end of your year's contract. 
    mgibeault001 wrote:
    And there's no assurance that upgrades to LR perpetual will be available in the future. We would be locked in CC because our current LR5 will not be able to read LR6' catalog.
    Yes, quite true.  They've said that Lightroom including new versions will be available for perpetual licence for the forseeable future (or some similar words), but maybe Adobe can forsee only 6 months. 
    Do you have an alternative?  Do you have long-term guaranteed product and pricing strategies from other suppliers?
    PS - what is clear is that new products are likely to be CC-only.  For example, Lightroom Mobile is CC-only. 

Maybe you are looking for