helloworld.java:
package com.javarush.helloworld;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by dpool on 08.06.2016.
*/
public class helloworld {
public static void main(String[] args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String myname = null;
System.out.print("Введите ваше имя: ");
try {
myname = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Привет, " + myname + "!");
}
}
Запуск:
C:\JavaSolutions>javac helloworld.java
C:\JavaSolutions>javac -cp . helloworld.java
javac -cp C:\JavaSolutions helloworld.java
C:\JavaSolutions>java com.javarush.helloworld.helloworld
[com.javarush.helloworld].[helloworld] = [package_name].[class_name]
Комментариев нет:
Отправить комментарий