#Class cannot be resolved to Type
85 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @hollow arch! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
This is my class for item type
yet in my driver code i get ItemType cannot be resolved as type
I'm not sure what im doing I haven/t been able to compile this program for hours
Been told to try eclipse but that just doesnt work
i get this error now
at LinkedListDriver.main(4ysy.java:11)```
I think it has something to do with my import packages but im not sure
I can send entire code if necessary , really need help with this
class name can't starts from number
yeah i dont have any
at which line the error occurs ?
Says 11 which should be the public static void main args line
but that makes no sense
Do you think i can send all the code? and can you try running it?
sure
this is ItemType.java
LinkedListDriver.java
NodeType.java
SortedLinkedList.java
And they are all in a folder
at the moment 2 errors
- import package1.package2.ItemType;
are you sure that you do right import?
yeah so i read on stack overflow
that this error occurs due to bad importation and they said to do this
but you can delete that line im not sure what to do tbh
whats the other error?
don't follow instructions if you don't understand it. Since I placed all this files in one package, I don't need that line, so I deleted and that error is solved
second problem is in LinkedListDriver.java, line 20, ItemType type = new ItemType();
you need to pass a argument in the constructor
so like ItemType type = new ItemType(5); for example
because ItemType doesn't have default constructor
(without params)
ok yeah delete that line also
i read that on stack overflow too
cause i was getting ItemType type not resolved error
is it compiling now?
yeah
but not working, the reason as I mentioned in that another topic
nullpointerexception
but it compiles
wait so how do i fix that null pointer exception
and whne you say it compiles does the program say Enter the command?
like does it work?
as I described, you have to get rid of head = new NodeType(null); in constructor
yeah
it crashed earlier, before that line of code where it prompts that
bro im pretty sure the problem is saving
like its not updating my saved file
and it keeps giving me the same error no matter what i do
maven update or something
use eclipse. Start new project.
I did but theres a problem
what problem?
can i dm you?
you can, but I can talk 3 more minutes
are you actually writing to the file ?
which line ?
like I see a scanner but not a writer of any kind
im just printing the vlaues out
but you want to save them to a file correct ?
no
i was talking about my changes to the file itself
ive got it working now though
oh ok
tysm