answersLogoWhite

0

Where, exactly, do you want to search? If it is in an array, you can loop through the array; for example like this:

boolean found = false;

for (int i = 0; i <= myArray.size && !found; i++)

{

if (myArray[i] = theNumber)

{

found = true

}

}

I didn't test this, and it may have syntax errors, but it should give you the general idea.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What are the names of different part of simple java program?

NO!


Simple java program to find even numbers?

Here is a simple program that will list all the even numbers between 1 and 50: public class EvenNumbers { public static void main(String[] args) { for(int i=1; i&lt;=50; i++) { if(i%2 ==0) { System.out.println(i); } } } }


Write a java program for sum of n numbers?

This is a very simple problem, alnost certainly a homework problem, and you should make an effort to answer it yourself.


What Program that will display the even numbers in data structures and algorithms?

JAVA


How do you compile and execute a java program which finds out the highest of any five numbers?

it will be destroyed.


What do you mean by multithread program in java?

A Program in Java that spawns multiple threads is called a multithreaded program in Java.


What is a Java Drive-By?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is JAVA drive by?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is a Java Drive By?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What does it mean to generate random numbers in Java?

Generating random numbers in Java is somewhat of a misnomer because the numbers are actually semi-random.It means to use the program to obtain random integers to use in hypothetical situations such as statistics.


Java program to find sum on even numbers from 12-45?

sum = 0; for (int i = 12; i


A simple java program for line break or line wrap?

I believe its just \n where you want to break the line