Untitled.jpg
could anyone help me? thanks
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Please copy and paste here as text what you want us to see. The image is hard to read and no text can be copied from an image to include in a response.
If you don't understand my answer, don't ignore it, ask a question.
AleksandraVulisic (August 26th, 2017)
When i want to make a public class,there is an error in the program that said "The public type NameOfClass must be defined in its own file", and i don't know how to do that. Can you please tell me?
The name of the java source file must match the name of the public class it contains.in its own file
public class XYZ
must be in the file XYZ.java
If you don't understand my answer, don't ignore it, ask a question.
AleksandraVulisic (August 26th, 2017)
But what happens when i have to extends some class? I had try it and it's a mistake.
for example:
public class ABX{
//some txt
}
public class Letters extends ABX{
//some txt
}
it said that Letters must be defined in its own file
There can only be ONE public class in a source file. Only the class whose name matches the source file name can be public.
Remove the public attribute for the other classes.
If you don't understand my answer, don't ignore it, ask a question.
AleksandraVulisic (August 26th, 2017)