Search:

Type: Posts; User: andreaita44

Page 1 of 2 1 2

Search: Search took 0.35 seconds.

  1. 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...
  2. Thread: output?

    by andreaita44
    Replies
    2
    Views
    221

    Re: output?

    nothing
  3. Replies
    1
    Views
    148

    Re: what whould be the output

    nothing
  4. 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. 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. Replies
    2
    Views
    354

    Re: Nested For Loop Problem

    package me.andreaita44;

    import java.util.Scanner;

    /**
    *
    * @author andrea.campostrini
    */
    public class Test {
  7. 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. 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. [SOLVED] Re: How do I add an index in the middle of an ArrayList?

    row1.add((int)Math.ceil(row1.size()/2.0), (name));
  10. 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) {

    /*-----------------------------------------------------------*/
    ...
  11. Replies
    1
    Views
    225

    Re: please help

    source?
  12. Replies
    2
    Views
    307

    Re: help with codoe

    try {
    /*--------------------------------------------------------------*/
    Scanner input = new Scanner(System.in);
    Scanner reader = new Scanner(new File("path"));...
  13. 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)
    {
    row1.add(name);
    ...
  14. 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. 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. Re: I have to send this tomorrow again and i don't have any idea what's wrong

    remove = in the for
  17. [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?
    what does readUserInput do?
  18. 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. Re: Why System.in returns -1 when I pressed "Enter key" how can I mimic "Enter key" in console?

    InputStream in = System.in;
    int read = in.read();
    System.out.println(".");
    System.out.println((char)read);
  20. [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]...
  21. Re: Project about Chat application with multi hop forwarding

    can i see you source code?
  22. [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. [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. 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
  25. Replies
    4
    Views
    331

    Re: answer my code!!!

    i % 11 is wrong. It's i % 2
Results 1 to 25 of 35
Page 1 of 2 1 2