new to coding, new to java and new to stack overflow.  It might be a silly question, but I'm having trouble creating an int array of size = HashMap.size();    int gt = HashMap.size(); // which is 50  int[] answer = new int[gt]; // Shouldn't it creates an int array of size 50?  int length = answer.length;             System.out.println(answer + " " + length); // is giving me something   like [I@15db9742 50   Any idea of what's going on? THANKS!
In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]
Prime spectrums bijection but not homeomorphism Maximum length of a USB Cable? I would like to know how potential difference is created between two points?Is potential difference created by adding more electrons at one side?If that's the case how to add more electrons at one side?  I'm really looking to know what really constitutes potential difference? How to disable auto brightening LCD Showing the inequality $|\alpha + \beta|^p \leq 2^{p-1}(|\alpha|^p + |\beta|^p)$ Do we actually get more sick (flu/cold) during winter? The word flu derives from the Italian phrase "influenza de freddo" meaning "influence of the cold".  Indeed it is that time of the year when my colleagues seem to have the flu/cold more often than not. I remember during university, winter lectures would be riddled with people coughing and sneezing - the so called "freshers flu"  Questions   Is there statistical evidence for this claim? If so, what are the causes/factors involved?   asks why our noses get runnier during cold whether, is this related? How to get coloured terminal over ssh? When I connect over ssh to remote hosts everything is just a single font/color. I would like to have colours like I do locally e.g. green for executable and blue for symlinks etc. And such that when I run $ git diff on the ssh host it shows me diff with colours =) How can I install Ubuntu without removing Windows? I just did a clean install of 20.04 and I noticed that no key shortcuts for files manipulation work when my focus in on Desktop (not in Nautilus).   When I have copied a file to clipboard, I cannot Ctrl+V it to Desktop, when I click on a file on Desktop, I cannot Ctrl+C it, or I cannot Delete it with keys. Only ways to do it is either navigate to the Desktop folder in Nautilus, or right-click the file on the Desktop and copy/move to trash/paste...  Sorry if I'm missing something obvious, all the key shortcuts worked normally for me in 18.04. Draw integers independently & uniformly at random from 1 to $N$ using fair d6? Is there a way to retrieve the user id of @mention user from chatter post in Apex? We can write a before insert trigger on feeditem, but when we display the body (which has @mention user) it simply displays as text. Is there any workaround for this? Not able to add 3 JPanels to a main panel Why aren't there any fighter carriers in the Star Trek universe? All of the ships of every species seem to be medium to large vessels with multiple crew members. Why aren't there single fighter craft and carrier ships to transport them in mass?  I've just noticed the difference between Battlestar Galactica and Star Trek, where the former has primarily aircraft carriers, and the latter has battleships.   Wouldn't a huge fleet of small fighters be extremely maneuverable and possibly stealthy?  Update:  For clarity, my question is not about the Federation and their choice of ships, but the universe at large. I would think there would be some diversity in space warfare strategy, such as huge armadas of fighters with base stations / carriers. Adding curved features to map with ArcGIS API for JavaScript? I've tried without much success to add a curved line feature to the ArcGIS JavaScript map.    I created a polygon with a curved edge in ArcMap:   However, when I load this same feature in the web API, it becomes segmented:   The problem started when I tried to create a curved feature from the JavaScript API itself, which only seems to allow full circle features (not circular arcs).  This makes me think that curves are still unsupported in the JavaScript API. Do you know any way around this? Do you have any other ideas on alternatives I can use to create and correctly view curved features? How to randomly subset X% of selected points? What methods are available in ArcGIS 10.2 to randomly subset a selection of points.  For example, in the attached screenshot I am interested in keeping 20% of the selected points and deleting the rest. As Scott Myers wrote, you can take advantage of a relaxation in C++'s type-system to declare clone() to return a pointer to the actual type being declared:  class Base {     virtual Base* clone() const = 0; };  class Derived : public Base {     virtual Derived* clone() const };   The compiler detects that clone() returns an pointer to the type of the object, and allows Derived to override it to return a pointer to derived.  It would desirable to have clone() return a smart pointer that implies transfer of ownership semantics, like the following:  class Base {    virtual std::auto_ptr&lt;Base&gt; clone() const = 0; };  class Derived : public Base {     virtual std::auto_ptr&lt;Derived&gt; clone() const; };   Unfortunately, the relaxation of the conventions does not apply to templated smart pointers, and the compiler will not allow the override.  So, it seems I am left with two options:   Have clone() return a "dumb" pointer, and document that clients are responsible for disposing of it. Have clone() return a smart base pointer, and have clients use dynamic_cast to save them to a Derived pointer if they need it.   Is one of these approaches preferred?  Or is there a way for me to eat my transfer of ownership semantics and have my strong type safety too? iPhone screen randomly turns on The command history between sessions is not getting saved. I'm using guake and the history for the session is working fine. I noticed that .bash_history had some commands I executed in sudo -s mode and tried the same again and all the commands while in the session got saved so I tried: chmod 777 .bash_history  Now the old commands appear at the start of a session but no new commands are getting saved. How does a uniform prior lead to the same estimates from maximum likelihood and mode of posterior? I am studying different point estimate methods and read that when using MAP vs ML estimates, when we use a "uniform prior", the estimates are identical. Can somebody explain what a "uniform" prior is and give some (simple) examples of when the MAP and ML estimators would be the same? Reducing size of KML file (after converting from Shapefile)