开发者

java getting to see the user input side

开发者 https://www.devze.com 2022-12-15 00:19 出处:网络
Given this: javac is the java compiler. It compiles the file, but has no output if there are no warnings or errors.

Given this:

javac is the java compiler. It compiles the file, but has no output if there are no warnings or errors.

What can I use to view the file from a user's perspective- user is suppose to see a vending machine that allows them to buy certain stuff from vending machine.java, apparently just running javac somevendmachine.java is not really helping.

There are no errors from javac or feedback, so based on that assumption and the feedback from a prior question, I know the code works; however, how do I set the java code such that a user can now choose selections from the vendingmachine.java or what do 开发者_开发知识库I install or read?


After you compiled your code you can start it using java <class name>. Your class must have a method:

public static void main( String[] args )

This method is executed when you start your program.


javac only compiles the code to a class file.

You then need to run the class file through the Java virtual machine by typing

java VendingMachine
0

精彩评论

暂无评论...
验证码 换一张
取 消