Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Question on topic Collection & Thread

This is a discussion on Question on topic Collection & Thread within the Java forums, part of the Software Development category; Hi all, I have following issues, for which I need solutions. PLease take kind attention to answer.. 1) To achieve a java.util.HashMap object I can use two different statements, viz, ...

Go Back   Geeks Talk > Software Development > Java
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Java Java related Issues and Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-30-2006
Junior Member
 
Join Date: Nov 2006
Location: Mumbai-India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
abdul.sayeed is on a distinguished road
Question on topic Collection & Thread

Hi all, I have following issues, for which I need solutions. PLease take kind attention to answer..

1) To achieve a java.util.HashMap object I can use two different statements,
viz,
a) Map hashMap = new HashMap();
b) HashMap hashMap = new HashMap ();

Issue: Among the two, which technique is recommended & advantageous
& why?

2) To create a thread Object one way is implementing 'Runnable' interface.
The Runnable interface contains only a single abstract method run();

Thus the normal statement to create my own class for thread is:

class MyThread implements Runnable{
// code for thead instantiation & call to start & so on..
}

My Search:
--------------

Instead of implementing Runnable I will write my Interface containing run()
abstract method.

like: interface MyRunnable{
void run();
}
class MyThread implements MyRunnable{
// code for thead instantiation & call to start & so on..
}


Issue:
-----------

When I do this I got compilation error like(in my words):
could n't find Thread(this,Sting)

Please find me the reasons.

Thanx & Regards
Reply With Quote
Sponsored Links
Reply

  Geeks Talk > Software Development > Java

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to answer this question sripri Interviews 7 09-01-2009 02:06 AM
Swing Question Informatiker Java 2 09-16-2006 03:53 PM
Question with Games StephenRaj Unix/Linux 1 08-20-2006 01:19 AM
Question with EOF RyanJames C and C++ 1 07-16-2006 12:32 PM
thread safe mnj_rt Java 1 06-17-2006 07:36 AM


All times are GMT -4. The time now is 06:35 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved