This file contains hidden or 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 static void main(String []args) { | |
| //your work here! | |
| } |
This file contains hidden or 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 FunMainMethodTrivia { | |
| //Original Main Method | |
| //JVM will always call it | |
| public static void main(String []args) { | |
| // | |
| } | |
| //Valid overload | |
| //JVM will not call it. | |
| public static void main(String s1) { | |
| //You must call this method as a developer |
This file contains hidden or 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
| /** | |
| * Retrieved from https://developer.android.com/reference/android/os/Looper.html | |
| */ | |
| class LooperThread extends Thread { | |
| public Handler mHandler; | |
| public void run() { | |
| Looper.prepare(); | |
| mHandler = new Handler() { | |
| public void handleMessage(Message msg) { | |
| // process incoming messages here |
This file contains hidden or 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
| /** | |
| * Code retrieved from https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/ActivityThread.java | |
| * Modifications are indicated in the comments | |
| */ | |
| public static void main(String[] args) { | |
| //Modification - Removed unrelated initializers. | |
| //Android initializes some tracers, event loggers, enviroment initializers, trusted certificates and updates the process' state | |
| Looper.prepareMainLooper(); | |
| ActivityThread thread = new ActivityThread(); | |
| thread.attach(false); |
This file contains hidden or 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
| /** | |
| * AOSP | |
| * Looper class | |
| */ | |
| public static void loop() { | |
| final Looper me = myLooper(); | |
| if (me == null) { | |
| throw new RuntimeException("No Looper; Looper.prepare() wasn't called on this thread."); | |
| } | |
| final MessageQueue queue = me.mQueue; |
This file contains hidden or 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
| void main(); | |
| void main(string[] args); | |
| int main(); | |
| int main(string[] args); |
This file contains hidden or 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
| import "fmt" | |
| func main() { | |
| fmt.Println("Hello, World!") | |
| } |
This file contains hidden or 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
| main :: IO() | |
| main = | |
| putStrLn "Hello, World!" |
This file contains hidden or 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
| int main() { | |
| write("Hello world!\n"); | |
| return 0; | |
| } |
This file contains hidden or 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
| import sys | |
| def main(argv): | |
| n = int(argv[1]) | |
| print(n + 1) | |
| if __name__ == '__main__': | |
| sys.exit(main(sys.argv)) |