# Search:

Type: Posts; User: andreaita44

Page 1 of 2 1

1. ## Thread: Can someone explain why my loop does not run again even when "y" is entered.

by andreaita44
Replies
1
Views
171

### Re: Can someone explain why my loop does not run again even when "y" is entered.

public static void main (String[]args) {
String a = "y";
while (a.equalsIgnoreCase("y")) {
Scanner stdin = new Scanner(System.in);
System.out.print("Enter...

by andreaita44
Replies
2
Views
221

nothing
3. ## Thread: what whould be the output

by andreaita44
Replies
1
Views
148

nothing
4. ## Thread: Generating random 3 digit kength number with specific numbers. Need help!

by andreaita44
Replies
1
Views
171

### Re: Generating random 3 digit kength number with specific numbers. Need help!

public static String RandomString(int[] digits, int length) {
Random r = new Random();
String str = "";
for(int i = 0; i < length; i++) {
int n = (int)...
5. ## Thread: How do I calculate power using for loop?

by andreaita44
Replies
1
Views
287

### Re: How do I calculate power using for loop?

int ans2 = n2^x2;
if you want to use for loop:

public static double power(int base, int exponent) {
double b = base;
if(exponent <= 1) {
for(int e = exponent;...
6. ## Thread: Nested For Loop Problem

by andreaita44
Replies
2
Views
354

### Re: Nested For Loop Problem

package me.andreaita44;

import java.util.Scanner;

/**
*
* @author andrea.campostrini
*/
public class Test {
7. ## Thread: Finding a String value in the ArrayList

by andreaita44
Replies
1
Views
219

### Re: Finding a String value in the ArrayList

public int searchRow1(Person name) {
if(row1.size() > 0) {
for (int i = 0; i < row1.size(); i++) {
if (row1.get(i).getName().equals(name.getName())) {
...
8. ## Thread: toString on ArrayList is not working :(

by andreaita44
Replies
1
Views
254

### Re: toString on ArrayList is not working :(

package tournament;

import java.util.ArrayList;

public class Team {

private String name;
private ArrayList<Player> players;

public Team(String name) {
9. ## Thread: How do I add an index in the middle of an ArrayList?

by andreaita44
Replies
2
Views
237

10. ## Thread: Help the code seems fine and all but it doesn't identify the names even it's right

by andreaita44
Replies
1
Views
229

### Re: Help the code seems fine and all but it doesn't identify the names even it's right

import java.util.Scanner;

public class Employee {

public static void main(String[] args) {

/*-----------------------------------------------------------*/
...

by andreaita44
Replies
1
Views
225

source?
12. ## Thread: help with codoe

by andreaita44
Replies
2
Views
307

### Re: help with codoe

try {
/*--------------------------------------------------------------*/
Scanner input = new Scanner(System.in);
Scanner reader = new Scanner(new File("path"));...
13. ## Thread: What am I missing here?

by andreaita44
Replies
2
Views
270

### [SOLVED] Re: What am I missing here?

you need to increment variable MaxInRow1

int MaxInRow1 = 0;
if (name.hasVIPpass() == true) {

if (MaxInRow1 < 10)
{
...
14. ## Thread: I have to send this tomorrow again and i don't have any idea what's wrong

by andreaita44
Replies
5
Views
296

### Re: I have to send this tomorrow again and i don't have any idea what's wrong

final int a=5;
final int b=3;

int[][] Table= new int[a][b];

Table[0][0]=182;
Table[0][1]=41;
Table[0][2]=202;

Table[1][0]=145;
15. ## Thread: I have to send this tomorrow again and i don't have any idea what's wrong

by andreaita44
Replies
5
Views
296

### Re: I have to send this tomorrow again and i don't have any idea what's wrong

from both for you have to remove it
16. ## Thread: I have to send this tomorrow again and i don't have any idea what's wrong

by andreaita44
Replies
5
Views
296

### Re: I have to send this tomorrow again and i don't have any idea what's wrong

remove = in the for
17. ## Thread: How to make a team with min. 2 max 5 players with Objects and Arraylist?

by andreaita44
Replies
8
Views
364

### [SOLVED] Re: How to make a team with min. 2 max 5 players with Objects and Arraylist?

can you send me the complete tournament class?
18. ## Thread: Are arraylists redundant?

by andreaita44
Replies
1
Views
247

### Re: Are arraylists redundant?

Arrays are static elements which means that once defined the space cannot be changed. Instead the arraylists are dynamic that is the space can vary. For example if you have an arraylist in which you...
19. ## Thread: Why System.in returns -1 when I pressed "Enter key" how can I mimic "Enter key" in console?

by andreaita44
Replies
5
Views
389

### Re: Why System.in returns -1 when I pressed "Enter key" how can I mimic "Enter key" in console?

InputStream in = System.in;
System.out.println(".");
20. ## Thread: How to make a team with min. 2 max 5 players with Objects and Arraylist?

by andreaita44
Replies
8
Views
364

### [SOLVED] Re: How to make a team with min. 2 max 5 players with Objects and Arraylist?

public static void main (String []args){
ArrayList<Team> teams = new ArrayList<>();
Player[] PlayersA = new Player[3];
PlayersA[0] = new Player("Kim");
PlayersA[1]...

by andreaita44
Replies
1
Views
237

### Re: Project about Chat application with multi hop forwarding

can i see you source code?
22. ## Thread: How to make a team with min. 2 max 5 players with Objects and Arraylist?

by andreaita44
Replies
8
Views
364

### [SOLVED] Re: How to make a team with min. 2 max 5 players with Objects and Arraylist?

create a method that returns a String-> foreach element in the array add to a temp variable the name of the player -> return the temp variable
23. ## Thread: How to make a team with min. 2 max 5 players with Objects and Arraylist?

by andreaita44
Replies
8
Views
364

### [SOLVED] Re: How to make a team with min. 2 max 5 players with Objects and Arraylist?

instead of the arraylist I would use an array of maximum size 5, then I would create a variable that indicates how many players there are in the array. Then I would create add and remove methods.
24. ## Thread: Hi guys my code here is showing errors specifically cannot find symbol even though i have declared this

by andreaita44
Replies
1
Views
295

### Re: Hi guys my code here is showing errors specifically cannot find symbol even though i have declared this

you need to define class Item