Question: I am attempting to retrieve the most recent address associated with a name (as there are usually multiple addresses per name). I have created the following query with a subquery in my join. I am able to pull back one address per party as I wanted but the address/city doesn't always match up or the address that's returning is not the most recent address (per the date associated). Am I writing the subquery with MAX wrong? Is there a way to make sure the correct city goes with the correct address? 

```
select 
    [demographics].[DOB],
    Address1,
    Address2,
    City,
    State,
    Zip

from [demographics]
    left join (select
                    [address].[demographic_ID], 
                    max([address].[address1]) as Address1,
                    max([address].[address2]) as Address2,
                    max([address].[city]) as City,
                    max([states].[state_title]) as 'State',
                    max([dbo].[address].[zip]) as Zip
                from [address]
                    inner join [states] on [address].[state_ID] = [states].[state_ID]
                group by [address].[demographic_ID]) as AddressSub 
        on [demographics].[demographic_ID] = AddressSub.[demographic_ID];

```

Answer: 
[JLS](https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html) says this:

**9.4 Abstract Method Declarations:**

> 
> For compatibility with older versions of the Java platform, it is
>  permitted but discouraged, as a matter of style, to redundantly
>  specify the abstract modifier for methods declared in interfaces.
> 
> 
> 

You also don't need to specify `public` for interface methods. 

See the [documentation for Defining an Interface](https://docs.oracle.com/javase/tutorial/java/IandI/interfaceDef.html):

> 
> All abstract, default, and static methods in an interface are
>  implicitly `public`, so you can omit the public modifier. 
> 
> 
> 

```
public interface Payable
{
  double getPaymentAmount();
}

```

You'll need an implementation of the interface to actually implement the logic. For example something like this:

```
public class PayableImpl implements Payable 
{
  double getPaymentAmount() 
  {
     // actual implementation that returns the payment amount
  }
}

```
You don't need to provide the ***abstract*** keyword in an Interface method.
All methods in an interface is an abstract method. No concrete methods are allowed in an interface.

An **abstract class** can have both **abstract method** and **Concrete method**. In that condition we need to specify if a method is an abstract one or a concrete one.

```
public interface Payable 
{
    double getPaymentAmount();
}

public abstract class Payable
{
    //This is an abstract method. It has to be implemented by the extending class
    abstract public double getPaymentAmount(); 

    //This is a concrete method. It can be inherited by the extending class
    private int CalucateSum(int a, int b)
    {
        return a+b;
    }
}

```