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
forsale [732]
3 years ago
7

consider Java and explore its scope rules. One aspect of the scope rules of any language is when data or methods can have the sa

me name. Give examples in Java to illustrate a case where declaring two local variables with the same name in same method is permitted and one where it is prohibited. Are the rules governing redeclaration of local names the same as those governing redeclaring local names that rename class-level names?
Computers and Technology
1 answer:
navik [9.2K]3 years ago
5 0

Answer and Explanation:

Abstract class Point {

   int x = 1, y = 1;

   void move(int dx, int dy) {

       x += dx;

       y += dy;

       alert();

   }

   abstract void alert();

}

abstract class Colored Point extends Point {

   int color;

}

class Simple Point extends Point {

   void alert() { }

}

Here, a class Point is proclaimed that must be declared abstract, in light of the fact that it contains an assertion of a unique strategy named alert. The subclass of Point named Colored Point acquires the dynamic technique alert, so it should likewise be proclaimed theoretical. Then again, the subclass of Point named Simple Point gives a usage of alarm, so it need not be dynamic.

The statement:

Point p = new Point();

would bring about an aggregate time mistake; the class Point can't be launched in light of the fact that it is theoretical. Be that as it may, a Point variable could accurately be instated with a reference to any subclass of Point, and the class Simple Point isn't digest, so the statement:

Point p = new Simple Point();

would be correct. Instantiation of a Simple Point causes the default constructor and field initializers for x and y of Point to be executed.

You might be interested in
Translate the following pseudocode for randomly permuting the characters in a string into a C++ program.
Svetllana [295]

Answer:

d

Explanation:

salak sensin kolay gelsin

6 0
2 years ago
(Java) Can anyone help me with this ?? The skeleton of the code must be same as the image.
Kay [80]
Is that a essay ur supposed to write

6 0
2 years ago
Ted wants to share some information with his team. Match the levels of information with the content of the information that Matt
myrzilka [38]

The  Match up of the levels of information with the content of the information that Matt has shared are:

The nice to know - Ted makes an announcement of the total annual profit of the company.

The  should know - Ted gives his team a brief of the email etiquette for them to follow.

The  must know - Ted informs his team about the office work hours and dress code.

<h3>What do you mean by information?</h3>

Information is known to be data or any form of stimuli that connote a given meaning in some context to its receiver.

Hence, The  Match up of the levels of information with the content of the information that Matt has shared are:

The nice to know - Ted makes an announcement of the total annual profit of the company.

The  should know - Ted gives his team a brief of the email etiquette for them to follow.

The  must know - Ted informs his team about the office work hours and dress code.

Learn more about information from

brainly.com/question/4231278

#SPJ1

6 0
1 year ago
Meg wants to preview all images in a folder so that she can quickly find the image she wants. Which view will help her do this?
Liono4ka [1.6K]
Thumbnails is the answer

3 0
3 years ago
How to recover permanently deleted photos on iphone 11?
grandymaker [24]

Answer:

Look in your recently deleted album and if it is not there try checking your iCloud, if its not there then it's sadly probably gone forever.

Explanation:

7 0
2 years ago
Other questions:
  • Getting access to web browsing software to install it on a computer or to update your existing software is called _________ .
    9·2 answers
  • Which statement accurately compares the restart at 1 and continue numbering featured of word
    15·2 answers
  • What do these terms have in common? google, yahoo!, bing they are important books. they are internet search engines. they are wo
    10·1 answer
  • What is the cell membrane used for ​
    14·2 answers
  • Why coaxial cable is called coaxial cable?
    11·1 answer
  • Check My Work Sherri is considering replacing a processor on her laptop. The laptop is running slower than she would like. What
    9·1 answer
  • In what ways can you modify the location of the neutral point?
    11·1 answer
  • Gn guys have an Amazing day!
    12·2 answers
  • Primary memory consists of the various devices that are able to store data and programs even when the power is off. true or fals
    11·1 answer
  • What does altgr mean on a keyboard.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!