Results 1 to 2 of 2

Thread: Class doubt

  1. #1
    Wryfyng is offline Member
    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0

    Default Class doubt

    Hello, could anyone hep me with this code? I don't get why the 5th line in the second code does not work. thanks for your time
    Java Code:
    public class Grupo {
    	private int id;
    	private char dia;
    	private String hora;
    	public Grupo(){}
    	public Grupo(String[] campos){
    		this.id=Integer.parseInt(campos[0]);
    		this.dia=campos[1].charAt(0);
    		this.hora=campos[2];
    	}
    }
    Java Code:
    public class MateriaGrupo {
    	private Grupo grupo;
    	public MateriaGrupo(){}
    	public MateriaGrupo(String[] campos){
    		this.grupo=new Grupo(campos[]); //this line does not work
    	}
    }

  2. #2
    Wryfyng is offline Member
    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0

    Default Re: Class doubt

    ok, solved, i dont have to put the brackets. sorry

Similar Threads

  1. Doubt about 09
    By maya700 in forum New To Java
    Replies: 2
    Last Post: 08-17-2010, 06:37 PM
  2. Doubt
    By karthikeyan_raju in forum Advanced Java
    Replies: 11
    Last Post: 11-05-2009, 04:48 PM
  3. doubt
    By Chris555 in forum Networking
    Replies: 0
    Last Post: 08-05-2009, 02:58 PM
  4. Doubt
    By winkodes in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 12-20-2008, 08:34 PM
  5. doubt
    By shaju_inspira in forum Sun Java Wireless Toolkit
    Replies: 0
    Last Post: 01-18-2008, 08:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •