bael-3208 command line arguments examples (#7704)

* bael-3208 command line arguments examples

* moved command line argument examples from core-java-lang to core-java-lang-2
This commit is contained in:
fanatixan 2019-09-03 18:26:21 +02:00 committed by maibin
parent c6b3e0316c
commit 06cbdfce02
6 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,25 @@
*.class
0.*
#folders#
/target
/neoDb*
/data
/src/main/webapp/WEB-INF/classes
*/META-INF/*
.resourceCache
# Packaged files #
*.jar
*.war
*.ear
# Files generated by integration tests
backup-pom.xml
/bin/
/temp
#IntelliJ specific
.idea/
*.iml

View File

@ -0,0 +1,5 @@
=========
## Core Java Lang Cookbooks and Examples
### Relevant Articles:

View File

@ -0,0 +1,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId>
<artifactId>core-java-lang-2</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>core-java-lang-2</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-java</relativePath>
</parent>
<dependencies>
</dependencies>
<build>
<finalName>core-java-lang-2</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<properties>
</properties>
</project>

View File

@ -0,0 +1,12 @@
package com.baeldung.commandlinearguments;
public class CliExample {
public static void main(String[] args) {
System.out.println("Argument count: " + args.length);
for (int i = 0; i < args.length; i++) {
System.out.println("Argument " + i + ": " + args[i]);
}
}
}

View File

@ -0,0 +1,12 @@
package com.baeldung.commandlinearguments;
public class CliExampleWithVarargs {
public static void main(String... args) {
System.out.println("Argument count: " + args.length);
for (int i = 0; i < args.length; i++) {
System.out.println("Argument " + i + ": " + args[i]);
}
}
}

View File

@ -404,6 +404,7 @@
<module>core-java-modules/core-java-security</module>
<module>core-java-modules/core-java-lang-syntax</module>
<module>core-java-modules/core-java-lang</module>
<module>core-java-modules/core-java-lang-2</module>
<module>core-java-modules/core-java-lang-oop</module>
<module>core-java-modules/core-java-lang-oop-2</module>
<module>core-java-modules</module>
@ -1126,6 +1127,7 @@
<module>core-java-modules/core-java-security</module>
<module>core-java-modules/core-java-lang-syntax</module>
<module>core-java-modules/core-java-lang</module>
<module>core-java-modules/core-java-lang-2</module>
<module>core-java-modules/core-java-lang-oop</module>
<module>core-java-modules/core-java-lang-oop-2</module>
<module>core-java-modules</module>