Why is the output

Hi. How come the output of the code below is "FALSE"?
Im actually suppose to use a bean here but to simplify, I made it as inner class.
public class TestString {
     MyAccount account = new MyAccount();
     public TestString(){
          account.setPremiumType("Motorcyle");
          String type = account.getPremiumType();
          if (type == "Motorcycle")
               System.out.println("TRUE 1");
          else if (type.equals("Motorcycle"))
               System.out.println("TRUE 2");
          else System.out.println("FALSE");
     class MyAccount{
          String type;
          public MyAccount(){
          void setPremiumType(String type){
               this.type = type;
          String getPremiumType(){
               return type;
     public static void main(String[] args){
          new TestString();
}

LOL. That was a good one.I was staring at it for a good long while, thinking it must be some weird quirk having to do with order of instantiation/initialization for nested classes. When I actually saw it, I blurted out "oh, fuck." My not-quite-four-year-old looked up from where he was almost falling asleep and asked "What?"

Similar Messages

  • Why is the output file jerky ?

    Hi there,
    I have AE CS5 on my Mac. My system is 27" iMac core i5 with 12 GB RAM DDR3 1333 MHz with quad core.
    I rendered a 40 seconds clip with an earth spinning.
    I output it to mov format in 1920 x 1080.
    When I did a RAM preview, it was fine & the earth was spinning smoothly.
    But the output file (in mov) - (I did thru Composition > Make movie) when I play using QuickTime player is jerky at 20th Sec to 29th sec.
    I then import this mov file into Final Cut, it look stuck in the Viewer but was perfect on the Canvas.
    When I render in Final Cut, the output file as mov and use the same Quick Time player to play it & it is perfect.
    Can I know what is the reason that it is not working in Quick Time the first time when it was fresh out from AE ?
    Thank you.
    Cheers

    The default render settings use Quicktime Animation codec at best quality. These files will not playback smoothly because the data rate is too high for the hard drives to keep up with. The animation codec is a lossless codec designed not designed for playback.
    Final Cut uses compressed codecs designed for playback as the default. I'd suggest that you open up the help files (F1) and read the entire section on Rendering and Exporting (link).

  • Why is the Output Panel in Bridge blank?

    When I select the Output Workspace in Bridge, the panel at the right is blank - no buttons, fields, or anything other than a monotonous dark gray surface. When I select the Output button and the Output to Web or PDF option, nothing happens.

    In edit/preferences/start up scripts do you have check marks for eveything?

  • Why is the output of rounding functions a double?

    I thought the whole idea of rounding was ending up with an integer?
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

    rolfk wrote:
    It returns whatever datatype you input in it. Makes a whole lot of sense as anything else would require allocation of a new data value in memory.
    Returning the same datatype sounds fine and dandy - until you think about it carefully (from the user experience side of it).  Why would you put anything but a fractional number into it?  So it's always going to return an approximation of an integer unless you actually plug an integer into it?  It just seems silly - strictly from a user standpoint - that you have to take one more step to get an actual integer.  To me, it's unexpected behavior, no matter how much sense it makes technically.  Again, though - all you have to do is coerce it to whatever you need it to be and only generate a new data value only when you have to.
    I feel a little like I'm X. right now. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Why is the output of this 11?

    public class Test4
        public static void main(String[] args)
            int x = 2;
            x = ++x + x++ + ++x;
            System.out.print(x); // Prints 11
    }

    Uuuupss.
    I said "maybe".
    The logic behind this is that;
    ++x return the incread value
    x++ return the nonincreased value.Can the increment operators said to be returning
    anything at all? Not sure - I wouldn't say it.Yeah, "return" is not the correct term.
    They are expressions, and the expressions have values. The value of the x++ expression is x's original value, and the value of the ++x expressions is x's incremented value.

  • Why is the output of the program "String S is null"

    public class StaticOverLoad
         public static void get(String S)
              System.out.println("String S is null");
         public static void get(Object O)
              System.out.println("Object O is null");
         public static void main(String args[])
              StaticOverLoad.get(null);
    }

    When the compiler tries to resolve an overloaded, it tries to get the most specific match. String is a subclass of object, so it is not specific. You can the call the other method by being explicit about your argument type.
    StaticOverLoad.get((Object) null);

  • Why report section is appearing twice in the output of report designer

    Hi Gurus,
    I have created a report in the report designer and my report contains 5 sections.
    each report section is one query view.
    i inserted all the query views and done some formatting .
    but when i executed the report , one of the report section is appearing twice in the output.
    ex: i need the output like this
    section1
    section2
    section3
    section4
    section5
    But the output i am getting is as follows.
    section1
    section2
    section3
    section3
    section4
    section5
    report designer experts can please let me know why this problem is coming and also please provide possible solution for this.
    Thanks in advance.
    Raj.

    Hi Gurus,
    I have created a report in the report designer and my report contains 5 sections.
    each report section is one query view.
    i inserted all the query views and done some formatting .
    but when i executed the report , one of the report section is appearing twice in the output.
    ex: i need the output like this
    section1
    section2
    section3
    section4
    section5
    But the output i am getting is as follows.
    section1
    section2
    section3
    section3
    section4
    section5
    report designer experts can please let me know why this problem is coming and also please provide possible solution for this.
    Thanks in advance.
    Raj.

  • Why the output file is so big?

    Dear All,
             I am trying to write some data to the binary file. But the output file is very big. When I write 1M*4kB ,the file will more than 20MB. I don't know why.
            This is my vi, Please help me to find the fault,OK? Thank you very much.
            Thanks.
    Attachments:
    question1.vi ‏105 KB

    It is NOT the same vi!!! You need to familiarize yourself with dataflow, LabVIEW does NOT execute left to right, any part can execute if all inputs have data.
    In your particular case, the "file info" will execute at the same time you are building the file path. In addition, you are measuring the size of the stripped path and not of the new file. Try execution highlighting!
    To fix your code:
    You need to get the "file info" from the path AFTER you add the new filename.
    Use the error cluster to enforce proper execution order as in my example. WIre the error out of "close" to the error in of "File info". Now the "File info" must wait until all inputs have data, which can only happen after "close" has completed.
    All clear?
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SizeTest.vi ‏29 KB

  • Why does the published swf output from Presenter 10 fail to play when the zip output is uploaded to my LMS?

    On Win 7, using Presenter 10 the published output .swf (and associated files in the .zip collection) produces only a blank browser frame (both IE10 and Chrome) on upload and launch from the LMS. The index.html file is referencing two .js files that do not exist...
    <script src="./data/html/Project.js"></script>
    <script src="./data/resources/ha/wr_/OpenAjaxManagedHub-all.js"></script>
    Also, seem to be missing a presenter.css file in ./data/html I think the presenter.libs.js file is referencing.
    Are these files required for playback and correspondingly that's why only a blank browser frame is presented on the LMS launch?
    Is it possible that when I publish to my local these files are not being populated in the output .zip for some reason?
    Any help isolating the cause is much appreciated!
    -Ken

    @Willam I am wondering if the first problem has not been properly described. When viewing generated help if you right click and select View Source, as you know, you will get the HTML for the tripane window. I think Rtrown wants to see the code for the default topic. If so, that is something like View this frame.
    Turning to the last paragraph, there is also some confusion there.
    When this first happened, I wondered if the project was corrupted, and I tried a technique I picked up a while ago, involving removing the xpj and cpd files from Windows Explorer, and attempting to restore from the *.FPJ file. However, I get a message saying 'This file is not an HPJ file. Please select an HPJ file to open'. The project does not have an HPJ file! So I had to rebuild the project.
    First, you should only delete the CPD file in most scenarios. See Opening Projects on my site. Deleting the XPJ should not be done other than in a few situations. Secondly, you then restore from the HHP file, not the FPJ file. Not sure how you would do that. Finally an HPJ file is related to RoboHelp for Word and is its equivalent of the XPJ file in RoboHelp HTML.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Why does final cut x not recognize the sharp PN- K321 monitor ( European version ) as output video monitor and premiere it? Working with two cinema display and PN- K321 and I can not preview the output video at 4K for DisplayPort, whereas with premie

    Why does final cut x not recognize the sharp PN- K321 monitor ( European version ) as output video monitor, and premiere yes?
    Working with two cinema display and PN- K321 and I can not preview the output video at 4K by DisplayPort, whereas with premiere and after effects I have no problems

    Look, you can build an HD DVD with an SD movie, just as you can build an SD DVD with an HD movie. This is not a bug, it is most likely user error. Apple will not be addressing it.
    Just start over, and ensure you are building an SD DVD by bringing up the inspector for the disc (click on the background in the Graphical tab).
    Make sure SD DVD is selected:
    (If you do the same thing on your ill fated project, you'll see that HD DVD is selected)
    Build your DVD and you'll be fine.
    Patrick
    P.S. You will need to google HD DVD and Blu-Ray if you want to understand the difference between the formats. The reason that DVDSP included HD DVD was that its format was similar to SD DVD's. Blu-Ray is something else entirely.

  • Why is it that when I saved the waveform of my acquired signal into a wav file, the output waveform of my saved file turn out to be different from my input signal?

    Hi all,
    I am currently doing a heart sound analyzer project. I acquired signal using NI USB 6008 continuosly. My program is able to saved the acquired signal into a wave file. But when I browse open the saved file, the output waveform did not look the same as the acquired input signal and also the sound of the heartbeat captured cannot be heard from the loud speaker though I have saved the file as a wav file. I am not sure if the method i use to save the acquired data as a wav file is correct.  I have attach the print screen of the differences of the output I have notice and the program I have created. I would be glad if anyone here is able to troubleshoot my program.
    Thanks. 
    Attachments:
    heart sound analyzer.zip ‏257 KB

    Hi Brett Burger,
    Thanks for your reply. For your information, I have set the sampling rate as 10000 as for the sound format, I have set the bits per sample as 16 bit, the rate as 11025 and the sound quality as mono. I tried using your method by changing the sampling rate as 8K but still my program encounter the same problem.
    I wish to also create a button that is able to generate a preformatted report that contains VI documentation, data the VI returns, and report properties, such as the author, company, and number of pages only when I click on the button.  I have created this in my program, but I am not sure why is it not working. Can you help troubleshoot my program. Or do you have any samples to provide me. Hope to hear from you soon.
    Many thanks.
    Regards,
    min
    Attachments:
    Heart Sounds1.vi ‏971 KB

  • Why FSK demodulator output different bitstreams in case of the same inputs of different lengths?

    Hi everyone,
       Recently I was trying to do FSK demodulation with Labview and my USRP2.
       I did the following two tests, but found a strange phenomenon:
       In the first test, I use the demodulator to demodulate a waveform of 18399 samples, where the signal occupies about the first 12000 samples, and the FSK demodulator outputs a bitsream of 1116 bits.
       The input waveform is shown in the following figure.
       In the second test, I use the demodulator to just demodulate the first 12000 samples of the waveform,  and I found that the demodulator outputs a bitstream of 705 bits.
      The input waveform is shown in the following figure:
       According to my understanding, as the input of the 2nd test  is the same as the first part of the first 1st test, the output bitstream of the 2st test must be equal to the output of the 1st test. However, they looks very different. In the first test, even the sync  sequence of bits cannot be found. 
        Can any one  help me explain why?  Thanks in advance!  
       In the attachment, I post the program and my test data.
    Attachments:
    questions.zip ‏506 KB

    Hello Anthony F,
       Yes, I use the modulation toolkit.But I encapulate it into a subvi. Sorry for that I forget to attach it.
    Attachments:
    sub_demodulate_FSK_data.vi ‏21 KB

  • RH9 - Any idea why generating printable output from the Command Line doesn't include images?

    I have a batch file that creates a printable output of our main documentation broken up into 36 separate documents, 1 per chapter. Each chapter is a separate layout. I realize that RH has its own Batch building process, but the reason for me doing it through the command line via a batch file (.bat) is that RH keeps taking focus from my mouse and it makes it difficult to do any other computer work while the RH project generates the printable output for those chapters.
    Anyway, RH's Batch build works fine.
    But the command line for printable output does not include any of my images in the printable output. I don't know why. The document generates with all the topics fine, but the images are missing. No placeholder box in the resulting Word doc, they just simply weren't included. Has anyone else seen this? Any way to fix it?

    All,
    I thought it may be related to spaces in the path in which the script was called from. I tried having the ODBC command script in another directory but the same thing happens. It will give me the "CONFIGSYSDSN: Unable to create a data source for the 'Oracle in OraClient10g_home1' driver: Could not load the setup or translator library with error code -2147467259". As soon as the script is done running I can manually double click the script and it adds the DSN fine.
    Thanks,
    Clif Bridegum

  • Why when i input a double complex in the decimate the output is a real double?

    Hi everybody, the question is pretty much what i wrote in the title.
    I have a double complex signal and when i put in the decimate function the output is a real double, why is that?
    Thanks to everybody and sorry for the bad english

    The tools from the signal processing palette only operate on DBL. Notice the coercion dot at the terminal where you wire the complex array. Use the decimate from the array palette instead (resize as needed).
    If you want the full functionality of the other decimate.vi for complex arrays, make your own. Does not seem too hard, probably a single small loop.
    Message Edited by altenbach on 06-05-2007 01:11 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    decimate.png ‏4 KB

  • Why is the DAQ outputs distorted?

    I am trying to output two voltage sine waves(90 degrees out of phase) from my DAQ card. I use a for loop to create two arrays of 1000 samples each. I then send each of these arrays to my DAQ card for sampling of 5000S/s. One of the outputs(measured on an oscilliscope is perfect while the other clips and is distorted. Why am i not getting twp perfectly good sign waves?Is this a hardware issue?
    Please find attached my LabView file.
    Thanks,
    Gilly
    Attachments:
    Sine_forloop_nearlydone.vi ‏91 KB

    I haven't looked at your vi yet, don't have 8.6 on this machine (please identify the version when attaching vi's), but do have some questions. Are they both set to the same amplitude? Are you looking at them individually (re: single channel scope) or both channels at the same time? Are they both connected to the DAQ inputs in the same way. Usually, if there isn't an actual hardware problem with the outputs, distortion and clipping are caused by; 1) trying to output a waveform of an amplitude greater than allowed, 2) trying to drive a seriously mismatched load. In the later category hooking up to the DAQ incorrectly might cause a problem.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

Maybe you are looking for

  • Photoshop Elements won't install on Windows 8 - Error must have IE 4.0 or higher

    When I try to install Photoshop Elements 1.0.1 on a Windows 8 64 bit computer, it says I must have IE 4.0 or higher and I have IE 10 installed. How do I get Photoshop Elements 1.0.1 to install.

  • Greyed out .MOV HELP!

    This isnt specifically FCPX, but I assume most people here have greater experience with media files. I recently shot a 2 camera Biography interview and my final and most critical clip is greyed out in the "Finder" window. I have tried other macs, dro

  • Transfer music from iBook g4 to MacBook pro

    What is the most efficient way to transfer music from an older iBook to a new MacBook Pro?  There are too many tracks to try to do this with RW CDs.

  • How to track the transactions

    hi all, we have an application developed in oracle forms 6i and the data base is oracle 9i. please let me know if we have any option to track all the transactions happened at particular time.(what are all the queries get executed when using the appli

  • Values are not matching for inventory report

    Hi all, we are running the report stock over view, in that there is a key figure total stock which is having the non cumulative option inflow and outflow data has been loaded correctly but when we are executing the report it is giving the values cumu