1

Write an addressBook class that manages a collection of Person objects,An addressBook object will allow the programmer to add,delete,or search for a Person object in the addressBook.

code:

import java util.*;
class AdressBook{

private String person,inputstr;
private int age;
char gender;


Person Bob;
Bob=new Person();

for (int i=2;i<names.length-1;i++)
     names[i]=names[i+1];


for (int i=0;i<names.length;i++)
    if (names[i].equals("Bob")){
        System.out.println("Bob was not in the array");
    }
    else{
        System.out.println("Bob was  in the array");
    }

this is the code ,but it return error...any solution on it

Edited by Reverend Jim: Fixed formatting

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by kvass
0

is it a code...
Dont mind but first try to read the basics then start asking the questions.
Read about object, method and variables

0

yup ,this is the code ,i have read out the things you said .anything wrong with my code ,can help me correct it ...?

-1

put the code in code tags and describe what the error is -- that will help ppl know what they are looking for.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.