Capitals and countries game
String[] capital = {"Lisbon", "Madrid", "Paris", "Berlin", "Warsaw", "Kiev", "Moscow", "Prague", "Rome"};
String[] country = {"Portugal", "Spain", "France", "Germany", "Poland", "Ukraine", "Russia", "Czech Republic", "Italy"};



Two string arrays with members that are supposed to match by index?  Extremely difficult to maintain, as I learned from my own experience.  Use a map instead, so you can do something like:

String capital = countryCapitalMap.get(countryName);


This will help ensure there is an entry for each country/capital and make it so you only have to update things in one place.



Don't hardcode the length of the array:


int randomint = r.nextInt(9);



Use the length of the array instead, or for a map, use the size() method.



Your naming isn't always clear.  How do I know what r stands for without seeing the definition?  How did you determine to use d as your loop variable?



Just use the ordinary false keyword instead of the explicit Boolean.FALSE field here:


while (was[randomint] == Boolean.FALSE)