目前分類:【Java】 OCA 1Z0-808 (48)
- Jun 05 Sun 2022 16:55
【Java】【OCA】22. What is the result?
- Jun 05 Sun 2022 16:32
【Java】【OCA】15. What is the result?
- Jun 05 Sun 2022 16:13
【Java】【OCA】10. What is the result?
- Jun 05 Sun 2022 16:02
【Java】【OCA】7. What is the result?
- Jun 05 Sun 2022 15:44
【Java】【OCA】5. Which modification enables the code to print 54321?
- Jun 05 Sun 2022 15:15
【Java】【OCA】3. What is the result?
- Jun 03 Fri 2022 13:26
【Java】【OCA】1. Which two sets of actions, independently, enable the code fragment to print Fit?
一. 題目
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package clothing; | |
public class Shirt { | |
public static String getColor() { | |
return "Green"; | |
} | |
} | |
Given the code fragment: | |
package clothing.pants; | |
//line n1 | |
public class Jeans { | |
public void matchShirt() { | |
//line n2 | |
if(color.equals("Green")) { | |
System.out.print("Fit"); | |
} | |
} | |
public static void main(String[] args) { | |
Jeans trouser = new Jeans(); | |
trouser.matchShirt(); | |
} | |
} |
- May 26 Thu 2022 22:30
【Java】2022 OCA 1z0-808 考試心得