Question:



1)If I have two classes, how can i run it in the command prompt? (ex:
java FileName) for only one class.
2)If I need an input from the command prompt, (This is required. I
should not use any other method of getting an input) how can i, for
example, print no input if there's no input?

To illustrate:

1)class File{
}

class Main{
}

c:\>javac File.java
c:\>java File

Error: Exception in thread "main" java.lang.NoSuchMethodError:main

2) sample run:

c:\>java Palindrome A Toyota
A palindrome

c:\>java Palindrome abracadabra
Not a palindrome

c:\>java Palindrome
No Input!

.