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.

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.

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.
+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
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.