Download Lab # 2 - UDC CSIT

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Lab # 2
1. Create a folder temp
2. Open notepad and copy/paste the below Java source code
/*******************************************/
public class NumberPrinter
{
public static void main(String[] args)
{
for(int i=0; i<10; i++)
System.out.print(i+",");
}
}
/*******************************************/
3. Save it as "NumberPrinter.java" under the "temp" folder created in step 1. Pay attention to the
filename exactly matching the class name
4. Press "Window" key + "R" and type "cmd"
5. Type "javac -version" and hit "Enter" Make sure you see a message with the java version
compiler
6. Compile your Java program: type "javac NumberPrinter.java" and hit "Enter"
7. Verify that you have generated the Java compiled class. Type "dir" and hit "enter" Note that a
new file with extension ".class" has been created. Your original Java source code has been
converted into Java bytecodes
8. Execute your Java Program! Let's use the java interpreter and type "java NumberPrinter"
Related documents