sandeep jakkaraju

Greenhorn
+ Follow
since Sep 05, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sandeep jakkaraju

I dont know the answer to this ...
but i can say that ..the concept of first element of an array being 0 (ZERO) is INDIAN !! for the obvious reasons ;-)

Originally posted by Deepika Wadhwa:
Hi all,
i have a basic confusion..
why does array index start from zero ?
is there any specific reasond this ?

thanx in advance
Deepika


23 years ago
You have to use ... Sorting algos ... like insert sort, merge ..etc
I am giving you the code for Insert Sort Ok !!
int temp ;
for( int j = 1; j<aa.length ; j++)>
{
for( int i = 0; i<j ; i++)>
{
temp = aa[i];
aa[i] = aa[j];
aa[j] = temp;
}
}

Originally posted by Khurram Akhter:
I made an array
int []aa = { 1,5,2,6,7,9,8}
I want to sort this array with the help of for loop, so what
should i do now....


23 years ago

One solution to ur prob :-
Store the Strings in an array ... ok ...
since there are 6 strings ... generator a random integer between 0 and 5 (inclusive) ... and get the Random String using the number as the index to the array !! ...
String array[] = {oranges, apples.....};
String randomString = array[java.math.random() * 5 ];


Originally posted by kumar abhay:
hi sir,
hope u r doin' fine .i m having some problems in the String data type of JAVA so plz help me out.The problem is given below:
Write a program to display a random choice from a set of six choice of (i.e breakfastApple,Orange,Grappes,Pineapple,Strawbery&Bannana)
i hope sir taht u will get me this answer asap.
i really appriaciate your concern
with regards
Kumar Abhay


23 years ago

convert the floats to ints .. and then draw !
23 years ago

public boolean addAll(Collection c)

Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator. The behavior of this operation is undefined if the specified Collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified Collection is this list, and this list is nonempty.)
23 years ago
can u state ur problem ..more clearly ?
23 years ago

You must have used System.out for printing the integer you read from the DataInputStream ...!!
DataInputStream is always used with DataOutputStream !
23 years ago

U can use a HashMap ... in which
u have 1,2....12 as keys and
Strings "Jan" , " Feb" ...... "Dec"
as the values ...
and u can get the month as using
HashMap.getvalue(Date.getmonth)

Originally posted by Chris Ben:
Hi,
I am trying to convert a date string 12/01/01 to an instance and then retrieve the Month as the form of a word, as Dec. But I found the month fields in Date and Calendar classes are all interger. Is there a build-in function in java for me to do that?
Thank you.
Chris


23 years ago