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
Sati [7]
3 years ago
5

For this exercise, you are given the Picture class and the PictureTester class. The Picture class has two instance variables. Yo

u will need to finish the class by writing getter and setter methods for these two instance variables.
Then in the PictureTester class a Picture object has been created for you. You will need to update this object and then print using the getter methods you created.
public class Picture
{
private String name;
private String date;
public Picture(String theName, String theDate){
name = theName;
date = theDate;
}
// Add getter and setter methods here.
// method names should be:
// getName, setName, getDate, setDate
}
Computers and Technology
1 answer:
Strike441 [17]3 years ago
7 0

Answer:

hope this helps, do consider giving brainliest

Explanation:

public class Picture {

  

   // two instance variables

   private String name;

   private String date;

  

   // Parameterized constructor

   public Picture(String name, String date) {

       super();

       this.name = name;

       this.date = date;

   }

  

   /**

   * return the name

   */

   public String getName() {

       return name;

   }

   /**

   * param name the name to set

   */

   public void setName(String name) {

       this.name = name;

   }

   /**

   * return the date

   */

   public String getDate() {

       return date;

   }

   /**

   * param date the date to set

   */

   public void setDate(String date) {

       this.date = date;

   }  

}

----------------------------------------------------TESTER CLASS---------------------------------------------------------------------

package test;

public class PictureTester {

   public static void main(String[] args) {

       // TODO Auto-generated method stub

       // creating Picture object (pic is the reference variable) and we are invoking the constructor by passing // values of name and date

      

       Picture pic = new Picture("flower_pic", "28-04-2020");

      

       // now we will first use get method

       String name = pic.getName();

       String date = pic.getDate();

      

       // displaying the value fetched from get method

       // value will be name - flower_pic and date - 28-04-2020

       System.out.println("[ Name of the Picture - "+name+" and Date - "+date+" ]");

      

       // now we will use set method to set the value of name and date and then display that value

       // declaring two variable

      

       String name1 = "tiger_pic";

       String date1 = "28-03-2020";

      

       //assigning those value using set method

      

       pic.setName(name1);

       pic.setDate(date1);

      

       System.out.println("[ Name of the Picture - "+pic.getName()+" and Date - "+pic.getDate()+" ]");

      

   }

}

You might be interested in
The layout gallery displays 10 slide layouts with a variety of placeholders to define text and content positioning and formattin
Papessa [141]
The above statement is FALSE.

The layout gallery displays 9 slide layouts NOT 10. 

These 9 layouts have various<span> placeholders to define text and content positioning and formatting.

</span>1 - Title slide
2 - Title and content
3 - Section Header
4 - Two content
5 - Comparison
6 - Title only
7 - Blank 
8 - Content with Caption
9 - Picture with Caption
8 0
3 years ago
How do you change the name on your brainly account?
serg [7]

Answer:

For changing your username you can contact to administrator of the site. If you are using app then go to message option. Then search "rishilaugh" then you can message him. Hope it helps you!

8 0
4 years ago
Web crawlers or spiders collect information from Web pages in an automated or semi-automated way. Only the text of Web pages is
krek1111 [17]

Answer:

The correct answer to the following question will be "False".

Explanation:

  • Web crawlers make copies of google search recovery pages that index the streamed pages to allow subscribers to more effectively search. It collects details of Web pages in an automatically generated or semi-automated form.
  • The code of HTML and Hyperlink can be checked by crawlers. They could be used for scraping of the web.

Therefore, the given statement is false.

5 0
3 years ago
1. Write an application that prompts the user to enter the size of the side of a square, and then displays a hollow square of th
belka [17]

Answer:

import java.util.Scanner;

public class HollowSquare

{

public static void main(String args[])

{

Scanner scan = new Scanner(System.in);

int size;

System.out.print("Enter the size : ");

size = scan.nextInt();

if(size>=1 && size<=20)

{

for(int i=0; i<size; i++)

{

for(int j=0; j<size; j++)

{

if(i==0 || j==0 || i==size-1 || j==size-1)

System.out.print("*");

else

System.out.print(" ");

}

System.out.println();

}

}

else

System.out.println("Invalid size.");

}

}

4 0
3 years ago
True or False Answers 4.1
raketka [301]

Answer:

true

Quizlet accounting chapter 4 helps with studying

3 0
3 years ago
Other questions:
  • Is anyone familiar in drawing flow charts for c++ programming
    14·1 answer
  • When inserting a fly in animation what is the first step in the process?
    9·1 answer
  • When you select a state abbreviation from a combo box, how does the form control record your selection?
    8·1 answer
  • I NEED HELP PLEASE ITS TIMED
    9·1 answer
  • How do you implement instruction level parallelism
    11·1 answer
  • Write an algorithm that receives a number from the user (you can store the number in a variable called N). Then the algorithm sh
    8·1 answer
  • Does the security burden fall primarily on the user? On
    10·1 answer
  • Write any two features of Guided media​
    5·1 answer
  • WILL GIVE A BRAINLIEST!!! PLS HELP!!!
    5·1 answer
  • How dose computers it use the information to solve problems
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!