Answer to Question #4256 in Java | JSP | JSF for DANIELLE

Question #4256
Below is the start of my program but i need to have the filename of import java.util.Scanner; public class Divide { public static void main (String args [] ) { make kybd = new Scanner (; System.out.print("Enter number 1: ");
Expert's answer
There a some constrains in Java:
Only one "public class" can be in file. So
you can not write:
public class Cl1
public class
in same file.

Also name of file must be the same as name
of "public class". So if you write
public class Cl1
it must be
written in

So, you can rename your class to yournamehw1, or
rename file to It is also possible to create public class
yournamehw1 in and class Divide(not public) in, but
it will be visible only in

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

New on Blog