MESSAGE
DATE | 2015-03-25 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] Java Crimes
|
From owner-hangout-outgoing-at-mrbrklyn.com Wed Mar 25 01:29:38 2015 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix) id 3BD56161339; Wed, 25 Mar 2015 01:29:38 -0400 (EDT) Delivered-To: hangout-outgoing-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 28) id 2F03B16133B; Wed, 25 Mar 2015 01:29:38 -0400 (EDT) Delivered-To: hangout-at-nylxs.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by mrbrklyn.com (Postfix) with ESMTP id 1BCFD161339 for ; Wed, 25 Mar 2015 01:29:13 -0400 (EDT) Received: from [10.0.0.19] (unknown [96.57.23.82]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4D8321274D for ; Wed, 25 Mar 2015 01:29:13 -0400 (EDT) Message-ID: <551247A8.4090903-at-panix.com> Date: Wed, 25 Mar 2015 01:29:12 -0400 From: Ruben Safir User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Hangout Subject: [NYLXS - HANGOUT] Java Crimes Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: hangout-at-nylxs.com [NYLXS: HANGOUT] X-BeenThere: hangout-at-nylxs.com X-Mailing-list: hangout-at-nylxs.com Precedence: list List-Id: NYLXS General Discussion Forum List-Unsubscribe: List-Archive: List-Post: List-Help: List-Subscribe:
This is just my opinion and I don't really care how many people disagreee, but java is a stupid programming language.
Read this spec. It looks like it came out of Green Eggs and Ham
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` Threads are the fundamental model of program execution in a Java program, and the Java language and its API provide a rich set of features for the creation and management of threads. All Java programs comprise at least a single thread of control—even a simple Java program consisting of only a main() method runs as a single thread in the JVM. Java threads are available on any system that provides a JVM including Windows, Linux, and Mac OS X. The Java thread API is available for Android applications as well. There are two techniques for creating threads in a Java program. One approach is to create a new class that is derived from the Thread class and to override its run() method. An alternative —and more commonly used — technique is to define a class that implements the Runnable interface. The Runnable interface is defined as follows: public interface Runnable { public abstract void run(); } When a class implements Runnable, it must define a run() method. The code implementing the run() method is what runs as a separate thread.
Figure 4.12 shows the Java version of a multithreaded program that determines the summation of a non-negative integer. The Summation class implements the Runnable interface. Thread creation is performed by creating an object instance of the Thread class and passing the constructor a Runnable object. ***Creating a Thread object does not specifically create the new thread; rather, the start() method creates the new thread. Calling the start() method for the new object does two things: 1.2.It allocates memory and initializes a new thread in the JVM. It calls the run() method, making the thread eligible to be run by the JVM.
***(Note again that we never call the run() method directly. Rather, we call the start() method, and it calls the run() method on our behalf.)***
ehhhh... feh
|
|