2,777 Posted Topics

Member Avatar for trishtren

Are you trying to convert the String: "010100000000000100010011000000000001000100110" into bytes with those 0s & 1s as bits? If the String's length is not a multiple of 8, how should it be padded to fill an even number of bytes? Can you post what you want the byte values (in hex) …

Member Avatar for NormR1
0
1K
Member Avatar for cvanithakpm

> how is it that main can access instance members? Do you have an example where that is done? Please post it.

Member Avatar for richieking
0
130
Member Avatar for raviaaaa

What are the keys you want to use to access the data? Why do you want to use a Map to store the data?

Member Avatar for JamesCherrill
0
409
Member Avatar for malsmit2014

> why it is throwing an error that says "java.io.FileNotFoundException: furnitureData.txt To see where the program is looking for the file, create a File class object with the filename and print out the absolute path for that File object. > why my toString method return is not working Please explain …

Member Avatar for DavidKroukamp
0
307
Member Avatar for hyung101

Go ahead and describe how your program should work and ask any questions you have about how to write the program.

Member Avatar for poojavb
0
3K
Member Avatar for GlenRogers

> I need to override toString() but i can't seem to get it working! Post the code you are having problems with.

Member Avatar for GlenRogers
0
339
Member Avatar for coroll

Are you using the correct protocol with the server? Did you send it the right messages? Are you sure it will send you more lines to read when you expect them to be sent or do you have to send more before the server will respond?

Member Avatar for NormR1
0
127
Member Avatar for pitic

Can you make a small program that compile, executes and shows the problem? Is the serial port required for testing, or can the testing be done without it? Does the dataAvailable() method write a good file?

Member Avatar for pitic
0
267
Member Avatar for enakta13
Member Avatar for alemojarro

Please post your questions and the code you are having problems with.

Member Avatar for NormR1
0
108
Member Avatar for intelnf09

> operator > cannot be applied to double[],int You can not compare an array to an int value. Did you mean to have an index (in []s) with the array name to select an element from the array? The same problem with the other error. You can not use ++ …

Member Avatar for NormR1
0
1K
Member Avatar for Valiantangel

Change the code as you want to do and try to compile it. If there are errors, copy and paste them here.

Member Avatar for JamesCherrill
0
212
Member Avatar for chudapati09

> but it didn't work. Was the "this" class defined to be a TreeSelectionListener? That is the data type required by the addTreeSelectionListener() method for its argument. One way give a class a type is by having it implement an interface.

Member Avatar for JamesCherrill
0
180
Member Avatar for SuchANewb

Please post the code here and its output and add comments to the output explaining what it wrong with it and what it should look like.

Member Avatar for NormR1
0
428
Member Avatar for yavindu
Member Avatar for el33t
Member Avatar for vilas_tadoori

Your code would be more readable if you used char values: 'A' etc instead of the numbers: 65, 70, 72 etc

Member Avatar for NormR1
0
998
Member Avatar for Jdan2388

The code compares two variables that haven't been changed. Where is the data that user selected?

Member Avatar for stultuske
0
233
Member Avatar for pritish.kamath

Can you explain what the problem is? If you are getting errors, please post the full text of the error message.

Member Avatar for stultuske
0
120
Member Avatar for RyMarr475

Java has several classes and methods for reading and writing files. The simplest for reading is the Scanner class. For writing text files, there are several choices like PrintWriter or BufferedWriter.

Member Avatar for NormR1
0
107
Member Avatar for RyMarr475

> there is a nullpointexception error Please copy and paste here the full text of the error message. It has the source line number where the exception occurred. To copy the contents of the command prompt window: Click on Icon in upper left corner Select Edit Select 'Select All' - …

Member Avatar for NormR1
0
1K
Member Avatar for GeekTool

Add some printlns to print out the values of the variables to show you what the code is doing, Another technique is to use a piece of paper and play computer. Write down the values of the variables as they are used and changed.

Member Avatar for GeekTool
0
2K
Member Avatar for anisha.silva

Can you post code that compiles and executes and shows the problem. Also please post the full text of the error message.

Member Avatar for anisha.silva
0
250
Member Avatar for gomonkeyninja

>Load that text file in a way that the lines are assigned to their correct variables again Can you write a smaller, simpler program that only tries to read the file and put its lines into the variables where you want them to be? It'll be easier to work with. …

Member Avatar for gomonkeyninja
0
351
Member Avatar for GeekTool

Why do you think there is something wrong with the code you posted? If you are getting errors please post them. If the code doesn't do what you want it to, please explain.

Member Avatar for GeekTool
0
209
Member Avatar for GeekTool

Try listing the steps in the order the program needs to do them to solve your problem. When you get the logic worked out, then try writing the code.

Member Avatar for NormR1
0
159
Member Avatar for Kert

Does class A have a b variable? a3 is defined as an instance of an A object.

Member Avatar for delta_frost
0
118
Member Avatar for jonny93

To see what your code is doing, add a println just before the } at the end of the loop (after line 17) that prints out the value of number. Does the value of total that is printed look correct when you enter several numbers?

Member Avatar for delta_frost
0
265
Member Avatar for kyriacos1986
Member Avatar for MadJako

Did that code compile? Try compiling code to see if the compiler will say its Ok. If you get errors, copy and paste the full text of the error messages here.

Member Avatar for MadJako
0
616
Member Avatar for Valiantangel

Please post the full text of the compiler's error messages. > put class instead of the varible since its static but how? Your title shows how: IntegerSet.a The usages: setA.a, setB.a and u.a will all refer to the SAME variable a since it is static.

Member Avatar for JamesCherrill
0
370
Member Avatar for Jdan2388

Try debugging your code by adding some printlns to show the values of variables and the execution flow. You need to format the code better so that }s are beneath its paired } Your formatting makes it very hard to read and understand the logic of the code. Try debugging …

Member Avatar for Jaggs
0
882
Member Avatar for GeekTool

> compiler gives me an error Please post the full text of the error message.

Member Avatar for ~s.o.s~
0
3K
Member Avatar for SuperManofBC

> when I compile it says I have incompatible types Please post the full text of the compiler's error messages. They have useful info in them

Member Avatar for stultuske
0
648
Member Avatar for godzab

What symbol was not found? Where was the ^ posititioned? What does the API doc say for the keyPress() method? What type of argument does it take? Did you give it the correct argument?

Member Avatar for godzab
0
977
Member Avatar for nHulk

The readLine() method waits to read an end line character (\n). Did the server send one?

Member Avatar for NormR1
0
295
Member Avatar for Jdan2388

One problem I see with the code is that it is using == to compare Strings. You should use the equals() method to compare Strings. Another problem is the indentation spacing makes the code unreadable here in the forum.

Member Avatar for NormR1
0
193
Member Avatar for rtellez700

> to include all my classes files Use a * wildcard to include all your class files: *.class That would not cause a problem with the manifest file. Make sure the last line in the manifest file ends with a newline character.

Member Avatar for NormR1
0
1K
Member Avatar for speakon

> my errors lie within the for statement: Please explain what the errors are. Post the full text of any error messages.

Member Avatar for speakon
0
389
Member Avatar for newprogrammer12

The Scanner class has several methods that can be used to test what the user has entered. Their names begin with has..... You could use some of them to test for valid input and issue an error message and ask for new input of the correct type after clearing the …

Member Avatar for jackbauer24
0
220
Member Avatar for wab9jon

Can the returned value change for each time the method is called? If not, call it once and save what is returned in a boolean variable that can be used in the if statement. Since a boolean can only have two values, only one test needs be made. If the …

Member Avatar for wab9jon
0
213
Member Avatar for Maymac
Member Avatar for JamesCherrill
0
116
Member Avatar for Rvjain99
Member Avatar for JamesCherrill
0
221
Member Avatar for sammoto

To see if the code has a loop, add some printlns inside of the loop that print out the values of the variables that are begin used in the loop. Be sure to use an id string with the print outs so you know what is being printed: println("var=" + …

Member Avatar for sammoto
0
241
Member Avatar for Cross213

> it gives an error, Please post the full text of the error message. > if it is not full. Where are the empty spots in the array? If at the end, change the for statement to not go past where there is good data.

Member Avatar for Cross213
0
305
Member Avatar for gedas

Are you asking how to bundle OS specific programs as part of a java program? Everything would be in one huge jar file. I'm not sure how that could work. If the program requires installation on a computer how would that be done? Would the java program copy the installation …

Member Avatar for NormR1
0
96
Member Avatar for new_2_java
Member Avatar for GeekTool

To call a non-static method in a class you need a reference to an instance of the class: refToClassInstance.theMethodToCall(<parms>); Where are you calling the method from? non-static method of same class non-static method of another class static method any class

Member Avatar for NormR1
0
132
Member Avatar for Upoma
Member Avatar for sammoto

You need to specify the type for each parameter in the method definition. You've only give a type (double) for the first one. Add type definitions for the other two parameters.

Member Avatar for sammoto
0
102

The End.