ืืื ืืืจืืืื ืืื ืฉื ืฉืืจืช ืืคืงืืื ื-Java?
ืืืฆื ืืืฉืช ืืืจืืืื ืืื ืฉื ืฉืืจืช ืืคืงืืื ืฉื Java?
ืฉืืืช ืืืืฉื ืืืจืืืื ืืื ืฉื ืฉืืจืช ืืคืงืืื ื-java ืืื ืคืฉืืื ืืืื. ืืืฉืชืืฉ ืืืืขืื ืื ืืืื ืืชืื ืงืื ื-Java ืฉืื ื ืืื ืคืฉืื. ืื ืืืืืกื ืื ืืืขืจื ืฉื ืืืจืืืืช ืืืืขืืจืืช ื- main() . ืื ื ืงืจื ืืขืืงืจ ืืฉื args . ืขืืื ืืืืชืจืช ืืืฉืืชืคืช ืืงืืข ืืืื.public static void main(String[] args){โฆ}
ืืืืื
ืืื ื ืกืชืื ืขื ืืืืื ืืืืกืืจืช ืืคืืจืื ืืืื.// Program to check for command line arguments
public class Example {
public static void main(String[] args) {
// check if the length of args array is < 0
if (args.length <= 0) {
System.out.println("No command line arguments found.");
} else {
System.out.println("The first command line argument is: " + args[0]);
System.out.println("All of the command line arguments are: ");
// iterating the args array and printing all of the command line arguments
for (String index : args)
System.out.println(index);
}
}
}
ืืืฆืืข
ืืื ืืืคืขืื ืืช ืืชืืื ืืช, ืืขืืจ ืืช ืืืจืืืื ืืื ืืฉืืจืช ืืคืงืืื ืืืจื ืืืื. ืื ื ืืฉืชืืฉืื ื-IntelliJ IDE ืืื, ืืชื ืืืื ืืืฉืชืืฉ ืืื ืืืืจื ืฉืื. ืขืืืจ IntelliJ, ืืืจ ืืืคืฉืจืืช "ืืคืขืื" โ "ืขืจืื ืชืฆืืจืืช". ืืืืจ ืืื, ืขืืืจ ืืืจืืืกืืื "ืืจืืืื ืืื ืฉื ืชืืื ืืช" ืฉื ืืฆืืช ืืืงืื ืืฉื ื ืืืจืืืกืืืช ืืืืื ืืช. ืืชื ืืืื ืืืืื ืืช ืืืืขืื ืื ืฉืื ืืืืืง ืืืืื ืืื, ืืืฅ ืขื "ืืืฉืืจ" ืืืืืจ ืืื ืขื "ืืคืขืื". ืขืืืจ ืืืชื ืคืื ืืื ืชืืื ืืช ืื, ืืฉืชืืฉ ืืืงืกื ืฉืืืื.
ืฉืื ืืื ืื ืืจื.
ืชึฐืคืึผืงึธื
ืืืจืืืื ื ืืจืืฉืื ืฉื ืฉืืจืช ืืคืงืืื ืืื: ืฉืื ืื ืืืจืืืื ืืื ืฉื ืฉืืจืช ืืคืงืืื ืื: ืฉืื ืื ืืจื.
GO TO FULL VERSION