Greeter.java  package lambda; import java.util.stream.*;  public class Greeter {      public static void main(String[] args) {         // TODO Auto-generated method stub         Greeting Greet1 = () -&gt; System.out.println("Hello gretting..");          Greeting innerclass = new Greeting() {             //why new Greeting is an interface ?             public void perform(){                 System.out.println("Hello inner greeting");             }         };         Greet1.perform();         innerclass.perform();     } }   Greeting.java  package lambda;  public interface Greeting {      public void perform();  }      OUTPUT   Hello gretting..  Hello inner greeting...  why this line is working?  Greeting innerclass = new Greeting() {
What is the use of anonymous classes in Java? Can we say that usage of anonymous class is one of the advantages of Java?
Actually snapping to pixel grid Does anyone know if there's a way to have Illustrator CC (2014) constrain control points to the pixel grid? I understand that "Align to pixel grid" makes it so that a shape will try to match the pixel grid, but the actual control points don't line up to said grid... The image I've attached illustrates my problem. I used MiKTeX 2.9 on windows. I have downloaded a package I want to install from the internet (manually, not through MiKTeX). The archive (*.lmza) containing the package was saved to a directory on my C:\ drive. Through MikTeX -> Maintenance -> Settings -> Packages -> Change... I can select the directory in which I have saved the archive containing the package. However, if I choose Packages shall be installed from a directory and choose the location of the package, I get this error message: C:\my\package\is\here does not seem to be a local package repository. What does it take for a directory/folder to become a local package repository? I've encountered different usages of preposition + Home and I want to learn which of them are correct.  Some examples:     Back home   Back at home   Back to home Error in if/while (condition) {: missing Value where TRUE/FALSE needed What does InitializeComponent() do, and how does it work in WPF? What does InitializeComponent() do, and how does it work in WPF?  In general first, but I would especially be interested to know the gory details of order of construction, and what happens when there are Attached Properties. This is a question you can read everywhere on the web with various answers:  $ext = end(explode('.', $filename)); $ext = substr(strrchr($filename, '.'), 1); $ext = substr($filename, strrpos($filename, '.') + 1); $ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename);  $exts = split("[/\\.]", $filename); $n    = count($exts)-1; $ext  = $exts[$n];   etc.  However, there is always "the best way" and it should be on Stack Overflow. Is there a missing definite article before caliph in 'the group's leader, XYZ, as (the) caliph'? Why is the decay of a neutral rho meson into two neutral pions forbidden? Where should I put  tags in HTML markup? When embedding JavaScript in an HTML document, where is the proper place to put the &lt;script&gt; tags and included JavaScript? I seem to recall that you are not supposed to place these in the &lt;head&gt; section, but placing at the beginning of the &lt;body&gt; section is bad, too, since the JavaScript will have to be parsed before the page is rendered completely (or something like that). This seems to leave the end of the &lt;body&gt; section as a logical place for &lt;script&gt; tags.  So, where is the right place to put the &lt;script&gt; tags?  (This question references , in which it was suggested that JavaScript function calls should be moved from &lt;a&gt; tags to &lt;script&gt; tags. I'm specifically using jQuery, but more general answers are also appropriate.) My router can do port-forwarding based on MAC addresses. That is, a specific MAC will get a specific IP, for which I can configure a set of ports to be forwarded. In order to easily change that set of ports, I'd like to have different connections in the Network manager.  How do I change the MAC address for a network connection? "That solved my problem" doesn't make sense if the target question is unanswered The comment pop-up is too far away When you click the add a comment button when you don't have enough rep, you get a pop-up saying that you need more rep in able to comment. Except, it is too far away and users might be confused for a while before realizing the pop-up is on the other side of the page:     Clearly, that is very inconvenient for a lot of people, like me. Can we move the pop-up to be right next to the add a comment button? Is there a way to determine the device running an application. I want to distinguish between iPhone and iPod Touch, if possible. Showing $(a^{2}+2)(b^{2}+2)(c^{2}+2)\geq 9(ab+bc+ca)$ Number Theory: $p!+p=n^2$, $p$ = prime Expectation values of the position operator is equal to zero in case of even potentials? String concatenation: concat() vs "+" operator Assuming String a and b:  a += b a = a.concat(b)   Under the hood, are they the same thing?  Here is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does.  public String concat(String s) {      int i = s.length();     if (i == 0) {         return this;     }     else {         char ac[] = new char[count + i];         getChars(0, count, ac, 0);         s.getChars(0, i, ac, count);         return new String(0, count + i, ac);     } } Why is the application of probability in QM fundamentally different from application of probability in other areas? The best stack-up possible with a four-layer PCB? I'm designing a 4 layer PCB and I know that the standard stack-up is  Signals GND VCC Singals  (GND and VCC can be switched depending on the layer with more signals) The problem is, I don't really want to connect all ground pins through vias, there are just too many of them ! maybe because I'm not used to 4 layer PCBs, anyway, I've read a  by Henry W. Ott about a different stack-up  GND Signals Signals GND  (Where the power is being routed with wide traces on the signal planes) According to him, this is the best stack-up possible with a four-layer PCB, for the following reasons: 1.Signal layers are adjacent to ground planes. 2.Signal layers are tightly coupled (close) to their adjacent planes. 3.The ground planes can act as shields for the inner signal layers. (I think this requires stitching ??) 4.Multiple ground planes lower the ground (reference plane) impedance of the board and reduce the common-mode radiation. (don't really understand this one) One problem is cross-talk, but I really don't have any signals in the third layer, so I don't think that corss-talk will be an issue with this stack-up,am I correct in my assumption ? Note: The highest frequency is 48MHz, there's a wifi module on the board too. How to switch between low latency and generic kernels?