1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Setler79 [48]
3 years ago
9

The preferred means of creating multithreaded Java applications is by implementing the ________ interface. An object of a class

that implements this interface represents a task to perform.
Computers and Technology
1 answer:
Kaylis [27]3 years ago
8 0

Answer:

Runnable.

Explanation:

Java is an all round programming language which is typically object-oriented and class-based. It was designed by James Gosling, developed by Sun microsystems and released officially on the 23rd of May, 1995. Java programming language is designed to have only a few implementation dependencies as possible because it was intended to be written once, and run on any platform.

Java makes concurrency to be available to software developers through the application programming interface (API) and the language. Also, it supports multiple threads of execution, by making each thread have its respective program counter and method-call stack, which then allow concurrent executions with other threads.

The preferred means of creating multithreaded Java applications is by implementing the runnable interface. An object of a class that implements this interface represents a task to perform. The code is public void run ().

You might be interested in
What are video games and what have they meant for society?
Paraphin [41]

video games are a source of entertainment for people especially children.

it helps relieve stress for adults or grown ups.

society sees video games as a negative impact on children and that it wastes their time.

8 0
3 years ago
Read 2 more answers
We begin with a computer implemented in single-cycle implementation. When the stages are split by functionality, the stages do n
vampirchik [111]

<u>Answer:</u>

a) First, we need to determine the pipeline stage amounting to the maximum time. In the given case, the maximum time required is 2ns for MEM. In addition, the pipeline register delay=0.1 ns.

Clock cycled time of the pipelined machine= max time+delay

=2ns+0.1 ns

=2.1 ns

b) For any processor, ideal CPI=1. However, since there is a stall after every four instructions, the effective CPI of the new machine is specified by:

1+(1 / 4)=1.25

c) The speedup of pipelined machine over the single-cycle machine=avg time per instruction of single cycle/avg time per instruction of pipelined.

Single cycle processor:

CPI=1

Clock period=7 ns

Pipelined processor:

Clock period=2.1 ns

CPI=1.25

Therefore, speedup==7^{*} 1 /\left(2.1^{*} 1.25\right)

=7/2.625

= 2.67

d) As the number of stages approach infinity, the speedup=k where k is the number of stages in the machine.

8 0
3 years ago
g % Create a program to plot the motion of the ping pong ball with drag. % The program will take inputs for velocity in m/s and
Gala2k [10]

Answer:

% Create a program to plot the motion of the ping pong ball with drag.  

% The program will take inputs for velocity in m/s and angle of launch.

% note that with a high speed camera I estmated a launch speed for a ping

% pong ball could be 30 m/s.

clear all

close all

clc

velStart=input('input the initial velocity in m/sec:   ');

angle=20:5:80;

% convert the degrees into radians so MATLAB likes it

values_angle=angle*pi./180;

rangeAngle=length(values_angle);

hold on

%Lines 1 - 14 are fine

for i=1:rangeAngle

% set initial position and time

x=[];

y=[];

time=[];

vel=velStart;

VelocityX=[];

VelocityY=[];

x(1)=0; % meters

y(1)=.001;  % meters

time(1)=0; % seconds

mass=.00247; %kg  ping pong ball .00247 Kg

g=-9.8; % m/sec^2

c=0.0005; % coefficient of drag where Re is between 10^3 and 10^5

% so I can load an array for plotting

% start to increment the motion

 

index=1;

thisAngle=values_angle(i);

velx=vel*cos(thisAngle);

VelocityX(1)=velx;

vely=vel*sin(thisAngle);

VelocityY(1)=vely;

% set a time step

deltaTime=.001; % seconds

height=y(1);

flag=0;

velFinalX = 0;

velFinalY = 0;

%Don't see any issues here

while height>0 % check that the ball has not hit ground yet (1e-3 to speed things up, It hangs because it never leaves this line, check how height is calculated.)

   index = index+1;

   

   % *******************************************************

   % break velocity into its components

   if index == 2

       velx = vel*cos(thisAngle);

       vely = vel*sin(thisAngle);

   else

       velx = velFinalX;

       vely = velFinalY;

   end

   % *******************************************************

   

   

   % *******************************************************

   % use an if/else statement to check to see if the ball is moving  

   % down (negative). If it is, then drag has an opposite sign

   % as gravity in the acceleration formula.  Otherwise gravity

   % and drag have the same sign. Calculate the new acceleration in the y.

   if vely < 0

       adragy = g + (c*vely.^2)/mass;

       velFinalY = vely + adragy.*deltaTime;

   else

       adragy = g - (c*vely.^2)/mass;

       velFinalY = vely + adragy.*deltaTime;

   end

   % *******************************************************

   

   % *******************************************************

   % Now calculate the acceleration in the x .

   adragx = (-c*velx.^2)/mass;

   % *******************************************************

   

   

   % *****************************************************

   % calculate the new velocity at the end of the time step

   % this will have X and Y components, so you need a variable

   % for each.  One is velFinalX and the other is velFinalY.

   velFinalX = velx + adragx.*deltaTime;

%     velFinalY = vely + adragy.*deltaTime;

   % *******************************************************

   

   

   % ******************************************************

   % Get a new velocity vector and angle given the X and Y

   % The velocity is the variable "vel" and angle is "angle"

   vel = sqrt(velFinalX.^2 + velFinalY.^2);

   angle = atan(velFinalY/velFinalX);

   %*******************************************************

   

   % now save my values at this time step

   VelocityX(index)=velFinalX;

   VelocityY(index)=velFinalY;

   

   % and distance numbers

   distX=VelocityX(index).*deltaTime;

   distY=VelocityY(index).*deltaTime;

   

   % save distance values  

   x(index)=x(index-1)+distX;

   y(index)=y(index-1)+distY;

   height=y(index);

   time(index)=time(index-1)+deltaTime;

   %lines 105-107 are good

   if distY<0&&flag<=1

       if height<.25

           disp(distY)

           fprintf('goal height detected at distance %.2f meters.',x(index));

           flag =2;

           LandingDistance(i)=x(index);

       end

   end

   

end

plot(x,y)

title('distance traveled by ping pong ball in meters')

xlabel('horizontal distance traveled (meters)')

ylabel('vertical distance traveled (meters)')

end

hold off

Explanation:

7 0
3 years ago
Give an example of an embedded systems application.
Gala2k [10]

Answer:

A clock in the mobile phone

Explanation:

a clock is a computer in a mobile phone which is a computer,hence it's a computer in a computer

7 0
3 years ago
Name and describe methods of inplementing a new computer system. For each one describe the type of situation where each method m
Sunny_sXe [5.5K]

this is the answer hope it will help you

6 0
2 years ago
Other questions:
  • Which windows tool can you use to find out if the hard drive is slowing down windows performance?
    9·1 answer
  • An email can lead to miscommunication because:
    6·2 answers
  • Which of the following scenarios can best be addressed by operations management?
    11·1 answer
  • In preparing his persuasive presentation, Reza should most likely focus on clearly presenting his
    6·2 answers
  • A company wants to inform a select list of it's regular customers about a flash sale. Which type of platform will it use to send
    9·1 answer
  • On mad max ps4, why does the v6 sound beter and healthier than the v8
    8·1 answer
  • 24
    13·2 answers
  • Which 3 navigation features are missing in a reports only user view?
    7·2 answers
  • Alguien que me pueda ayudar diciéndome las características de Visual Object en programacion porfavor?!
    6·1 answer
  • When and why would you use a prefab? <br> Subject video gaming
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!