# Search:

1. ## Thread: Counting duplicates in a Stack

Replies
4
Views
405

### Counting duplicates in a Stack

Hey guys , I am having a problem with my code , consider this problem:

Write a method compressDuplicates that accepts a stack of integers as a parameter and that replaces each sequence of...
2. ## Thread: HashMap , trying to get the size of the value and NOT the keys.

Replies
10
Views
394

### Re: HashMap , trying to get the size of the value and NOT the keys.

Thank you , thank you , thank you.
You sir have made my day ! :D
3. ## Thread: HashMap , trying to get the size of the value and NOT the keys.

Replies
10
Views
394

### Re: HashMap , trying to get the size of the value and NOT the keys.

The length of the keys in the picture that i attached is 6 , but the length or ( count ) of the values is 4 .
If you use map.size(); a value of 6 will be returned .
What can i code or what can i...
4. ## Thread: HashMap , trying to get the size of the value and NOT the keys.

Replies
10
Views
394

### Re: HashMap , trying to get the size of the value and NOT the keys.

It is very simple , map.size() will give us the length of key from the HashMap , i just want the length of the values not the keys.

Here i sketched this :2831
5. ## Thread: HashMap , trying to get the size of the value and NOT the keys.

Replies
10
Views
394

### Re: HashMap , trying to get the size of the value and NOT the keys.

What I meant is that in my assignment the first question asked is " what is the number of the tags of the novel ?" and by tags i mean " Location " or "Person"...
The keys...
6. ## Thread: How do I run the if statement?

Replies
4
Views
315

### Re: How do I run the if statement?

You are trying to compare a string with the compare method of two integers , if you had like:
int A =1 ;
int B=2;
here you can use if(A==B)
return true;
However when...
7. ## Thread: HashMap , trying to get the size of the value and NOT the keys.

Replies
10
Views
394

### HashMap , trying to get the size of the value and NOT the keys.

Hello guys , I am asked in my assignment to make a program that accepts a text file as an example a novel and i have to sort each word as a PERSON or ORGANIZATION or LOCATION or O as in Other ,...
8. ## Thread: Problem with arrays2

Replies
11
Views
457

### Re: Problem with arrays2

you just switch the "returns" anyhow here's the code :

public class test2 {
public static void main(String[] args) {
double[] crazy = { 1.0, 2.0, 2.5 };...
9. ## Thread: Problem with arrays2

Replies
11
Views
457

### Re: Problem with arrays2

I get it , thank you guys for your help :)
10. ## Thread: Problem with arrays2

Replies
11
Views
457

### Re: Problem with arrays2

Ok i got it all right now but i do have another question , take a look :

public class test2 {
public static void main(String[] args) {
double[] crazy = { 1.0, 2.0, 2.5 };...
11. ## Thread: Problem with arrays2

Replies
11
Views
457

### Re: Problem with arrays2

Thank you for your help guys but i'm sorry i still am a beginner to java can you explain more to me? And help me to solve my problem ? Thank you.
12. ## Thread: Problem with arrays2

Replies
11
Views
457

### Problem with arrays2

I am making a program that if the user enter a sequence of double in an array if it is sorted right the prog will return true if not it will return false .. what is wrong here ? always i get true.
...
13. ## Thread: Searching for words in a file

Replies
3
Views
530

### Re: Searching for words in a file

" one of the String class's "
could you give me an example ? and are you sure it's the best way that is to divide the lines in lines ? Consider the file is too large isn't it wrong to consider...
14. ## Thread: Searching for words in a file

Replies
3
Views
530

### Searching for words in a file

Good morning , i am writing a program that will wait for the user to enter a molecule , lets say he enters " h20" the program will go to a file search for the word and puts the weight name .. into an...
15. ## Thread: Arrays , command line arguments

Replies
2
Views
373

### Arrays , command line arguments

Good evening everyone,
i want to make a program that read a list of integers as an array then prints the reverse of it however these integers should be passed as command line arguments but my...
16. ## Thread: Problem with arrays

Replies
4
Views
314

### Re: Problem with arrays

The problem is that i get no output , i know how to use arrays.ToString but the problem is i get no output.
17. ## Thread: Problem with arrays

Replies
4
Views
314

### Problem with arrays

Good evening everyone , I am curently having problem since i want to make a basic program which basically reverse all the numbers of a certain array into the same array , by that i mean i want to...

Replies
6
Views
349

### Re: Why isn't this grade averaging working?

It's because you are not saving the variables that the user is typing try as an example
int input=console.nextInt;

--- Update ---

Oh sorry since the user will put many integer example :25 65...
19. ## Thread: One fast question

Replies
5
Views
279

### Re: One fast question

Yes i am aware of these facts that integer divided by an integer will result an integer but if a double divided by an integer will result a double , however i treid setting all of my int to double...
20. ## Thread: Problem with arrays

Replies
6
Views
446

### Re: Problem with arrays

Thank you Christopher , but the thing is I would like to create an array but randomly and by that i mean it can be 4 arrays 5 or 6 up to 10 ; that's what i want .
To make it clear my whole program...
21. ## Thread: One fast question

Replies
5
Views
279

### Re: One fast question

Yes I do like a longer answer , and sorry for posting my thread titled " Easy " will be making sure next time to write my title better.
22. ## Thread: One fast question

Replies
5
Views
279

### One fast question

Would you please tell me why my output is always 0.0 ? i want my program to print the sum of the values that are less than the average of all of the values generated .

import java.util.*;
...
23. ## Thread: Problem with arrays

Replies
6
Views
446

### Re: Problem with arrays

Oh god , what a foolish mistake , thank you !