Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 4 There are two tasks for this assignment. Task 1 : Please comment on the corresponding parts in the ATypicalJavaProgram.java used in the class.

Assignment 4
There are two tasks for this assignment.
Task 1: Please comment on the corresponding parts in the ATypicalJavaProgram.java used in the class. The ATypicalJavaProgram.java can be found in the moodle attached.
In the class, Weifeng Pan discussed the anatomy of a Java program by providing comments on key sections of the code. Follow Weifeng Pan's example by commenting and modifying the code yourself. Completing this task will give you a better understanding of what a standard Java program should resemble.
Please submit the commented version to Moodle.
Task 2: Thinking, reasoning, and fixing
For details, please refer to the comments in the IdentifiersDemo.java.
Please submit the commented version to Moodle.
Warning: All the materials should be compressed into one file and submitted to Moodle.
package edu.ou.typicaljavaprogram;
interface IWalk {
void walk();
}
class Animal {
public void say(String content){
System.out.println("Animals say ""+
content +"");
}
}
class Dog extends Animal implements IWalk {
private String name = "Wang";
@override
public void say(String content){
System.out.println("Dogs "+ name +"
say ""+ content +""");
}
@Override
public void walk(){
System.out.println("Dogs walk...");
}
}
public class ATypicalJavaProgram {
public static void main(String[] args){
Dog dog= new Dog();
dog.say("I am cute.");
}
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago