Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

Carey Brown

Saloon Keeper
+ Follow
since Nov 19, 2001
Carey likes ...
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
Forum Moderator
Carey Brown currently moderates these forums:
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Carey Brown

I think you are looking at perfect squares, as in: 16x16, 25x25, 36x36, etc.
Example: 16x16 would use 16 characters or integers and any row or column must use all 16 unique entries. The 16x16 would be subdivided into 16 - 4x4 sub-grids with the same unique entry requirement.
4 hours ago

Sith jay wrote:I have coded for Sudoku puzzle in java.The thing is my code has limitation for giving inputs for 9*9 grid.How do I make my code adaptable for all the grids.Please have patience.I am new to java.

What changes do I need to make so that the code can run on all grid sizes?The grid is square not a rectangle

I don't know what you mean by "all grid sizes". You mean a 10x10 grid, or a 31x31 grid, etc.? How would you fit 9 unique digits into those? Planning on using more than nine integers instead of nine digits? How would you subdivide the large grid into subgrids like Sudoku does?
4 hours ago
The String class has a method toCharArray() which you can use.
"board" should be defined as
char[][] board = new char[boardSize][];
7 hours ago

Daniel Demesmaecker wrote:At my worklaptop the ...\oracle\... also comes First...
I can 't even remember ever putting it there. Is it created when you install java (Not the jdk)

This was true for earlier Java versions but not 11. It seems that 11 forces you to know how to edit you PATH environment variable, and to make sure the path for 11 comes first.
12 hours ago

Daniel Demesmaecker wrote:This can't be your full code. What is new bean()?
I wouldn't checkfor a Q or A what if your question starts with an a?
You could keep a counter of read lines and do counter%2 do know when you need to start a new line

Answers and Questions may span multiple lines.
20 hours ago
20 hours ago
Your Collections.max(...) is expecting a Collection<T> as an argument. Trying to convert an int[] to a List using asList() doesn't work. You need to end up with a List<Integer> and there's no quick way to do that.
See: int[] to List<Integer>
21 hours ago
Your try-with-resources shouldn't have 3 objects, it will attempt to close all three when done, but, in your case, you only need to have the final one you are using. Closing that will indirectly close the other.

1 day ago

Different constructor. Notice additional argument.
1 day ago
could be replaced with a more readable for() loop
or better yet
Ditto for your rows.
1 day ago
Show us your input, your output, and what you expected.
1 day ago
You don't reset loopCount.
4 days ago

Campbell Ritchie wrote:Another suggestion:-
Use the next() method and take the numbers as text; switch on "1", "2", "Q", etc.

Agree on using switch(), but why use next() for a menu choice where having another value before pressing Enter should be an error?
4 days ago
You should have "UML Cake", "Cake", "Frosting", "Evaporated Milk"...
5 days ago
What have you done so far? Do you have a specific question?
5 days ago