Posts by leonardokbruksch • 319 points
10 posts
-
2
votes1
answer685
viewsQ: Linkedlist Recursive Method
I’m having trouble implementing a recursive method for inserting an element at the end of a simply chained list. Below is the Iterative method: public void addLast(Node<E> novoNodo){…
-
0
votes1
answer57
viewsQ: Generating objects with a certain value within a defined distribution
I’m having a hard time creating percentage-related goals. What I want to do is a method that generates objects, all objects have only one attribute. I need that 20% of the objects are generated with…
javaasked leonardokbruksch 319 -
7
votes4
answers4670
viewsQ: Select string at random
I need a way to randomly create a string between some options. Let’s say I have the strings "A" "B" and "C", it would be possible for Java to choose randomly?
-
0
votes1
answer86
viewsQ: Array Out of Bounds reading File
I’m having a problem with my code, in my text file I should read the last line is blank, and then it should not be read, however I’m getting out of Bounds. Line for example file:…
-
3
votes1
answer136
viewsQ: Insert Selected Objects into Array
I’m doing a Formula 1 racing program, my program performs reading of various race files, and creates the objects of the race. I need to deploy in this program a class that has an array to store only…
-
2
votes1
answer213
viewsQ: Comparable and Arrays.Sort
I’m having difficulties in using the similar interface, I must perform the increasing comparison of drivers according to their score (class PilotoEquipe), and then in class CorridaX1, need to use…
javaasked leonardokbruksch 319 -
1
votes2
answers445
viewsQ: Pass the object as argument
There is the +fazUmaCompra method in the Customer class that calculates the discount and the customer’s points, and at the end of the method, an object of type Purchase should be instantiated, but I…
javaasked leonardokbruksch 319 -
-1
votes2
answers975
viewsQ: Bad Operand types for Binary Operator
I have to do an exercise for the college related to sales and in the customer class I need to apply a +fazUmaCompra method. Detail, I performed so far only part "a", I put everything in case help in…
javaasked leonardokbruksch 319 -
-1
votes2
answers318
viewsQ: java.lang.nullPointerException Error
I’m doing an exercise in Java and it requires me to create a product note sold, containing random numbers plus the first three letters of the customer as product code, but when I try to generate the…
-
3
votes3
answers7392
viewsQ: Create an object from another class
I own the class Endereco and the class Cliente, I built 2 builders for the Cliente, and in one of them is to be inserted the name of the client and an object of type Endereco, which works perfectly,…