Q:

Importing Java classes in Eclipse on Mac

I have two classes (CoinFlip and Incr) in different files and I'm trying to import Incr to use in CoinFlip:
package com.iRprojects.Book.Java;

import java.util.*; 
import com.iRprojects.Book.Java.*;

public class CoinFlip { 

    public static void main(String[] args) {
        int g = 5;

        System.out.println(incr(g));

    }
}   

and
package com.iRprojects.Book.Java;

public class Incr {
    public static int incr(int i){
        i++;
        return i;
    }
}

With the classes like this eclipse says incr() isn't found.
If I change it to:
package com.iRprojects.Book.Java;

import java.util.*; 
//import com.iRprojects.Book.Java.*;

public class CoinFlip { 

    public static void main(String[] args) {
        int g = 5;

        System.out.println(com.iRprojects.Book.Java.Incr.incr(g));

    }
}   

It compiles fine.
Any ideas?

A:

In this case you have to write:
import static com.iRprojects.Book.Java.Incr.*;

This means import of all static members from com.iRprojects.Book.Java.Incr class taking into account the access modifiers.

