1. public void add(int a, int... b) { stackoverflow.comCould someone show me a practical a use of the ... array method delcaration? Is it just a way to declare an optional parameter instead of passing null value?
|
2. passing percent to public int method java-forums.orgI believe the author of the text I am using made an error in the problem he has presented. The problem asks to write a main method that includes a percentage of increase and pass that to an int(parameters) method and recalculate. Below is the entire code I have so far. Is there a solution? The problem seems confusing to me. ... |
3. How do i return nothing in a "public int getNothing()" method ? forums.oracle.comDarned ... Thanks for this reply anyway! I've come across this problem severall times , but always found an alternative solution ... but in this case it's kinda necessary ... Should i throw an error, or is there a return statement like null ? if none of those, is there a comon procedure to bypass it that you guys might know ... |
4. public ints are not working in method displayDice forums.oracle.com/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // |
5. public int indexOf(int ch, int fromIdx) doesn't work for some decimal value forums.oracle.comint badDecimal = 131; int idxBadDecimal = strHasDecimal131.indexOf( badDecimal, 0); System.out.println( "index of Bad Decimal: " + idxBadDecimal ); The output is: index of Bad Decimal -1 int badDecimal = 192; int idxBadDecimal = strHasDecimal192.indexOf( badDecimal, 0); System.out.println( "index of Bad Decimal: " + idxBadDecimal ); The output is: index of Bad Decimal: 11 |
6. public int read(byte b[]) forums.oracle.comthanks for your answer, now I'm certain and perhaps I can get a recommendation for the following... In order to do a particular search&replace (not as simple as it sounds since there are several algorithms that I need to include) in a 1 GB file, I'm loading the file into a byte array and doing the logics of the program, however ... |