I'm trying to wrap my head around interfaces and I've been reading a lot of similar questions/answers on the topic, but it's still not clicking with me. I understand what an interface literally is, but I don't get why you would ever use it. So an interface contains a bunch of empty functions, and you then implement that interface in a class. But what I don't get is, you still have to write a full function declaration for any function you take from the interface. So say you have a function 'void printHello()' in your interface, and you implement that interface in a class. You still have to write: public void printHello() {      System.out.println(&quot;Hello!&quot;); }  which is a complete function declaration. You could delete the 'implements interface' command and literally nothing would change, you would still have a working function 'printHello()'. So functionally speaking, isn't the interface basically doing nothing? To go further, you could have another class that also implements the same interface, but you could make the same function do something completely different: public void printHello() {      System.out.println(&quot;Bababooey!&quot;); }  So it's not like it's pre-defining functions so you can call them anywhere like a class/object would do. If this is the case what is the interface really providing?
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?
What would make a question popular with high views? I was wondering what might be making my questions less attractive to users?  I get very low views most of the time. What should be done to increase a question's popularity? I'm very new to Ubuntu, and have come to this point that I can't boot back to my Windows Vista anymore.  I thought that I would get some kind of dual boot in the beginning when booting my computer, but this doesn't seem too happen and I don't have the slightest idea on how to fix this. I was looking for help here at askubuntu, but I couldn't seem to find anything. I'm too new with this software.  I'll need hints and tips on how to fix this  Thanks for your time folks! Are there any good tools besides SeleniumRC that can fetch webpages including content post-painted by JavaScript? One major shortcoming of curl is that more and more wepages are having their main piece of content painted by a JavaScript AJAX response that occurs after the initial HTTP response. curl never picks up on this post-painted content.   So to fetch these types of webpages from the command line, I've been reduced to writing scripts in Ruby that drive the SeleniumRC to fire up a Firefox instance and then return the source HTML after these AJAX calls have completed.  It would be much better to have a leaner command line solution for this type of problem.  Does anyone know of any? Book series with a double planet system and poisonous bubbles that float around describes how to get the changelog for a given package. However, it's the whole changelog.  What I'd like is a way to see what will be changed in whatever I'm about to upgrade. For example, I was imagining something like:  $ sudo apt-get upgrade --show-changelogs Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done The following packages will be upgraded:   foo     -- adds the bar feature for better snazziness     -- removes the deprecated baz feature  1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 8,864 kB of archives. After this operation, 285 kB disk space will be freed. Do you want to continue [Y/n]?    Unfortunately, I don't see anything like that in the man pages for apt-get. Does this or something similar exist?  UPDATE: I've written a  talking about apt-listchanges and Debian changelogs in a little more depth that incorporates some of the feedback in this question. Which JDK version is compatible with Netbeans on Ubuntu? I'm trying to install Netbeans on my Ubuntu. It was successfully installed but was unable to create new projects or new files. I have installed JDK 12 and then I removed it because I found here a solution that recommended removal of latest versions of JDK and set JDK 8 as default. I did what solution said but now I can't install JDK 8. It is showing me this error message:   E: Package 'oracle-java8-installer' has no installation candidate    So I started searching on the Internet about the solution and I found that "Oracle Java (JDK) 8 Installer PPA (DISCONTINUED)".   What should I do now? Under what conditions does loot despawn? I have an input type="image". This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this input-image is paired with, I setup an event handler for the input-image. Then when the user clicks the image, they get a little popup to add some notes to the data.  My problem is that when a user enters a zero into the text box, I need to disable the input-image's event handler. I have tried the following, but to no avail.  $('#myimage').click(function { return false; }); Get month name from Date Meridian convergence. True north, magnetic north and grid north I'm having difficulty wrapping my mind around meridian convergence, the horizontal angular distance between true north and grid north.   Say I want to determine if a feature lies to the east or west of the central meridian (CM) by using true north and grid north designations on a topo map.   I realize grid north is parallel to the CM, while true north points to the poles, and magnetic north is the direction a compass points and constantly changing.   Looking at the figure below, I see grid north points to the east of true north. So does this fact alone mean everything on the grid is to the east of the true north, and therefore the CM? Does this simple fact mean that features in this grid lie to the east of the CM, or am I missing something.   Also, I realize I can just look at the tick marks and and see that this this grid in particular covers -80°22’ to -80°15, and the CM for zone 17R lies at 81°. But had I not known that and wanted to use the north arrows. Please explain. I have a shapefile with contours and their heights.   Is it possible to make a DEM from contours in QGIS without using GRASS?   I found  but the answer is for ArcGIS Desktop. How can I request a random row (or as close to truly random as is possible) in pure SQL? As a log viewer, which of vim's features are convenient?  less -F is quite good. But I believe vim could be better if we knew its hidden features.     * or #   v//d   g//d   etc..   PS. I don't use vim as a code writing tool. Extracting extension from filename in Python Is there a function to extract the extension from a filename? How do I move clock to the right end of GNOME 3 Panel from the middle? I'm working on a jet in blender. While thinking about the final scene, I wondered if there was a way to create schock diamonds(also known as Mach diamonds, Mach disks, Mach rings, donut tails or thrust diamonds) in blender.  Hopefully somebody can help, I haven't found anything online.      picture from wikipedia  picture from Tom Clancy's H.A.W.X  thanks for any tips.  tags: mach, schock, diamond, jet, exhaust, afterburner, engine, Physical phenomena  edit: added some pictures, BufferedWriter not writing everything to its output file Java string to date conversion Advantages of using different metric signatures in relativity and QFT I am studying General Relativity and some basic QFTs. It bothers me a lot that different books use different metric signatures, i.e. $(-+++)$ and $(+---).$ Can anyone tell me the advantages of using both of them, or why some people prefer the former while some prefer the latter? I would like to know which one should I while tackling different problems. Opening PDF generated by Python AddIn using Report (*.rlf) file automatcally? As a test I have:   Authored a test.mxd with one layer called Localities in a single data frame called Layers Authored a test.rlf using View | Reports > Create Report of ArcGIS 10.2.2 for Desktop Created a Python AddIn which creates the expected PDF file from the Report (*.rlf).   This is the code which all works to create the PDF report from the Localities features within the current extent:  import arcpy  import pythonaddins  class ReportForExtent(object):     def __init__(self):         self.enabled = True         self.checked = False      def onClick(self):         mxd = arcpy.mapping.MapDocument("CURRENT")         df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]         lyr = arcpy.mapping.ListLayers(mxd,"Localities",df)[0]         arcpy.mapping.ExportReport(lyr,r"C:\temp\test.rlf",r"C:\temp\test.pdf","EXTENT",extent=df.extent)         del mxd   Is there a way to have the Python AddIn not just create the PDF file but also open it in Adobe Acrobat Reader?