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
Shtirlitz [24]
3 years ago
13

Complete the missing code in the templatepublic class Exercise09_04Extra { public static void main(String[] args) { SimpleTime t

ime = new SimpleTime(); time.hour = 2; time.minute = 3; time.second = 4; System.out.println("Hour: " + time.hour + " Minute: " + time.minute + " Second: " + time.second); } } class SimpleTime { // Complete the code to declare the data fields hour, // minute, and second of the int type }
Computers and Technology
1 answer:
snow_lady [41]3 years ago
3 0

Answer:

The code to this question can be given as:

code:

public class Exercise09_04Extra //define class

{

public static void main(String[] args) //define main method

{

SimpleTime time = new SimpleTime(2,3,4);

//create object of the class

System.out.println("Hour: " + time.hour + " Minute: " + time.minute + " Second: " +time.second); //print result

}

}

class SimpleTime //define class

{

int hour,minute,second; //set three integer variable

SimpleTime( int hour, int minute, int second ) //define parameterized constructor

{

this.hour = hour;

this.minute = minute;

this.second = second;

}

}

Output:

Hour: 2 Minute: 3 Second: 4

Explanation:

In the above java code firstly we define a main class that is Exercise09_04Extra. In this class we create another class object that is SimpleTime . Then we call parameterized constructor and print the values. When we call the SimpleTime class in this class we define an integer variable that is hour, minute and second and create the parameterized constructor and pass the variable as a parameter.In this constructor we use this keyword to hold the value of the passing variable. So the output of the following code is "Hour: 2 Minute: 3 Second: 4 ".

You might be interested in
________ symbol is used in the "Advanced" section of the time range picker to round down to nearest unit of specified time.
liberstina [14]

Answer:

@(at sign) is the correct answer to the following statement.

Explanation:

Because the following symbol is the "at sign" symbol that is used for the Advanced section in the time range picker that lets the user search for the specified time for the round down the closest entity of a particular period. So, that's why the following answer is correct for the following statement.

8 0
3 years ago
High speed printer that produce higher quality printouts but are more expensive is
lukranit [14]

Answer:

i think its D, laser printer

Explanation:

8 0
3 years ago
PLZ HELP FAST!!!! 
garik1379 [7]
Portable computing tools for example laptop
4 0
4 years ago
Read 2 more answers
What are the objects in object-oriented programming language?
VMariaS [17]

Answer:

An object is an abstract data type with the addition of polymorphism and inheritance. Rather than structure programs as code and data, an object-oriented system integrates the two using the concept of an "object". An object has state (data) and behavior (code). Objects can correspond to things found in the real world.

hope it helps ya mate.

5 0
3 years ago
Which skill type refers to the ability to interact and communicate effectively with people? skills refer to the ability to inter
koban [17]
Interpersonal skills.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Is Windows a:<br><br> A.operating system<br> B.software<br> C.hardware<br> D.input device
    12·1 answer
  • What is plagiarism?<br> EXPLAIN IT
    15·2 answers
  • Jax needs to write a block of code that will organize a list of items alphabetically. Which function should he use? append() pri
    12·1 answer
  • DESCRIBE FLOPPY DISK
    15·1 answer
  • Spreadsheets will be displayed as tables in presentations.True or False?
    6·2 answers
  • Which type of memory helps in reading as well as writing data?
    7·1 answer
  • Explain steps in creating a main document for from letter. <br>​
    5·1 answer
  • What is the function of a breadcrumb trail in a website?
    13·1 answer
  • Write a python program to find factorial, use exception handling and display an appropriate message if the user inputs alphabets
    7·1 answer
  • Fundamental of Computer Science
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!