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
public class CowBoyFizzBuzz { | |
public static void main(String[] args) { | |
for (int number = 1; number <= 100; number++) { | |
if (number % 15 == 0) { | |
System.out.println("FizzBuzz"); | |
} else if (number % 5 == 0) { | |
System.out.println("Buzz"); | |
} else if (number % 3 == 0) { | |
System.out.println("Fizz"); |
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
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main); | |
User defaultUser = new User(); | |
defaultUser.setFirstName("Somkiat"); | |
defaultUser.setLastName("Puisungnoen"); | |
binding.setUser(defaultUser); | |
} |
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
class A { | |
a() | |
} | |
class B { | |
b() | |
} | |
class C { | |
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
public class Example { | |
private DatabaseThingie myDatabase; | |
public Example() { | |
myDatabase = new DatabaseThingie(); | |
} | |
public void doStuff() { | |
myDatabase.GetData(); |
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
String status = ""; | |
status = connect(); | |
if(status != null && "success".equals(status)) { | |
status = prepare(); | |
if(status != null && "success".equals(status)) { | |
List<User> users = execute(); | |
if(users != null && users.size() > 0) { | |
.... | |
} |
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
public class DataHolder { | |
public final String data; | |
public DataHolder(String data) { | |
this.data = data; | |
} | |
} |
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
public class InvalidTest { | |
@Rule | |
public ExpectedException thrown = ExpectedException.none(); | |
@Test | |
public void input_is_null_should_thrown_numberformat_exception() { | |
thrown.expect(NumberFormatException.class); | |
thrown.expectMessage("ข้อมูลเป็นค่า null (Null Value)"); |
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
<application | |
android:name="com.devahead.extendingandroidapplication.MyApplication"> | |
... | |
... | |
</application> |
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
class Employee { | |
private let id: Int | |
private let firstname: String | |
init(id: Int, firstname: String) { | |
self.id = id | |
self.firstname = firstname | |
} | |
} |
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
$/Applications/Xcode6-Beta1.app/Contents/Developer/usr/bin/xcrun swift -i script.swift | |
$xcrun swift -i script.swift | |
$swift -i script.swift | |
ปัจจุบัน | |
$swift script.swift |