datecommand.java

来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 41 行

JAVA
41
字号
/*
 * $Id: DateCommand.java,v 1.1 2003/11/25 11:52:58 epr Exp $
 */

package org.jnode.shell.command;

import java.util.Date;

import javax.naming.NameNotFoundException;

import org.jnode.shell.help.*;

/** 
 * A shell command to access the display the system date.
 * @author Matt Paine
 */
public class DateCommand {

        public static Help.Info HELP_INFO = new Help.Info(
		"date",
		"prints the current date"
	);

	/**
	 * Sets up any instance variables and processes the command arguments. 
	 * @param args The arguments to work with.
	 **/
	public DateCommand(String[] args) throws NameNotFoundException {
		System.out.println(new Date());
	}

	/** 
	 * Displays the system date
	 * @param args No arguments.
	 **/
	public static void main(String[] args) throws NameNotFoundException {
		new DateCommand(args);
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?