I've been reading from Lesson: Basic I/O (The Java™ Tutorials > Essential Classes) but I don't understand the jargon very well without examples.
What I'm trying to figure out how to do is read a...
Type: Posts; User: ryu2le
I've been reading from Lesson: Basic I/O (The Java™ Tutorials > Essential Classes) but I don't understand the jargon very well without examples.
What I'm trying to figure out how to do is read a...
I finished the code thanks for all your help everyone.
I got the string to work. I'm having an issue with the register now. Every time I create a new register, it saves over all the variables for the previous register. Is that a problem with the...
Is there a way to form a string from an array? I want to concatenate all the values in order from Bit[i] to Bit[bit.length]
for this Code
public Register(int numberOfBits, int valueStored)
{
Bit[] registerBit = new Bit[numberOfBits];
for (i = 0; i < numberOfBits; i++)
{
registerBit[i] = new Bit();...
I tried filling the array with this code:
public Register(int numberOfBits)
{
Bit[] registerBit = new Bit[numberOfBits];
for (i = 0; i < numberOfBits; i++)
{
registerBit[i].reset();...
for
public Register(int numberOfBits)
{
Bit[] bit = new Bit[numberOfBits];
}
I'm supposed to set the array to all values of 0. I thought I did this when I did:
public Bit()
{
I found it. There was an extra } before this statement.
Okay I think I fixed most of those errors. Now I have to create a Register method. What the professor wants is this:
This method is the Register constructor. Its purpose is to construct a...
the reset method is supposed to change the contents of the Bit object. It is supposed to change the value of the content to 0. That's why I originally though to use int object.
My reset method is currently void. Should I change it to Bit?
If I have a code like this
public int reset()
{
return bit = 0;
}
then the method will return an integer. If I want it...
okay that makes sense. So now I have this
public static void LSR(Bit[] bit)
{
for (i = 0; i < bit.length; i++)
{
bit[i + 1] = bit[i];
bit[0] = bit[0].reset();
}
}
I hate asking stupid questions but I just don't seem to understand.
bit[0] refers to the bit[] array but isn't the bit[] array an array of the Bit object? Doesn't that mean that the bit[0] is...
I had the line
private static Bit[] bit = new Bit[size];
to create a Bit[] with the variable name bit with an array of Bit objects. I want to set the first bit ( bit[0] ) equal to zero, which is...
I defined the reset() method in the class Bit() to set the value of the bit to 0.
----jGRASP exec: javac -g Register.java
Register.java:11: cannot find symbol
symbol : method reset()
location: class Bit[]
bit[0] = bit.reset();
^
Register.java:21:...
sean4u:
I don't really understand what the boolean data type means. Does my professor want the output to be true/false or just 0/1?
norm:
The register class isn't compiling at all. I'm...
I'm having some problems with my bit class and register class for a homework assignment. Here's the first part of the question and my code for it. The code compiles but it doesn't work with the...