The Artima Developer Community
Sponsored Link

Java Answers Forum
Answer this question if you can

1 reply on 1 page. Most recent reply: Jul 17, 2005 11:48 PM by Kondwani Mkandawire

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
ogeela

Posts: 5
Nickname: oggy
Registered: Jul, 2005

Answer this question if you can Posted: Jul 17, 2005 11:07 PM
Reply to this message Reply
Advertisement
Question:

Consider the code:

public class Meth1{

public static Boolean words(String[]p,String[]q)

{
boolean flag =true;

if (p.length=q.length)
flag=false;

else

for (int i=0;i<p.length;i++)

{
if (look(p,q))flag=false;
break;
}
return flag;

}//words


public static boolean look(String []p,String w)
{
boolen flag = true;
for (int i=0; i<p.length;i++)

if (p.equals(w))flag = false;

return falg;

}

}//Meth1




a) Work out and documentthe processes being carried out by the method "words" in the above class.
Your documentation should include any data used for the purpose.

b) a client has an array of English words. What is required to list all those words from the array,
which come alphabetically after the word "master", and they are to appear in alphabetical order.
For example: given an array of words as shown below:

cast static thread make void import

should produce an array of words:

static thread void

Use inheritance to extend the class "Meth1" to produce the necessary method


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Answer this question if you can Posted: Jul 17, 2005 11:48 PM
Reply to this message Reply
Please enclose you your code in the pre tag
and indent.

Lack of indentition and neat format for most
of us, discourages us to even begin to look
at your code.

Maybe you should repost with your code
embraced by the appropriate tags.

Flat View: This topic has 1 reply on 1 page
Topic: maintenance of a web site Previous Topic   Next Topic Topic: Formatter and Appendable ?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use