I am familiar with programming, but I am learning Java. Why is it ok in Java to say   A test = new B()   Where A would be a different class from B (obviously). I understand that the new B() portion is just calling the initializer method for the B class. What confuses me is why would you WANT to do that? Is the A test creating the object in computers memory, with the initialization of A?    This question has nothing to do with interfaces. Why this is marked as a duplicate I have no idea...
I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?
The difference between "have a lunch" and "have lunch" Is there any difference between     I am not having a lunch tomorrow.   and     I am not having lunch tomorrow.   This is a follow up question of : . How to get the list of IP addresses in a LAN? Correctly typesetting a tilde How do I set the tilde (~) character correctly in LaTeX?  There’s a  on Stack Overflow, with a lot of answers. But dare I say it? They all suck:   \textasciitilde is too high, \texttildelow is too low. $\sim$ can be tweaked to look more or less acceptable: {\raise.17ex\hbox{$\scriptstyle\sim$}} – but even that is a hack and uses the wrong symbol.   The point is – the tilde character is definitely an existing glyph in any font I am tempted to use. How can I just access and typeset that character, please? Without resorting to some other, similar-looking glyph that first needs to be nudged into place using a cunning combination of font size and raised boxes?  There must be a possibility to access that glyph directly from the font definition.  To demonstrate, look at this screenshot which attempts simply to display a C++ destructor of a type T (~T):    Compare this with the symbol we get in the browser: ~ – that’s what I want. How to link dataframes in ArcGIS or QGIS? The below image shows a layout in ArcGIS 10.1 with four dataframes.  Each dataframe is of the same geographic area, although they are different images. For example, the top left image is a 1989 DOQ, the top right image is a reversed 1989 DOQ, the bottom left image is a 2012 DOQ, and the bottom right image is a reversed 2012 DOQ.   Is it possible to link the dataframes so that panning the image in one dataframe pans the images in all of the other dataframes (i.e. similar to how you can "Link Views" in Erdas Imagine)? Is this possible in QGIS? How to install bicycle pedals without a notch on the spindle? I bought a pair of bicycle pedals that to my surprise had no notches on the pedal spindle to use when tightening them. I managed to screw them in by hand, but they are not quite tight since I can't use a spanner on them. So what would be the correct way to tighten them? Are there any special tools or similar that I'm supposed to use?  The offending pedals can be seen below. The spindle is, as you can see, completely smooth. Asymptotic expansion for Fresnel Integrals Show that an algebraically closed field must be infinite.    Answer  If F is a finite field with elements $a_1, ... , a_n$ the polynomial $f(X)=1 + \prod_{i=1}^n (X - a_i)$ has no root in F, so F cannot be algebraically closed.  My Question  Could we not use the same argument if F was countably infinite? Couldn't we say that if F was a field with elements $a_1, a_2, ... $ then the polynomial $f(X) = 1 + \prod_{i=1}^{\infty} (X - a_i)$ does not split over F?  Thank you in advance I am trying to solve the exercises from the book Stochastic differential equations -An Introduction with applications by Bernt Oksendal and I am stuck on 1 question.  Prove directly from the definition of Ito's integral that   $$\int_0^t B_s^2 dB_s=\frac{1}{3}B_t^3-\int_0^t B_s ds$$  I have tried for a couple of hours but I simply cannot prove it . I would be grateful if somebody could help me out , even a hint would be very helpful Martingale that is not a Markov process Understanding of the theorem that all norms are equivalent in finite dimensional vector spaces The following is a well-known result in functional analysis:     If the vector space $X$ is finite dimensional, all norms are equivalent.     Here is the standard proof in one textbook. First, pick a norm for $X$, say  $$\|x\|_1=\sum_{i=1}^n|\alpha_i|$$ where $x=\sum_{i=1}^n\alpha_ix_i$, and $(x_i)_{i=1}^n$ is a basis for $X$. Then show that every norm for $X$ is equivalent to $\|\cdot\|_1$, i.e.,  $$c\|x\|\leq\|x\|_1\leq C\|x\|.$$ For the first inequality, one can easily get $c$ by triangle inequality for the norm. For the second inequality, instead of constructing $C$, the  is applied to construct a contradiction.   The strategies for proving these two inequalities are so different. Here is my question,      Can one prove this theorem without Bolzano-Weierstrass theorem?   UPDATE:     Is the converse of the theorem true? In other words, if all norms for a vector space $X$ are equivalent, then can one conclude that $X$ is of finite dimension? difference between "function foo() {}" and "foo() {}" I can define bash functions using or omitting the function keyword. Is there any difference?  #!/bin/bash  function foo() {   echo "foo" }  bar() {   echo "bar" }  foo  bar   Both calls to functions foo and bar succeed and I can't see any difference. So I am wondering if it is just to improve readability, or there is something that I am missing...  BTW in other shells like dash (/bin/sh is symlinked to dash in debian/ubuntu) it fails when using the function keyword. Group posts by year, then by month Optimized rendering of a cube mesh world I want to render a cube-mesh (a.k.a. Minecraft-style) world. If I render each existing cube it will eat up FPS pretty quickly. How can I optimize it? I understand that the point is to not render invisible meshes (faces?) but my problem is to find out what is invisible and what isn't. ModuleNotFoundError: No module named 'apt_pkg' error I run below command on ubuntu 16.4 :  sudo add-apt-repository ppa:noobslab/apps  of below question:    and get below error:  Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 11, in &lt;module&gt;     from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in &lt;module&gt;     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' Error in sys.excepthook: Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook     from apport.fileutils import likely_packaged, get_recent_crashes   File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in &lt;module&gt;     from apport.report import Report   File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in &lt;module&gt;     import apport.fileutils   File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in &lt;module&gt;     from apport.packaging_impl import impl as packaging   File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in &lt;module&gt;     import apt   File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in &lt;module&gt;     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'  Original exception was: Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 11, in &lt;module&gt;     from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in &lt;module&gt;     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'   Thanks for help No grub menu after Ubuntu install, booting directly into Ubuntu MS word: a macro to turn ON/OFF some proofing settings What macro could turn ON/OFF some proofing settings? (Unfortunately macro recording doesn't record the setting change)  I'm looking for a way to turn ON/OFF 2 proofing settings (at the same time):    check spelling as you type mark grammar errors as you type states that the relationship between current ( I ) voltage ( V ) and resistance ( R ) is  $$I = \frac{V}{R}$$  However  cause the resistance of a material to go to zero, and as I understand it, as $R \to 0$, $I \to \infty$. Does this present a problem for Ohm's law? Available space not changing when resizing a partition Coefficient growth in the power series $\sum u_n z^n = e^{1/(1-z)}$? So here is one I wish to know:   I use Tri-Gate second effect, which allows me to target and banish one card on the field. Then I link that with another monster to bring out another link. Tri-Gate would be in the graveyard but then I use transcodes effect (1 of the 3 co-links) to bring it back from the graveyard.   Can I use the second effect again?