class B{     public void p(double i){         System.out.println("B");     } } class A extends B{     public void p(double i){         System.out.println("A");     } }   class Demo{     public static void main(String args[]){       //way of using polymorphic 1         A a=new A();         a.p(10.0);        //way of using polymorphic 2         A a=new B();         a.p(10.0)     }  }   Both 2 ways provide same answer.But I want to know what is the difference between these 2 ways of using dynamic polymorphic.what is the best way to use in a program?
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?
Can you use a Pensieve-memory to explore a place? Suppose $n$ divides $3^n + 4^n$. Show that $7$ divides $n$. Suppose $n \geq 2$ and $n$ is a divisor of $3^n + 4^n$. Prove that $7$ is a divisor of $n$.  My work so far:  I had a hypothesis that if $n| 3^n + 4^n$, then $n = 7^k$ for some $k\in\mathbb{N}$. But this is not necessarily so. Take $n = 7⋅379$, where $3^7 + 4^7 = 7^2⋅379$. Then, $3^7+4^7$ divides $3^n + 4^n$, and since $n$ divides $3^7+4^7$, we must have $n|3^n+4^n$. $y_{2n}, y_{2n+1}$ and $y_{3n}$ all converge. What can we say about the sequence $ y_n$? My friend and I are currently debating the following question:      Let $y_n$ be a sequence in a metric space and assume that the subsequences    $y_{2n}$, $y_{2n + 1}$, and $y_{3n}$ all converge. What can we say about the sequence $y_n$?    To me it seems that all the subsequences will converge to a limit say $y$. Then any term in the original sequence will be in one of these subsequences, it follows that the entire sequence $y_n$ converges to $y$.  I let $\varepsilon &gt; 0$. Since $y_{2n}$ converges to $y$ there exists an index $2N$ such that $d(y_{2n},y) &lt; \varepsilon$ for $2n \geq 2N$, and since $(y_{2n+1})$ converges to $y$ there exists $2M + 1$ such that $d(y_{2n+1}, y) &lt; \varepsilon$ for $2n + 1 \geq 2M + 1$.  Let $m \geq \max\{2N,2M+1\}$. If  $m$ is even, since $m\geq 2N$ we have $d(y_m,y)&lt;\varepsilon$; if $m$ is odd, since $m\geq 2M+1$ we have $d(y_m,y)&lt;\varepsilon$. Thus $d(y_m,y)&lt;\varepsilon$ for any $m \geq \max\{2N,2M+1\}$, and we conclude that $(y_n)$ converges to $y$.   However, my friend does not think that this is completely correct because I didn't use the $y_{3n}$ in the proof. I think he is right, that I do in fact need it, but I am unsure of how to add it in. All in all, I think that since any term in the original sequence will be in one of these subsequences, it follows that the entire sequence $(y_n)$ converges to $y$.  $2n+1$ covers all the odd terms and $2n$ converse all the even terms, so is $3n$ even needed? I would like to use it since the proof has it in the question, but I am unsure of what to do. Could someone kindly help me construct this proof in a better manner,and is my line of thinking correct? Thank you! Trying to remember a book about a human male travelling to alien planet How can I set Excel to always import all columns of CSV files as Text? Though I try to avoid it, I occasionally have to open a CSV file in Excel. When I do, it formats columns containing numbers, which makes them useless for my purposes. As far as I can tell, the only way to prevent this from happening on import is to rename the file so the extension isn't .csv and use the import wizard to specify the format of each column individually. For files with 50-60 columns, this is impractical.  Since every answer for this oft-asked question on the internet suggests either some means of converting the formatted numbers back once the file is open (which won't work for me - I want to solve the general problem, not a few specific cases) or manually selecting the format type of each column (which I don't want to do), I'm looking for a way to set a global preference or style such that all columns of all CSV files opened are always formatted as text.  I know about "armoring" the numbers with quotes, too, but the files I get don't come like that and I was hoping to avoid having to pre-process the files so Excel doesn't screw them up.  Is there a way to do specifically this: Always format all columns in opened CSV files as text, without manually selecting each column every time during import?  I'm using Excel 2003, but I'll take answers for 2007 if that's what you know. In mathematics, we like talking about idempotent matrices. In a masters program that I am currently enrolled in, I have heard one professor pronounce it one way, and another professor pronounce it another way. The  explains it better than I could:  Is there a correct pronunciation for idempotent? Is it like omnipotent (om-nip-o-tent), so id-EMP-o-tent, or is it more like the two seperate words idem + potent I'd say EYE-dm-POT-nt, but then I speak Brit. Charles Matthews 07:57, 30 Jun 2004 (UTC) Ditto, but then I speak Australian ;) Dysprosia 08:01, 30 Jun 2004 (UTC) Actually the British is more like EYE-dm-PO-tnt, I guess. Charles Matthews I'd just like to pedantically point out that it would be pronounced i-DEM-po-tent because because syllable onsets are maximized. daesotho 20:33, 21 Oct 2004 (UTC) The American pronunciation puts primary stress on the second syllable ('dem') and secondary stress on the fourth syllable ('tence'). Could somebody more familiar with IPA than I am please add this to the article as an accepted pronunciation? My American dictionary says |ˈīdemˌpōtənt| for the adjective. I speak American (non-natively) and I wouldn't stress the second syllable for itempotence. My only question is, right now it says /ˌaɪdɪmˈpoʊtəns/ -- but can't it be stressed on the first syllable too? Should we add /'aɪdɪmˌpoʊtəns/ as an alternative? -- 87.160.141.177 (talk) 14:50, 3 June 2011 (UTC) And by the way I think it's silly giving a pronounciation guide as this is just imposing a particular accent. (For what it's worth I pronounce idempotent with a short 'i', as in the word 'id'). Alex Selby I agree with Alex Selby - the pronunciation guide should be extended to show the variation, or removed. Strictly, there's no reason for the first i to be long (neuter idem has a short first syllable in Latin), and I can't find any authoritative source which advocates the pronunciation given. Ms7821 (talk) 22:59, 15 July 2015 (UTC)  Is there a &quot;correct&quot; pronunciation for this word? There are several unknown numbers in mathematics, such as optimal constants in some inequalities. Often it is enough to some estimates for these numbers from above and below, but finding the exact values is also interesting. There are situations where such unknown numbers are necessarily natural numbers, for example in Ramsey theory. For example, we know that there is a smallest integer $n$ such that any graph with $n$ vertices contains a complete or an independent subgraph of 10 vertices, but we don't know the exact value of $n$.  What kinds of unknown small (less than 100, say) integers are there? What are the smallest unknown constants which are known to be integers? Or, more rigorously, what is the smallest upper bound for an unknown but definable number that is known to be an integer?  I know that asking for the smallest unknown integer is ill-defined since we do not know the exact values. The more rigorous version of the question is well-posed, but I do not want to keep anyone from offering interesting examples even if they are clearly not going to win the race for the lowest upper bound.  An answer should contain a definition of an integer quantity (or a family of them) and known lower and upper bounds (both of which should be integers, not infinite). Conjectures about the actual value are also welcome. I have given one example below to give an idea of what I'm looking for. Shutdown and User button missing in panel What exactly happened with Dr. Crusher's husband and Captain Picard? How do I jump to the next or previous word with CTRL + arrow keys in a console? In terminal emulation applications, pressing CTRL + Left / Right arrows jumps from one word to the previous or next one. Is it possible to have the same functionality in a Linux console, whether it is in text or in framebuffer modes?  In my configuration, the CTRL + arrow keys are transformed into escaped character sequences and not interpreted. I want to prove with mathematical induction that:  $$\sum_{i=1}^n i \cdot i! = (n+1)! - 1$$  So in the first step we define $n = 1$:  $$\sum_{i=1}^1 i \cdot i! = 1 \cdot 1! = 1 = 2! - 1$$  In the second step we define $n = n + 1$:  $$\sum_{i=1}^{n+1} i \cdot i! = \sum_{i=1}^n i \cdot i! + (n+1)(n+1)!$$ $$\implies (n+1)! - 1 + (n+1)(n+1)!$$  This can now be simplified to $(n+2)(n+1)! - 1$ but I do not see how...  We could do $(n+1)!(-1 + (n+1)) = (n+1)! \cdot n$ but still this will not be the same as above.  What did I miss?  Bodo As far as I know, those are the only two.  They should be pronounced Soogher and Soor, shouldn't they?  I looked them up on Dictionary.com, and their etymologies reveal no trace of an SH, except where the listing for sugar had:     Middle English sugre, sucre (noun) &lt; Middle French sucre  &lt; Medieval Latin succārum  &lt; Italian zucchero  &lt; Arabic sukkar;  obscurely akin to Persian shakar, Greek sákcharon   I see an obscure kinship to shakar, but the word morphed so many times since then that the SH disappeared pretty much completely.  And sure is even worse, with no sign of SH:     Middle English sur ( e ) &lt; Middle French sur, Old French seur  &lt; Latin sēcūrus   Why are these the only two like this? Which application to preview .md files? Is there an application to preview markdown files (.md files) on OSX (for instance on Maverick)? How to urlencode data for curl command? I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site.  I need to url encode the value to make sure that special characters are processed properly.  What is the best way to do this?    Here is my basic script so far:  #!/bin/bash host=${1:?'bad host'} value=$2 shift shift curl -v -d "param=${value}" http://${host}/somepath $@ Don't remember the exact start to the story, but it went something like "walking along a path" or something, and when he hears what sounds like a shotgun blast behind him, he then feels something strike him in the butt. He passes out, and when he awakens, he discovers that the "shotgun blast" was actually a miniature spaceship that exploded and shot miniature aliens into his body. The aliens prove to be very beneficial because they clean up all the toxins and other poisons in his body. They can be transmitted through kissing or sexual activity.  Any help with the name of the story would be greatly appreciated.  Dan using a class defined in a c++ dll in c# code I have a dll that was written in c++, I need to use this dll in my c# code. After searching I found that using P/Invoke would give me access to the function I need, but these functions are defined with in a class and use non-static private member variables. So I need to be able to create an instance of this class to properly use the functions. How can I gain access to this class so that I can create an instance? I have been unable to find a way to do this.   I guess I should note that the c++ dll is not my code. Proving two entire functions are constant. Let $f$ and $g$ be entire functions such that $f^n+g^n=1$, where $n\geq 3$ is an integer. Prove that $f$ and $g$ are constant.  I suppose I should somehow prove that either $f$ or $g$ is bounded so that I can apply Liouville's Theorem, but I don't see how. I tried setting the derivative of the left hand side equal to zero and work with that but that did not seem to work. How does a circular lens produce rectangular shots? How to Silence the read command The read command is useful when reading data from the user . I am trying to read a number from 1-5 from the user. How can I make it so the input of the user does not show up in the log Purpose of @ Symbol Before Strings?