An arrayList is just a re-sizable array and you are not need to use it.
When you initialize an array and give it a number
int[] i = new int[2];
Think of it as this "Here is a container...
Type: Posts; User: Ubiquitous
An arrayList is just a re-sizable array and you are not need to use it.
When you initialize an array and give it a number
int[] i = new int[2];
Think of it as this "Here is a container...
myArray in GregBrannon's examply is not 11. When you get .length of an array you are getting the amount of elements found in the array. The elements in his array happens to be Strings not Characters....
Not to sound like a jerk but most of the answer can be found through a simple google search. You mentioned it is your first year of college so take it one step at a time. It can be very daunting and...
You must iterate through the entire array to compare the elements. When you call a "return" you are returning a value to the method which called the method. In this instance as haski has mentioned...
One thing is you initialized t as int t = ; Did you mean to initialize it at 0?
Another thing you have nested while loops which are infinite loops. while (t <= 12) how is the condition ever...
Check this portion of your code:
//loop through alphabet
for(int j=0;j<alphabet.length;j++){
if(cTEXT.equals(alphabet[j])){
if(j<1){
cTEXT =...
There is one improvement I would do on your code GregBrannon as your current code executes at O(n)
// method odds2() prints and counts the number of odd numbers from the
// given...
If this is still going how about any of these? Hopefully one of them is new to the list.
for (int i = 10; i < 20; i++){
System.out.print(i % 10 + 1 + " ");
}
...
public class SolvedPrograms{
public static void main(String[] args){
String valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,'. !";
String message = "" + valid.charAt(2) + valid.charAt(7) +...
Are they the same values? They may have been initialized with the same initial value but does it remain like so?
Do this in your compiler:
int a = 5;
System.out.println(a);
a++;...
I hope I am mistaken but it appears as if you just copied one of your peers code and commented out to change the appearance of the program. By commenting out the methods in your main class and...
Being out of class is no excuse for lack of effort. I do not mean to sound rude but what have you tried? As anyone with some experience will tell you when it comes to programming practice is what...
The problem tells you all the information you need.
What parameters to put, what return type if any is required, what type of data type you will be working with and even the formula you need.
...
What specifically are you having trouble with? Have you tried running the code to see what happens?
Difficult to interpret what he is trying to do, but what I take from it is that he wants to call simulateFlight() and then it prints out something like (100, 91, 74, etc...) with one call till it...
Sure how much are you paying for both of your assignments since this are considered jobs now. All jokes aside no one here is going to give you code. We will assist you in correcting your code and...
Have you tested your code beside compiling it? Just a few issues that you may have fixed already.
For example in this code block:
// What are the ints for? The are declared but...
Well onto a potential issue I see. Ok your nested loops do these part on paper.
// Single chip near the top
Column 0 - 6
Row 5
i = 1 && board.Array[row + i][col].getType()
// 2 Same chips...
Double posted here thread locked due to it being in a different post as well
As I had asked in that post how are you calling your method? Not only that you are now returning an empty stack and not...
@Norm I wasn't saying to convert them to do the int I was simply wondering if the value for 'A' was 65 and 'Z' was 90. I should have been a little clearer on my confusion since I don't exactly know...
I was asking about the main Method because I am don't see isHeavyBook() invoked anywhere in you Book Class I might just be missing it though. I am unsure how it is suppose to be implemented without...
How are you calling the reverse method? Also how are your pop and push methods setup? For example is there a need to create a new node get its value then push and pop or can you do it all in a single...
In both methods you are asking for an input parameter and then you create a String result. In both methods you leave result untouched and just add to the input String passed and the return that same...
I have never done that with randoms. Perhaps you are complicating it more than it should? I see a solution with an Array and a random value with max size of array.
Well the getters you have don't really prove the need for an argument to be passed down to them.
For example
Book b = new Book();
b.setTitle("Some book");
System.out.println("Title: " +...