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

Recommended Answers

All 3 Replies

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

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.