Java, Maven
in your workspace run terminal and write:
$ mvn archetype:generate -DinteractiveMode=false -DgroupId=one.unus -DartifactId=one.unus.project
-Dpackage=one.unus.project.app -Dversion=0.0.1| public class LogicAndOr { | |
| public static void main(String[] args) { | |
| boolean result; | |
| result = isAndTrueOrFalse(true, true, true); | |
| System.out.println("And 1: " + result); | |
| result = isAndTrueOrFalse(false, true, true); | |
| System.out.println("And 2: " + result); |
| public class IntegerOrString { | |
| public static void main(String[] args) { | |
| String object1 = "S124"; | |
| String object2 = "124-ab45"; | |
| String object3 = "124"; | |
| int result1, result2, result3; | |
| /* public static Integer getInteger(String nm) */ |
| public class NotImplementedException { | |
| public static void main(String[] args) { | |
| NewUseCase(); | |
| } | |
| static void NewUseCase() { | |
| //TODO Should be implemented. | |
| throw new UnsupportedOperationException("not yet implemented and should be implemented!"); |
| import java.util.Collections; | |
| import java.util.List; | |
| public class ListIsNotNull { | |
| public static void main(String[] args) { | |
| if(myList() != null) { | |
| System.out.println(true); | |
| } else { |
| public class MyClassCannotExtendFinalClass extends String{ | |
| /* | |
| * cannot subclass the final class String. | |
| * String is a final class. | |
| * You cannot extend a class that is marked as final. | |
| * | |
| */ | |
| } |
| import java.net.URL; | |
| import java.net.URLClassLoader; | |
| public class SeeClassPath { | |
| public static void main(String[] args) { | |
| getClasspathFromClassloader(); | |
| } | |
| static void getClasspathFromClassloader() { |
| import java.net.InterfaceAddress; | |
| import java.net.NetworkInterface; | |
| import java.net.SocketException; | |
| import java.util.Enumeration; | |
| public class IPv4 { | |
| public static void main(String[] args) throws SocketException { | |
| getIPv4(); | |
| } |
| import java.awt.Desktop; | |
| public class HaveYouDesktop { | |
| public static void main(String[] args) { | |
| if(isDesktopSupported()) { | |
| System.out.println("Yes, Desktop Supported!"); | |
| } else { | |
| System.out.println("Not Desktop Supported!"); | |
| } |