• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting an error : cannot find symbol  RSS feed

 
Shubham Mathur
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
program is to display name address and position of an applicant.......use of array is must

here is the following code :

class Applicants
{
String position[] = new String[3] ;
String name[] = new String[3];
String address[] = new String[3];

public Applicants()
{
String position[] = {"President", "Vice-President", "Co-Ordinator"};

String name[] = {"Shubham Mathur", "Ankit Jaggi", "Akshay Mittal"};

String address[] = {"Kakadeo Kanpur", "Civil Lines Allahbad", "Moti Nagar Bareily"};

}

public void display()
{
System.out.println("Ist position = " +position[].class);
System.out.println("Name = " +name[].class);
System.out.println("Address = " +address[].class);

System.out.println("IInd position = " +position[].class);
System.out.println("Name = " +name[].class);
System.out.println("Address = " +address[].class);

System.out.println("IIIrd position = " +position[].class);
System.out.println("Name = " +name[].class);
System.out.println("Address = " +address[].class);
}

public static void main(String args[])
{
Applicants app = new Applicants();
app.display();
}
}

please rply as soon as possible
 
T Walsh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even though i am still learning i will give this a go

You have declared an array of a fixed size and now you need to add elements to it, for example;

position[0] = ("President");
name[0] = ("Shubham Mathur");
address[0] = ("Kakadeo Kanpur");

And then print it by doing,

System.out.println("Ist position = " +position[0]);
System.out.println("Name = " +name[0]);
System.out.println("Address = " +address[0]);

Not sure if this is what you are looking for but i said i would at least attempt it
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure it told you a little more than just "symbol not found". It probably told you exactly which symbol that was. It would be much easier for folks here to help you if you told them what that was.

So, please include the full text of the error message you are getting, and you are much more likely to get help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!