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
skad [1K]
4 years ago
13

Provide instance fields for title, month, and year (for example, "Scientific American", "April", 2020). Each of these should be

accessible only within the Magazine class.Create a constructor, which initializes the instance fieldsWrite a toString() method, modeled after the standard Java toString() method, to return a String representation of the Magazine.Write an equals() method, modeled after the standard Java equals() method. Two Magazines are equal if they have the same title, month, and year.HTML EditorKeyboard Shortcuts

Computers and Technology
1 answer:
miskamm [114]4 years ago
4 0

Answer:

Check the explanation

Explanation:

Note : check attached image for output and program and also note that you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Program : **************Magzine.java**********************

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

public class Magzine {

 

//class variable private can not access outside class

private String title;

private String month;

private int year;

 

//parameterized constructor

public Magzine(String title,String month,int year)

{

this.title=title;

this.month=month;

this.year=year;

}

 

//override toString method

"at"Override

public String toString()

{

String detail=title+" "+month+" "+Integer.toString(year);

return detail;//return string of class variable

}

 

//get Magzine objecte

 

public boolean equals(Magzine obj)

{

//commented returm statement compare string by address so you can uncomment if

//we do not use same string object of String class

//return this.month==obj.month && this.title==obj.title && this.year==obj.year;

//compare two object element if matches return true else false

return (this.month.equals(obj.month)) &&(this.title.equals(obj.title)) && this.year==obj.year;

}

   

}

Program : *************************Main.java****************************

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

public class Main {

/**

* "at"param args the command line arguments

*/

public static void main(String[] args) {

// TODO code application logic here

Magzine Obj =new Magzine("Scientific American ", "April", 2020); //object of class

Magzine Obj1 =new Magzine("Scientific American ", "April", 2020);//Obj and obj1 is same content data

Magzine Obj2 =new Magzine("Scientific American", "June", 2020); //obj and obj1 same but obj2 different

 

System.out.println(Obj.toString()); //print string of obj

System.out.println(Obj1.toString());//print string of obj1

System.out.println(Obj2.toString());//print string of obj2

 

 

System.out.println(Obj.equals(Obj1)); //obj and obj1 equal and return true

System.out.println(Obj.equals(Obj2)); // obj and obj2 not equal so return false

 

 

}

 

}

Output can be seen below:

You might be interested in
A time-saving strategy that helps define unfamiliar words involves using
yuradex [85]

The correct answer is A. Familiar words for clues

Explanation:

Finding unfamiliar words is common while reading, especially in texts that belong to a specific field such as medicine, technology, etc. This can be handled through multiple strategies such as using a dictionary, guessing the meaning of the word based on its parts, and using context clues.

In this context, one of the easiest and most time-saving strategy is the use of context clues that implies using the familiar words as clues to guess the meaning of an unfamiliar word. This is effective because in most cases the meaning of an unknown word can be determined using the context of the word or words around the unknown word. Also, this strategy takes little time because you only need to analyze the sentence or paragraph where the unknown word is. Thus, the time-saving strategy to define unfamiliar words involves using familiar words for clues.

6 0
3 years ago
Read 2 more answers
PLEASE HELP WILL GIVE BRAINLIEST!
fgiga [73]

Answer:

(1BD.63B851EB851EB851EB85)₁₆

Explanation:

7 0
4 years ago
Read 2 more answers
Briefly describe the importance of thoroughly testing a macro before deployment. What precautions might you take to ensure consi
Shalnov [3]

Answer:

Answered below

Explanation:

A macro or macroinstruction is a programmable pattern which translates a sequence of inputs into output. It is a rule that specifies how a certain input sequence is mapped to a replacement output sequence. Macros makes tasks less repetitive by representing complicated keystrokes, mouse clicks and commands.

By thoroughly testing a macro before deployment, you are able to observe the flow of the macro and also see the result of each action that occurs. This helps to isolate any action that causes an error or produces unwanted results and enable it to be consistent across end user platforms.

8 0
3 years ago
this isn't school related, it's about my stupid phone, when I restart it it switches to auto time by my network providers and I
Murljashka [212]
Try<span>  turning the 'automatic time' toggle off.</span>
8 0
4 years ago
Does anyone know the answer for this? I’m extremely confused.
Nadusha1986 [10]

Answer:

move 3 right   down 1      3 to the left.  down 2    2 to the right    up one.   1 to the left    one up    2 to the right    and 2 down and your at the end without going back       hope this helps

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Nappropriate use of technology makes it easier for cyber bullies to <br> others.
    5·2 answers
  • A technician receives an invalid certificate error when visiting a website with port 443 enabled. Other computers on the same LA
    8·1 answer
  • How to change your name to a fake one
    8·1 answer
  • Consider the conditions and intentions behind the creation of the internet—that it was initially created as a tool for academics
    12·1 answer
  • Use the {blank} to view your presentation the way an audience will see it.
    13·2 answers
  • What are some other projects or things you do in your life (other than writing an essay) where you use an iterative process?
    9·2 answers
  • An electronic ____ is an application you use to perform numeric calculations and to analyze and present numeric data.
    9·1 answer
  • How to get the whole number of a fraction in python
    6·1 answer
  • What is the output of the code? (CHECK IMAGE)
    12·1 answer
  • Question 11 of 20
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!