Hitarth Patel

Greenhorn
+ Follow
since Apr 25, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Hitarth Patel

Ok so, basically, I was calling my contains method in my TestHashing class, and since my logic was off it returned a nullpointerexception. The second snippet is me asking for the file and instantiating a few variables. The first snippet is where the error happens, but its not really happening there, its happening in the contains method. So fixing the contains method fixed my problem. Thank you, for your time.

Is there a guide I could look at to make sure I am thorough enough when asking questions on here? Thank you!!
I apologize for my mistakes. I tried my best to be thorough.
My intellij idea does not want to give me a stacktrace for this even after I did "e.printStack();". I found that when I wrote the contains method in my ArrayList class, is where the error is at. I think it may be logic, but it looks right to me.
The exception message I am seeing is " java.lang.NullPointerException" and nothing else.

Yes, to the latter, when I type in my text files name("test.txt", without the quotations) and hit Enter after getting prompted for a file name.

Some new things I found, I may have written my contains method wrong for my ArrayList<AnyType>.

This is my contains method. I am trying to not override the equals() method. I want to be able to check whether the arraylist has the object in it and return true or false based on where it found it or not. This was my best attempt...


This throws an exception when I write the name of the file. I do not know what is causing it.

I am calling the file like this..this is in main, in the TestHashing class.
Thank you for the donations, and best wishes to everyone!!!
6 years ago
Also thank you for welcoming me. Always used this as a guide, finally had to sign up haha. Also, anyway I could edit posts?
6 years ago
I haven't done anything different. I usually develop on my macbook, but I decided to use my MSI for this assignment. Coded it up, and was gonna run it when this happened. Before this, I have never used this ide on this laptop. Also I've used packages before, didn't have a problem with them till today. I added a contains method last in my ArrayList class in my package. Also another thing I noticed is that in the out folder "C:\Users\phitarth\IdeaProjects\Hashing\out\production\Hashing\csci230\project" contains all of my code to compile, except the testhashing class.
6 years ago
Ok so basically I made two classes called OpenHashing and CloseHashing. I made a test class called TestHashing, and it good to go, but when I run it I get thrown a "Error: Could not find or load main class csci230.project.TestHashing". I have no idea how to go about fixing it, Let me know if I need to add the source for my TestHashing, but I am sure its fine and should compile.

Thank you.
6 years ago