2
votes
2answers
82 views

Copy object properties without using many if statements

I have two class: InputForm.java public class InputForm { private String brandCode; private String caution; public String getBrandCode() { return brandCode; } public ...
-1
votes
1answer
64 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 ...
5
votes
3answers
508 views

Is it wrong to write an entire program under one class/method in Java?

I'm new to programming an created a simple rock, paper, scissors game. The entire program is under a single class and the main method, i hear that's probably not the best way to code. How should i ...
1
vote
1answer
114 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 ...
5
votes
2answers
193 views

How can I make this method less verbose?

I point to my problem in the comments of my code. I have a class RomanNumeral: public class RomanNumeral { private String romaNumera; private String romans = "IVXLCDM"; public ...
0
votes
0answers
47 views

I would like to ask for suggestions, criticisms and/or possible edits on my class file to be used on an Android Applciation?

I have a class file that would be used to connect and execute queries into the database. The only thing I am confused about is this: do you really need to drop tables and re-create them everytime you ...
3
votes
2answers
264 views

School project critique

This is a long one, I'll edit as instructed. I humbly submit the following for critique. This was my final project for an Intro To Java Programming class ("handed-in" already, I can't make changes). ...
0
votes
1answer
288 views

How to organize classes for blackjack game

I have to write blackjack game for college using processing language. It has to be done in a strict object oriented approach. So i can`t make an object of a class in another class unless there is some ...
1
vote
1answer
196 views

A Java BinaryTree class with extra methods need review

I am studying Data Structures course. So I would like to check whether my BinaryTree code is perfect, fine or has lots of mistakes. I would like any kind of advice on this code. So I can learn from ...
1
vote
2answers
67 views

Request for help to tidy up code involving arrays and loops

I posted the following code on here a few days ago: public class Practical4_Assessed { public static void main(String[] args) { Random numberGenerator = new Random(); int[] ...
4
votes
1answer
98 views

Attempt at an implementation of a TextFile class

How can I improve this class that should represent a text file? Im trying to write a simple class to represent a text file - which one would think should be quite easy.. I don't intend to add all ...
5
votes
1answer
109 views

ClassHierarchy Design in java for a small project

I have written a java code which does following:- Main goal is to fetch emails from (inbox, spam) folders and store them in database. It fetches emails from gmail,gmx,web.de,yahoo and Hotmail. ...
2
votes
2answers
135 views

Subclassing or not?

I have a class called Foo public class Foo { private String optionalProperty; private String name; private long uniqueId; // getters/setters for above properties } For some ...