English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Im new in programming can anybody define theses terms with some examples.
Whats a loop? Whats a String?How does an array work? These are the 3 main thing Iwant to know but an other basics u think i should know plz write it too

2007-05-24 00:39:55 · 6 answers · asked by MiCk 2 in Computers & Internet Programming & Design

6 answers

Probably you gotta find a book with 1000 pages just to get "the Basics" =)

String[] arrayOfStrings = {"String1", "String2", "String3"};//Array of Strings
for(int i = 0;i {
System.out.println(arrayOfStrings[i]);
}

I am not sure if it will compile (I used Java some time ago), but I hope you'll get the idea.
this snippet of code prints out strings (String1, String2 etc), which are members of array arrayOfStrings, by iterating through array in loop.
Go to java.sun.com for more

2007-05-24 01:08:10 · answer #1 · answered by Donald D 2 · 0 0

Loops- allow you to execute a sequence of statements repeatedly, using a control condition or variable to determine when the execution stops.

String-A series of characters manipulated as a group. A character string differs from a name in that it does not represent anything -- a name stands for some other object.
A character string is often specified by enclosing the characters in single or double quotes. For example, WASHINGTON would be a name, but 'WASHINGTON' and "WASHINGTON" would be character strings.

The length of a character string is usually the number of characters in it. For example, the character string "WASHINGTON" has a length of 10 (the quote marks are not included). Some programs, however, mark the beginning or end of a character string with an invisible character, so the length might actually be one greater than the number of characters.

Array-In programming, a series of objects all of which are the same size and type. Each object in an array is called an array element. For example, you could have an array of integers or an array of characters or an array of anything that has a defined data type. The important characteristics of an array are:
Each element has the same data type (although they may have different values).
The entire array is stored contiguously in memory (that is, there are no gaps between elements).
Arrays can have more than one dimension. A one-dimensional array is called a vector ; a two-dimensional array is called a matrix.

2007-05-24 08:14:13 · answer #2 · answered by san 2 · 0 0

Loop - There are several different kinds, but the basic premise is that you run a block of code a given number of times. This number of times can be set (a for loop) or based on some condition (while loop).
String - Just that. An object that holds a string or a group of characters...a bit like this answer. For example String answer = "This is the answer";
Array - This is just a collection of Objects. 0 based. That means the first element in the array is at index 0. You use an array to keep a "collection" of data. For example, you could keep a list of grades in an array.
a[0] = 92;
a[1] = 88;
a[2] = 79;

2007-05-24 07:47:13 · answer #3 · answered by SPB 6 · 0 0

u asked some basic programming question. any programming language u work on u need this concepts, not only for java. So get some books about basic programming or search google

2007-05-24 08:47:09 · answer #4 · answered by ehossain 2 · 0 0

Check out the book store where u can get all the java related books

http://www.ebindiaonline.007ihost.com/shopping/JavaStore.php

2007-05-24 08:41:59 · answer #5 · answered by Anonymous · 0 0

Start here with Getting started and keep going.

2007-05-24 07:50:11 · answer #6 · answered by AnalProgrammer 7 · 0 0

fedest.com, questions and answers