Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  

search for a name



Share on Google+Share on Google+

Rosmi Stephen
search for a name
1 Answer(s)      6 years and 6 months ago
Posted in : Java Beginners

Search for a name

Write a program to accept an array of names and a name and check whether the

name is present in the array. Return the count of occurrence. Use the following

array as input

{?Dave?, ?Ann?, ?George?, ?Sam?, ?Ted?, ?Gag?, ?Saj?, ?Agati?, ?Mary?, ?Sam?,

?Ayan?, ?Dev?, ?Kity?, ?Meery?, ?Smith?, ?Johnson?, ?Bill?, ?Williams?, ?Jones?,

?Brown?, ?Davis?, ?Miller?, ?Wilson?, ?Moore?, ?Taylor, ?Anderson?, ?Thomas?,


View Answers

May 26, 2011 at 11:51 PM

import*; import java.util.StringTokenizer;

public class CountOccurance { public static void main(String args[])throws Exception { InputStreamReader isr=new InputStreamReader(; BufferedReader br=new BufferedReader(isr);

print("code sample");
System.out.println("ENTER ARRAY OF NAMES:"); String arrNames=br.readLine();

StringTokenizer st1=new StringTokenizer(arrNames);

System.out.println("ENTER THE NAME TO BE SEARCHED:");
String name=br.readLine();

int countNoOccurance=0;



System.out.println("THE NAME "+name+" HAS BEEN APPEARED "+countNoOccurance+" NO. OF TIMES");





Related Tutorials/Questions & Answers:
search for a name
search for a name  Search for a name Write a program to accept an array of names and a name and check whether the name is present in the array. Return the count of occurrence. Use the following array as input {?Dave?, ?Ann
How to search the table name in MS SQL Database 2005 from application
How to search the table name in MS SQL Database 2005 from application  How to search the table name in MS SQL Database 2005 from application from our helpdesk application? application might be in html
SEARCH  how can we do search in jsp...? option for search criteria like name and DOB...   Please visit the following links:
Search   Hi, I have a project in which I am trying to enter "Marathi" (Indian local language) data in JSP using JSTL and trying to search data... and tries to search then It shows no data from database
search  how to develop search box and how to retrive data from database..   Please visit the following link: Search box
Name  make a program that take a input from user in alphabet and show all the name of that character E.g User give character "B". The program shows all the human names which starts from B.   Java show all names
SEARCH PAGE  search page:option for search criteria like name and DOB will be asked.on entering the detail,data matching search criteria will be displayed..criteria can be both or any one of them.. can you send code
search program
search program  i m writing program which takes company names from databse...serch on google...n try to find the best match WEBSITE...of company name....m can i find best match..between my company name ..and all
Search index
Search index  how to write code for advanced search button
Hibernate Search
Hibernate Search  Where to learn Hibernate Search module? Thanks   Hi, Check the tutorial: Hibernate Search - Complete tutorial on Hibernate Search Thanks
linear search
linear search  write a program to find string using linear search
iPhone Baby Name App, iPhone Baby Name, Baby Names application for iPhone
. In our iPhone baby name application search is very fast and you can search... internet to search a baby name Baby names application runs...iPhone Baby Name App - World Baby Names
SEARCH AND SORT  Cam any one provide me the code in java that : Program to search for MAX,MIN and then SORT the set using any of the Divide and conquer method
sql query search function
sql query search function  i have a textbox on a form , i like a search a data in the form, when i give whatever name and id or etc..its will search and show the same form , so help me using jsp
search feature - JSP-Servlet
search feature  i need help to do a search feature servlet to search for employees from the database. the search will be done by search by employee name, department and email  Hi friend, As per your problem
personal name aliase from the web
personal name aliase from the web  enter the name to search result in internet connection
Search Engine
Search Engine  I have gone through the below mentioned link document to create search engine and fetch the data from mysql database.But i am getting errors. Error: Notice
Name unique
Name unique  I want to check whether the value which I give for the name textfield already exists in the database. In case if it exists , it should.... In other words, value for the name should be unique
Google Search
Google Search  I have a textbox and submit button in my JSP page. On giving word in the textbox and click submit it should redirct to google search page and fetch all the results based on my input word automatically. JSP/Servlet
about search engine
about search engine   Hi i am novice in jsp. i am developing web site in that i want to search product by its name and display it by its image with description,so want some help. Thank you
Array search
for the search operation. he value with one or more of the array items. Search begins
class name
class name  what is the class name of   how do i complie my jdk file, what happen s if i put in the correct commands and it still does not complie, what do i do next
personal name aliases
personal name aliases  name to enter.but search in internet connection   Please visit the following links:
personal name aliases
personal name aliases  enter the name search result in internet connection using java code   Please visit the following links:
php search variable
php search variable  Search variable in PHP
Lucene Search in JSP - JSP-Servlet
Lucene Search in JSP  Hello Sir, I want to Develop lucene - Search engine in Jsp page which can Search full text from XML file..through XML parser.. Example: in Search interface there are one textbox after putting some value
simple java search engine
simple java search engine  i have already downloaded the project simple java search engine.but i am not able to run it.can anyone help me.i have.... ABSTRACT Title : Simple Search Engine System Specification: The system on which
AJAX Search
.. <?php $db_host = 'Your database host name'; $db_username = 'Your datbase username'; $db_password = 'Your database password'; $db_name = 'Your database name'; $db = new mysqli($db_host, $db_username ,$db_password, $db
search filter and JTable
search filter and JTable  I first im not speak englis very well, so my question is: how can i make search data in JTable of java? i wan to search... java.sql.*; import java.awt.event.*; import javax.swing.*; class Search{ public
javascript code for search in html file
javascript code for search in html file  Hi, I am looking for javascript code through which we can search data with specific name find in any rows in the table. Example: Id Name P001 A P002 B P003 C P004 P002 P005
email search code in php
email search code in php  email search with multiple option in php