Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
Import classes in onlinegdb
+1
vote
asked
Feb 11, 2020
by
Akirakato1
(
130
points)
I started a new java project with multiple files. For example, class A with the file name A. If I go to the Main.java file and do import A;, it throws error "." and ";" expected at end of the import line.
import
java
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
2 Answers
0
votes
answered
Feb 12, 2020
by
gameforcer
(
2,970
points)
You probably just need to include file extension in it's name, that way it always worked for me.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
+1
vote
answered
Feb 21, 2020
by
zemiak
(
530
points)
Don't use import of your own files, but check if your public classes are in files with same names as class and files have extensions .java
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...