473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Java Threads

thatos
105 100+
if I have the following class
Expand|Select|Wrap|Line Numbers
  1. public class p1 extends Threads{
  2.  public static main void(){
  3.   run();
  4.   run();
  5.  }
  6.  static void run(){
  7.   //Code here
  8.  }
  9.  
  10. }
  11.  
When I run the above class, will it be threaded or not, or do I have to create another class to handle threads?
Apr 4 '11 #1

✓ answered by Dheeraj Joshi

You need to create thread like

Expand|Select|Wrap|Line Numbers
  1. Thread t_obj = new Thread();
Regards
Dheeraj Joshi

1 1349
Dheeraj Joshi
1,123 Expert 1GB
You need to create thread like

Expand|Select|Wrap|Line Numbers
  1. Thread t_obj = new Thread();
Regards
Dheeraj Joshi
Apr 5 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Robert Brown | last post by:
My Java application (a standalone server) consumes 80% CPU right upon startup for no apparent reason. If I do a kill -QUIT on the process all the Java threads are idle. The app uses native JNI...
5
by: Rob | last post by:
Hi there, Firstly, apologies for x-post but I'm hoping the post is relevant to both groups... I have written a native implementation in C, and a java wrapper class. This all works fine and...
73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
9
by: Klaus Neuner | last post by:
Hello, I wrote a program that does essentially the following: for rule in rules: for line in line_list: line = my_apply(rule, line) line_list contains the lines of some input text.
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
5
by: Alex | last post by:
Hi all, I'm sure this is really really easy but I do need some help. I'm writing a java stored prcedure to manage the assignment of IP addresses to mac addresses for a network device database...
7
by: Sourav | last post by:
Hi, I am new to linux and was writing a program that uses linux POSIX Threads. I had to show some activity on the screen while some files will be copied in the background. I thought of implementing...
1
by: brianwyld | last post by:
Maybe someone has some experience with "realtime" operation of JNI threads? I have a java app, which calls some C++ code for real time actions. This C++ code creates an independant pthread to do...
3
by: Michael Suess | last post by:
Hi, please feel free to correct me if this is the wrong group to ask this question. I have a blog about parallel programming and concurrency (http://www.thinkingparallel.com if you are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.