Tạo 1 enum tên các công ty Google, Facebook, Xerox, Yahoo, Ebay, Microsoft
Jump to turn (6)
- 1Tạo 1 enum tên các công ty Google, Facebook, Xerox, Yahoo, Ebay, Microsoft
- 2Which of the following is true about new when compared with malloc. 1) new is an
- 3Which of the following is true about new when compared with malloc. 1) new is an
- 4Predict the output? #include using namespace std; class Test { int x; Test() { x
- 5What happens when delete is used for a NULL pointer? int ptr = NULL; delete ptr;
- 6Is it fine to call delete twice for a pointer? #include using namespace std; int
- User
Tạo 1 enum tên các công ty Google, Facebook, Xerox, Yahoo, Ebay, Microsoft
- Assistant
Đây là cách tạo một enum trong ngôn ngữ Java với tên các công ty Google, Facebook, Xerox, Yahoo, Ebay và Microsoft:
javapublic enum Company { GOOGLE, FACEBOOK, XEROX, YAHOO, EBAY, MICROSOFT }Để sử dụng enum này, bạn có thể thực hiện theo các ví dụ sau:
java