Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
            
                    
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        4年前关闭。
                    
                
        

我想打印另一个类中的方法。我怎么做?

谢谢!

我尝试调用的方法名称是
public void printMenu()...类中的FoodMenu

最佳答案

创建FoodMenu的实例并使用它来调用printMenu()

FoodMenu foodMenu = new FoodMenu();
foodMenu.printMenu();

09-09 21:13