76 960
Assignments Done
Successfully Done
In June 2019

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 yournamehw1.java.

import java.util.Scanner;

public class Divide {

public static void main (String args [] ) {

make kybd = new Scanner (System.in);

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 Cl1.java.

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

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

Privacy policy Terms and Conditions