Given two character arrays a[] and b[], remove from b[] all occurrences of all characters that occur in array a[]. You need to do this in-place i.e. without using an extra ... |
I am writing a client/server application. I have a Message class with several String fields. I have written the following method to return a char[] of these fields:
public char[] toArrayOfChar()
{
...
|
I have a character array that array have 10 values .I want the alternate character like 1st,3rd,5th..... from that array .Please any one tell me how to do that
|
I'm trying to create a method that will take a given array of letters and generate a two-dimensional array containing all letter combinations, including sub-combinations.
So for the letters: abc
I want a ... |
If I have an unordered character array, how can I get the unique elements?
|
I currently have an array of points (x,y) from the result of an A* pathfinding function. This array is set up so that the first index is the point closest to ... |
Hi. I came across this question and it has me confused. Question: After the declaration: char[] c = new char[100]; what is the value of c[50]? a) 50 b) 49 c) '\u0000' d) '\u0020' e) " " f) cannot be determined g) always null until a value is assigned The given answer to the question is c. I included the code ... |
|
Thanks Marc, it works fine now. I'm doing my next exercise, and I need to convert a character array to a string. When I try to use the method in BlueJ and enter the character array with {a, b, c}, it says that it cannot resolve variable a. If I put {"a", "b", "c"}, it says it found a string where ... |
Hi, key[0]=128; key[1]=32765; key[2]='Z'; key[3]=65535; It is giving the output ? ? Z ?. I thought,byte and short types are implicitly conver to char.It converted.But Why,It is giving ? for everything.Is char arrays,using ASCII codes for numbers from 0 to 127.What about the numbers from 128 to 65535.Please share your knowledge. Thanks, Shiva |
You need to know two things to understand this: (1) If you call toString() on an array, you always get a String that looks like "[C@24c21495". This is not the address of the array, but rather an indication of the type (the "[C" part), an @ sign, and the return value of calling hashCode() on the array. (2) There are many ... |
Hi everybody, I am having a character array which stores digits, alphabets lower and upper case, this wont change dynamically, I mean the array is constant. final public static char chars[]=new chars[62]; Now I want to populate this array with characters, I can do this manually, but I want to write a function for that and make my program to populate ... |
public class ReplaceCharacterArray{ public static void main(String args[]){ char a[] = {'G', 'O'} char b[] = {'G', 'O', 'O', 'G', 'L', 'E'} //to replace all the occurences of all the characters of //a[] array in b[] array we have below logic. for(int i=0;i |
Hello, I am VERY new to JAVA and I was wondering if someone can please help me understand how to use getLength? I went on the JAVA website and saw an example, but it seemed over complicated. if for example I have a character array as follows: char word[]={'M','U','S','I','C'}; ( OR ANY OTHER WORD IN THE ARRAY) How can I store ... |
Please post the entire source code if possible and if its not too long. The argument type you pass to asList and the type of List must be the same. You passed char[] , an array. But the list is of a different type -Character. I tried to make a program out of your code (it compiled), here it is : ... |
Hello all. This is my first post! I am trying to teach myself a little Java. I have no coding experince. Anyway, is there a way to pass a character array to a new method? I am trying to create a "virtual 3d box." After the box has been created I want the user to enter a number which will change ... |
Hey guys, I am working on this code that will (ultimately) read a line in the html code, and find the word "Title". That being the page title. To do this, I think that I would need a character array. Below is the code that I found on 'Rose India'. I have declared the character array, but I do not know ... |
|
|
Note that this is a very important skill to learn if you want to become a good programmer. Being able to read the documentation and find the solution to any problem will make your life much easier. Thanks for the counsel, but this is what I do for the past 2 days - no result. I would appreciate a little hint. ... |
I don't do GUIs, and since you didn't paste the error message, this is only a guess, but I would imagine that showInputDialog returns a String. A String is NOT a char[], nor is it a char. It's not clear what exactly you're trying to do. Either use String's charAt method to get the char you want from the String, or ... |
You probably don't need to do that. But if for some obscure reason you do -- and you probably don't -- then I wouldn't mess about with char arrays. The String class already has methods named "replace" and "replaceAll" which do that sort of thing on your behalf. Why do you think you need to do that? |
Hi everyone I am in the process of writing a program which, takes a character array and compares it to another character array. The form is XYDJFJAF I am trying to make it so that I can compare a string like this... XY*ZAB*CFORY *ZAB*JFYDFJLAF so it searches for the largest match, this is for a school project so please dont just ... |
so I want to allign them so that I get the biggest match possible and then also notice any other smaller matches like.. LDH*IGILYDE*FGR*DAZA Z*IGILYDE*LJD*DAZA**KY here I want to shift until i find that my largest possible match is from IGILY but in this match I also have a smaller match of DAZA |
|
I'm having trouble locating and counting two substrings from a character array my array contains the characters abababaa, I want to locate and count two substrings which are "aba" and "bab" I would appreciate any help, I'm not allowed to convert the character array to a string, Im using a for loop to iterate through the array but I cant figure ... |
|
|
|
|