(7-16)根据提示补全程序空白处,使程序能够正确运行。 // 利用适配器模式,把一个英文单词翻译成中文 // 源类:英语单词类 class English { private String[] list = { "dream" , "great" , "wonderful" }; public String 1 { return list [ i ]; } public int getSize() { return list . length ; } } // 目标接口:汉语 interface 2 { String 3 ; } // 适配器类,把英语单词转换成中文 class 4 implements Chinese { private 5 list ; int index ; public PowerAdapter(English list , int index ) { this . list = list ; this . index = index ; } public String getChinese() { // 把英文转换成中文 if ( this . index > list .getSize() || this . index < 0) return null ; String word = list .getEnglishWord( this . index ); if ( word .equalsIgnoreCase( "dream" )) return " 梦想 " ; else if ( word .equalsIgnoreCase( "great" )) return " 伟大 " ; else if ( word .equalsIgnoreCase( "wonderful" )) return " 绝妙的 " ; return null ; } } public class DemoAdapter { public static void main(String[] args ) { English english = new English(); Chinese chinese = new PowerAdapter( english , 0); System. out .println( chinese .getChinese()); } }