Code package com;  public class Employee {      private String name;      private String empId;      public Employee(String name, String empId) {         super();         this.name = name;         this.empId = empId;     }      // equals and hashcode  }   package com;  import java.util.LinkedHashSet; import java.util.Set;  public class TestEmp {      public static void main(String[] args) {         Employee emp1 = new Employee(&quot;Luke&quot;, &quot;11&quot;);         Employee emp2 = new Employee(&quot;Luke2&quot;, &quot;12&quot;);          Set&lt;Employee&gt; empSet = new LinkedHashSet&lt;&gt;();          empSet.add(emp1);         empSet.add(emp2);          Object obj[] = empSet.toArray();          System.out.println(obj);     }  }  When i print i get the response it is showing as [Ljava.lang.Object;@7852e922 I need response in form of an Employee Array , can you please help how to get this in form of an array The response needs to form of an Array of Employees
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]
What do viruses do? There are those big green spiked things that my friends call viruses. I don't know what they do and I want to know. Do the viruses do something to the device you are playing on? Are they good or bad? change terminal title I want to make a shell alias that starts a certain program and also changes the title of the terminal to the name of the program.  How can I do that?  In case it matters, I am running the terminal on Ubuntu and connecting to a Debian server via ssh. Single word that means "to look down on others"? How do I get an RSS feed of my YouTube subscriptions? The default "Subscriptions" feed on the YouTube homepage shows all of the activity of the people that I am subscribed to on YouTube or have in circles on Google+. However, I'm most interested in new videos that the people I subscribe to (either on YouTube or by circling on Google+) create and post (neglecting comments or sharing other people's videos - what you see when you check the "show uploads only" checkbox on the YouTube homepage). However, being able to bring anything off of the YouTube homepage and into Google Reader as an RSS feed would be good.  Is there a way to do this? enclosing a lstlisting environment inside my own environment using matlab-prettifier I've just started using matlab-prettifier.    Since the line \begin{lstlisting}[style=Matlab-editor] is a lot to type, I created my own environment:  \newenvironment{myMP}      {\begin{samepage}\begin{lstlisting}[style=Matlab-editor]}      {\end{lstlisting}\end{samepage}}   I've used this syntax many times before, but in this case it doesn't work.  Is there any reason why I can't enclose the lstlisting inside my own one?  Here's sample code, illustrating the problem.  \documentclass{minimal} \usepackage[framed]{matlab-prettifier}%For matlab code \newenvironment{myMP}      {\begin{samepage} \begin{lstlisting}[style=Matlab-editor]}      {\end{lstlisting} \end{samepage}} \begin{document} \begin{myMP} matlab word \end{myMP} \end{document}   When I run this with pdflatex it returns a *, indicating that the environment wasn't closed properly.  Thanks! Does the given matrix have a square root? Given the following matrix, I was asked to tell whether the matrix is the square of some matrix or not.  $$ \begin{pmatrix} 1 &amp; 0 &amp; 0\\ 0 &amp; -1 &amp; 0\\ 0 &amp; 0 &amp; -1 \end{pmatrix} $$  Since this matrix is diagonal, a square root is  $$ \begin{pmatrix} 1 &amp; 0 &amp; 0\\ 0 &amp; i &amp; 0\\ 0 &amp; 0 &amp; i \end{pmatrix} $$ Am I right? Under the U.S.'s Copyright Law, is it an act of copyright infringement if we changed the color of another artist's image to black and white? Why do most C programmers name variables like this:  int *myVariable;   rather than like this:  int* myVariable;   Both are valid. It seems to me that the asterisk is a part of the type, not a part of the variable name. Can anyone explain this logic? Review Audit failed when "late answer" answer is a duplicate I just got a review audit where the "late answer" was a duplicate of the accepted answer, but flagging it on that basis failed the review. That seems like a bug to me.  Question here:   I found that by clicking the question to view the entire Q&amp;A, and noticed that the copy was from a generic "user12345" account (probably with 1 rep as well) and the original from a real-looking account. Viewing the whole Q&amp;A is often useful when reviewing, especially late answers (which are often repeats of earlier points, disagreements with those, or random addendums better submitted as edits). I looked at the duplicate and thought "weird, rep harvesting maybe?" so I clicked "needs moderator attention" and wrote "copy and paste of accepted answer". FAIL!  I think that this review type can't ever work, because to avoid the problem I found you'd need to make up whole new "late answers" which by definition the review bot can't know anything useful about. Either that or to pass you'd just need to take any action at all, including upvoting the original of the duplicated answer. Which I didn't do, BTW, because I had no idea or opinion about the question or answer.  (this is not a duplicate of "What are review tests", it predates that and focuses on a particular defect within the process. See the comments below). Evaluating $\int \frac{\sin\left(x\right)}{1+x^2}dx$ $$\int \frac{\sin\left(x\right)}{1+x^2}dx$$  I have tried to integrate by parts but it doesn't work. How do I evaluate it? Any advice, hint or well-thought solution will be appreciated. This question was asked in an entrance test for an undergraduate mathematics program today, held all over India.   Question: $f$ is a differentiable function in $[0,1]$ such that $f(f(x))=x$ and $f(0)=1$.  Find the value of $\int_{0}^{1} (x-f(x))^{2016} dx$.  I tried to solve it by substituting $f(f(x))$ in place of $x$, but could not proceed much further. Any hints or solutions will be appreciated. Unexpected AdjacencyMatrix output Feeling a tingling sensation by touching stuff, Is this safe? I'm putting on my desktop computer on steel rack as usual. A while ago, when I touch the steel rack for seconds, practically I feel a tingling sensation, sort of electrical shock in my finders. After that I measured how voltage the steel rack has, the multi-tester meter indicated almost 50V by AC mode. Is this safe to touch or keep the PC on the position, or I should get away the PC somewhere electricity-safe? I'm not sure this site is suit for asking this kind of question, but I'm very worrying whether this is safe or not since this experience is my very first time. Thank you. do { ... } while (0) — what is it good for? Possible Duplicate:          I've been seeing that expression for over 10 years now. I've been trying to think what it's good for. Since I see it mostly in #defines, I assume it's good for inner scope variable declaration and for using breaks (instead of gotos.)  Is it good for anything else? Do you use it? Shell Shortcuts in Windows OS MacBook Air: What taking up all my hard drive space Change the location of .bashrc Is it possible to change the location of .bashrc from /home/orhanc/.bashrc to some other directory? How can I animate the Restrict Visibility property of an object? I've been trying to create an animation where an object blinks on and off.   For example, I have a Cube and I set a keyframe on it's Restrict Visibility icon (the "eye" icon) with I, then I toggle off that "eye" so my cube doesn't show in the Viewport and again I press I to record that keyframe. Then, when I preview the animation in the Viewport, I see my cube appears and then disappears like I want, but when I render it, the cube does not disappear at all.  What am I doing wrong? Adding multiple jars to classpath on commandline QT MySql connectivity using Windows XP, Qt Creator 4.5.2(windows 32 bit)