- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 3
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
28 Posted Topics
Re: 1. The class bank is bad defined, u need follow the code conventions; when u define a class write the first letter in Uppercase, for example Bank. If u need test the method, can define the method main inside of the class Bank. 2. u have an special character in … | |
Hello i have an problem with an inheritance query using JPA (There is my Class Hierarchy) +UsuarioGenerico (MappedSuperclass or Entity - but is Abstract) -+Usuario (Entity) -+UsuarioPorEmpresa (Entity) Then, when i try make an select for Usuario, i not obtain results i try with an NamedQuery: `@NamedQuery(name="Usuario.findAll", query="SELECT u FROM … | |
Re: The javadoc, about toString method say: toString public String toString() Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended … | |
Re: any idea can be: int semiLength = 2; int pairs; count your length of ur String / 2 `String st = "HelloWorld";` =>` pairs = st.length/semiLength;` (result are int, and you have pairs - 5pairs for [He-ll-oW-or-ld]) after u can store it in an array :S `String [] pairsOfLetters = … | |
Re: an correctness in your code //You are enter here if age>32 if(age>32){ //there are equal to salary = salary + 1000 (salary += 1000) //or ... your new salary is the olderSalary + 1000 salary += 1000; System.out.println("your salary is: " + salary); }else{//else are used if your first condition … | |
Re: Hello, its an basic example maked for you, here u can add more logical rules. Collections Offer an method called "sort" that applies only in List and subclasses, but u need implements the class Comparable and override method compareTo. Here i use Comparable instead Comparable<BasicPizza>, but you can use both. … | |
Re: in the line 17 `else if(taxable_income >446299&&<1789399)` are u comparing taxable_inconme with 446299 and.... 1789399 with .... ?????? in the line 25 too, is the same error with the line 32 In java comparison need explicitly values... for example... if( x < a && b ) ... i understand your … | |
Re: sure! @JamesCherrill user_name is an String ("anName"), can u compare an Name with an Number??? i can say... if name "Divinity" is less than 22... it not have logic! ... so maybe obtain problems in the future with the variable "cars" configured by String ... however it will be an … | |
Re: If u use an boolean expresion in an condition. You need eval this answer. Example: if(x<4){ //results if x is less than 4 is TRUE }else{ //results if is FALSE } .... here is the opposite, check the simbol ! (Used for negation) if(!x<4){ //results if x IS NOT less … | |
Re: Hello, in line 59-60 public void setTotalInventoryValue(double value){ this.totalInventoryValue = productInStock * productPrice; } why exactly mean a variable (value?) it does not make nothing, because it is doesn't used. an feedback maybe can be: public void setTotalInventoryValue(){ this.totalInventoryValue = productInStock * productPrice; } then... in the line 104, this … | |
Re: U can read the Java Code Conventions in the section 6.2 . The first way are recommended. [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconventions-150003.pdf) | |
Re: when u import an interface u need implement all methods inside (override), when u import an class adapter maybe u need only implement a set of methods that really u need. | |
Re: can create an private that find if exist... so maybe... private boolean isAlreadyExists(int [] anActLoteryNumbers, int newNumber){ //search if exist in the list. for(int i = 0; i < anActLoteryNumbers.length; i++){ if(anActLoteryNumbers[i]==newNumber){ return true; } } return false; } when u validate if exists is FALSE can save this value … | |
Re: The error's are in line 99,100 and 107. because ur calling methond 'printf' and inside, u doesn't put variables for this values. example: System.out.printf("the double value is: %f", obj.getAnDoubleValue()); see the %f <-- is an variable that indicates an double value can be pushed. u can use %d <-- if … | |
Re: if is ur final year, u only need any explanation... of parts in your "own" java project. @stultuske have reason. ;) | |
Re: Line 18. an String for `(+,-,*,/)` cant be cast for an Integer, there is not a number. im not sure what are an correctly method for make an cast. but this is succefully. replace in the line 18. for this. `char c = op.charAt(0);` is all ! ;) have a … | |
Re: it maybe cant be out for the loop, because you have for (int numberOfScores; numberOfScores > 0; JOptionPane.showInputDialog("Enter Score")){ //... } this is an example for(int numberOfScores; numberOfScores > 0; numberOfScores--) here i use numberOfScores-- because this variable can be decreased for an compliant of the second condition (numberOfScores>0), then … | |
Re: if u r talking about "money" representation usually is because ur regional configuration are UnitedStates or any that use money signs DOLLAR! ... is an property of ur OS. | |
Re: if u compare only names, in the clase Items (Item name is recommended) maybe can be use an @Override public String toString(){ return itemName; } In the same way that youre using an foreach, you can make an search of this item... boolean exist = false; for(Items itemExistent : invLst){ … | |
Re: Sorry for the delay, answer is here ;) u can change another value for number and potency, in this example is number= 3 (number = 2 - in a second example) potency = 20 (potency = 5 -in a second example) Class LoopsSolution: package daniweb; import java.util.ArrayList; import java.util.Iterator; import … | |
Re: Class Person package daniweb; import java.util.ArrayList; import java.util.List; /** * * @author JoZulyk http://inovawebstudio.com */ public class Person { private String name = ""; private String sex = ""; private List<Dog> dogs = new ArrayList<>(); public Person(){ } /** * @return the dogs */ public List<Dog> getDogs() { return dogs; … | |
Re: please be more explicit... maybe, u need create and stored procedure with functions (any rowCount or making an select count(id) from table1) if this value is 5, then make an change insert this... be more especific please | |
Hello. Im making an webapp using Eclipse Keppler. REQUIREMENTS: - Eclipse for Java EE (or JBoss Developer Studio 7 o 8) - JBossTools installed on eclipse - JBoss Aplication Server 7.1.1 (not eap) - MySQL connector J 5.33 Structure of project: i use this package structure - persistence and ejbdao … | |
Re: Here u can use an object that contains all atributes writes. for example class Texts, that contains str1= "tree", str2="map", str3 = "sorted"... is necessary that u overwrite the method String toString() ... it can print a value overwrited ... In ur code, u obtain this: [Ljava.lang.object;@3e25a5] ... it's why … |
The End.