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
Tatiana [17]
3 years ago
14

When is it not necessary to invoke the method myMethod using dot notation? When myMethod is private. When myMethod is invoked by

a method in the same class as myMethod. When myMethod is public. When myMethod is both private and static. When myMethod is invoked by a method in a different class than myMethod.
Computers and Technology
2 answers:
Paraphin [41]3 years ago
5 0

Answer:

When myMethod is invoked by a method in the same class as myMethod.

Explanation:

When you are in a class, it is like a different enviroment and within that class you can call a method without using the dot notation because you are still within the class.

Outside the class and despite the type of method, public, private or static, the dot notation will be required.

kari74 [83]3 years ago
3 0

Answer:

When myMethod is invoked by a method in a different class than myMethod.

Explanation:

Other classes can invoke the function written in different classes using the dot notation.

You might be interested in
A _____ is a modeling tool used in structured systems analysis and design (SSAD) analysis model that helps break down a complex
Shalnov [3]

A <em>"DATA FLOW DIAGRAM"</em> is a modeling tool used in structured systems analysis and design (SSAD) analysis model that helps break down a complex process into simpler, more manageable, and more understandable subprocesses

8 0
3 years ago
Taking a suitable example in c language explain the of call by value and call by reference concepts.
Degger [83]

Answer: The difference between call by value and call by reference is that in call by value the actual parameters are passed into the function as arguments whereas in call by reference the address of the variables are sent as parameters.

Explanation:

Some examples are:

call by value

#include <stdio.h>  

void swap(int, int);

int main()

{  int a = 10, b= 20;

 swap(a, b);

 printf("a: %d, b: %d\n", a, b);

}  

void swap(int c, int d)

{

 int t;

 t = c; c = d; d = t;

}  

OUTPUT

a: 10, b: 20

The value of a and b remain unchanged as the values are local

//call by reference

#include <stdio.h>

 void swap(int*, int*);

 int main()

{

 int a = 10, b = 20;

 swap(&a, &b);   //passing the address

 printf("a: %d, b: %d\n", a, b);

}

void swap(int *c, int *d)

{

 int t;

 t = *c; *c = *d; *d = t;

}

OUTPUT

a: 20, b: 10

due to dereferencing by the pointer the value  can be changed which is call by reference

8 0
3 years ago
Write at least 4 sentences
elixir [45]

Answer:

I don't know who advance the evolution who is it!

8 0
3 years ago
For this lab you will write a class to create a user-defined type called Shapes to represent different shapes, their perimeters
maw [93]
<h2>Answer:</h2>

<u />

========= Shape.java  ===========

//import the Scanner class

import java.util.Scanner;

public class Shape{

   //required fields

  private String shape;

   private double area;

   private double perimeter;

   //default constructor

  public Shape(){

       this.shape = "unknown";

       this.area = 0.0;

       this.perimeter = 0.0;

   }

   //constructor with one parameter

   public Shape(String shape){

       this.setShape(shape);

       this.area = 0.0;

       this.perimeter = 0.0;

   }

   //accessors and mutators

  public void setShape(String shape){

       this.shape = shape;

   }

  public String getShape(){

       return this.shape;

   }

   public double getPerimeter(){

       return this.perimeter;

   }

  public double getArea(){

       return this.area;

   }

  public void setPerimeter(Scanner scr){

       if(this.getShape().equals("circle")){

           System.out.println("Enter the radius of the circle");

           double radius = scr.nextDouble();

           this.perimeter = 2 * 3.142 * radius;

       }

       else if(this.getShape().equals("rectangle")){

           System.out.println("Enter the width");

           double width = scr.nextDouble();

           System.out.println("Enter the height");

           double height = scr.nextDouble();

           this.perimeter = 2 * (width + height);

       }

       else if(this.getShape().equals("square")){

           System.out.println("Enter the height or width");

           double height = scr.nextDouble();

           this.perimeter = 4 * height;

       }

       else if(this.getShape().equals("unknown")){

           System.out.println("You must define a shape first before calculating perimeter");

           this.perimeter = 0.0;

       }

       else {

           System.out.println("You must define a shape first before calculating perimeter");

           this.perimeter = 0.0;

       }

   }

   public void setArea(Scanner scr){

       if(this.getShape().equals("circle")){

           System.out.println("Enter the radius of the circle");

           double radius = scr.nextDouble();

           this.area = 3.142 * radius * radius;

       }

       else if(this.getShape().equals("rectangle")){

           System.out.println("Enter the width");

           double width = scr.nextDouble();

           System.out.println("Enter the height");

           double height = scr.nextDouble();

           this.area = width * height;

       }

       else if(this.getShape().equals("square")){

           System.out.println("Enter the height or width");

           double height = scr.nextDouble();

           this.area = height * height;

       }

       else if(this.getShape().equals("unknown")){

           System.out.println("You must define a shape first before calculating area");

           this.area = 0.0;

       }

       else {

           System.out.println("You must define a shape first before calculating area");

           this.area = 0.0;

       }

   }

   //Own methods

   //1. Method to show the properties of a shape

   public void showProperties(){

       System.out.println();

       System.out.println("The properties of the shape are");

       System.out.println("Shape : " + this.getShape());

       System.out.println("Perimeter : " + this.getPerimeter());

       System.out.println("Area : " + this.getArea());

   

   }

   //2. Method to find and show the difference between the area and perimeter of a shape

   public void getDifference(){

       double diff = this.getArea() - this.getPerimeter();

       System.out.println();

       System.out.println("The difference is " + diff);

   }

}

========= ShapeTest.java  ===========

import java.util.Scanner;

public class ShapeTest {

   public static void main(String [] args){

       Scanner scanner = new Scanner(System.in);

       // create an unknown shape

       Shape shape_unknown = new Shape();

       //get the shape

       System.out.println("The shape is " + shape_unknown.getShape());

       //set the area

       shape_unknown.setArea(scanner);

       //get the area

       System.out.println("The area is " + shape_unknown.getArea());

       //set the perimeter

       shape_unknown.setPerimeter(scanner);

       //get the perimeter

       System.out.println("The perimeter is " + shape_unknown.getPerimeter());

       // create another shape - circle

       Shape shape_circle = new Shape("circle");

       //set the area

       shape_circle.setArea(scanner);

       //get the area

       System.out.println("The area is " + shape_circle.getArea());

       //set the perimeter

       shape_circle.setPerimeter(scanner);

       //get the area

       System.out.println("The perimeter is " + shape_circle.getArea());

       //get the properties

       shape_circle.showProperties();

       //get the difference between area and perimeter

       shape_circle.getDifference();

   }

}

<h2>Sample output:</h2>

The shape is unknown

You must define a shape first before calculating area

The area is 0.0

You must define a shape first before calculating perimeter

The perimeter is 0.0

Enter the radius of the circle

>> 12

The area is 452.448

Enter the radius of the circle

>> 12

The perimeter is 452.448

The properties of the shape are

Shape : circle

Perimeter : 75.408

Area : 452.448

The difference is 377.03999999999996

<h2>Explanation:</h2>

The code above is written in Java. It contains comments explaining important parts of the code. Please go through the code for more explanations. For better formatting, the sample output together with the code files have also been attached to this response.

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
57aa40cd91dceaa5454e65fc5d209315.png
5 0
3 years ago
How many units are considered a full time student at a community college in California?
Crazy boy [7]

Answer:

12

Explanation:

According to Saddleback college located in California;

12 units are considered full-time student status.

You may take as little as 0.5 units or as many as 19.0 units during a single semester. To take more than 19 units you are required to obtain special permission from the Counseling Department.

7 0
2 years ago
Other questions:
  • How do you uninstall a program using the Control Panel?
    10·1 answer
  • The partners of a small architectural firm are constantly busy with evolving client requirements. To meet the needs of their cli
    11·1 answer
  • If you want to open an application that does not have a tile pinned to the Start menu, _____ to find it in the list of installed
    7·1 answer
  • Constructors have the same name as the ____.1. data members2. member methods3. class4. package
    5·1 answer
  • What is the difference between line art and continuous tone copy?
    14·1 answer
  • All of the following are current key technology trends raising ethical issues except:_________
    13·1 answer
  • You can count on everything online to be 100% accurate. <br> A. FALSE <br> B. TRUE
    11·2 answers
  • How do you delete answers on Brain.ly?
    11·2 answers
  • I can talk to you! How about we talk through the you know where people comment and say stuff about the question1
    10·2 answers
  • Computers rarely make mistakes. True or false
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!