All Questions
11 questions
2
votes
2
answers
315
views
Console dice game
I wrote a simple dice game with the purpose to practice arrays and classes. I would like some critique on my code structure and quality - as well as thoughts on my thoughts to improve it.
Here's the ...
0
votes
2
answers
144
views
ContactsList implementation in Java
I created a ContactsList class in Java that holds Person objects. I consider this is a side project for my GitHub profile. Any ...
4
votes
2
answers
155
views
Minimum difference between numbers in a file
I'm learning Java and I created a simple solution for the following problem:
Given a file [filename].txt such that each line has the format ...
1
vote
1
answer
107
views
Correct modularization and array usage
I am trying to brush up on Java after not programming for a few years. The idea behind this code is simply to get used to object oriented programming, modularization techniques, and basic arrays. Any ...
0
votes
3
answers
1k
views
Divisions using Arraylists
Exercise: Using Arraylists create a program that makes divisions between two very large numbers (numbers greater than 10 digits).
I did it (the code works), but could my code be improved?
...
0
votes
2
answers
184
views
Verifying if two numbers are equal using ArrayLists
I have some question about the code below. It works correctly, but:
Is there a better/another way to solve the exercise (as an expert would have done:) or mine it's perfectly done?
Also, I don't see ...
1
vote
1
answer
973
views
Method that remove duplicates from a list of words in Java [closed]
Today, I took a coding challenge with this question:
Given a List of Strings, write a method removeDuplicates that removes duplicate words from the List and returns an ArrayList of all the unique ...
1
vote
1
answer
122
views
Finding pair in an array with the OO approach
Description:
I am trying to solve algorithmic problems mixing them with Object oriented design as part of my interview preparation. So, the question is given an array of integers find the pair of ...
7
votes
3
answers
6k
views
Let's play Rock, Paper, Scissors
I have written my first rock, paper, scissors project recently. I had to use a lot of if statements and System.out.println(); commands in the program. I am wondering what ways I could optimize my ...
-2
votes
1
answer
2k
views
Implementing Arrays in Java Class
I have the following code to write:
Modify the Student class so that instead of 3 tests you will now have
an array of 100 tests. However, not all of the scores may be set. You
need to add an ...
3
votes
3
answers
4k
views
Clear ArrayList
I create class level static ArrayList by the following line.
static ArrayList<Student> studentList = null;
Then I create and fill ArrayList with some ...