Tagged Questions
0
votes
2answers
57 views
Code Review : Report generation
I have written a small batch job which will collect data from db and send mail to user.Can you please do a review of the code with design prinicples in mind and also with best practices for Db and ...
-1
votes
1answer
46 views
Java Question for An Absolute Beginner [closed]
This is for a beginning Java course that poses the problem:
Write a class named Employee that has the following fields:
name. The name field references a String object that holds the employee's ...
1
vote
0answers
45 views
Vaadin web application
I am creating a web application for an enterprise and I would like to improve my way of coding, know what I do wrong and what I do well. I'll leave the main class' code here:
package com.puntobile;
...
1
vote
1answer
94 views
Playing Card Class - is this right?
The Art and Science of Java, a course book that uses the ACM library has an exercise that reads like this.
Implement a new class called Card that includes the following entries:
• Named ...
1
vote
1answer
128 views
Which code is better? And why?
I found two ways of writing the same program (one that only uses local variables, but no methods other than the main one) and other that uses one instance variable that is used in two methods.
This ...
2
votes
2answers
112 views
How can I improve this coin flipping code?
I am doing exercises for the Art and Science of Java textbook. I had an exercise that required me to program the simulation of flipping a coin until 3 consecutive "Heads" result appeared.
I did it, ...
-1
votes
1answer
92 views
How to apply Sieve of Eratosthenes test into my code [closed]
I have this code that tests prime numbers and I'm trying to make it fast as possible. I know a way but I just can't find how to execute it in to my code. Does any one know how to input in to the code ...
4
votes
4answers
204 views
Command line Contact Management
Can you please review the following code and give any suggestions for improvment?
Class ContactList.java
import java.io.*;
import java.util.*;
public class ContactList {
public static void ...
4
votes
2answers
166 views
How can I improve my code?
I just started Java programming yesterday (so don't expect too much), and I've written some code. My code works the way I want it to work, but there are obviously things wrong with it.
I was ...
0
votes
2answers
78 views
Repetitive code for different Database Entities with same implementation
I have this code in LogInService
public User isValid(User user) {
if(user == null)
return user;
User db_user = userDao.getUserByUsername(user.getUsername());
if ...
3
votes
3answers
147 views
Would like some feedback on code samples
I am currently in my 3rd year of a computer science course, I am looking into getting an internship over the summer but, I feel that my coding skills might be lacking for the workplace. Below, are ...
3
votes
3answers
167 views
Beginner to OOP: Do these classes properly represent the objects in Java?
These classes are part of a program I am working on to convert Arabic numerals to Roman numerals and also the reverse. Do these classes look correct for representing objects in Java?
public class ...
1
vote
2answers
230 views
What design pattern to use on this case
I have this code that converts audio to different file formats.
import java.io.File;
import it.sauronsoftware.jave.AudioAttributes;
import it.sauronsoftware.jave.Encoder;
import ...
4
votes
4answers
214 views
PMD code review violation
I have some doubts on code review tools violation
1) Most of the warnings in any code checking tools we get final
keyword could be used for any String used in a method. Is this
really required ...
0
votes
3answers
55 views
What is the best way to save this? (saving the data generated by an application) [closed]
I have this code, and i want to save the generated data, but i don't know how, A database? a file? do i need to chance everyting in the code and start over again?
I'm from brazil, so the variables ...