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
What is the best free game designing program for windows
Nadusha1986 [10]
Python, Unity 3D, C++Notepad
8 0
3 years ago
Is this statement true or false?
quester [9]

Answer:

NOPE

Explanation:

sometimes presentations can be for one person only. For instance if you work in a company sometimes you present for your boss only etc.

Hope this helped :)

6 0
3 years ago
Read 2 more answers
When a single controller device communicates with multiple peripheral devices, what wires are simultaneously connected to all de
Tems11 [23]

The wires that are simultaneously connected to all devices in the network are;

SDA(Serial data line) and SCL

Integrated Circuits Communication

This involves I²C which is a form of communication based on integrated circuits.

Now, this I²C is a serial communication interface that has a bidirectional two-wire synchronous serial bus which usually comprises of two wires namely SDA (Serial data line) and SCL (Serial clock line).

Read more about integrated circuits communication at; brainly.com/question/26153031

7 0
2 years ago
What can you look for on a website to indicate that the information it presents is reliable?
dybincka [34]

There are several things you can look for on a website to help you figure out if the information is reliable. The first thing you should evaluate is the audience that the website is intended for. Is it intended for academics? School children? The general public?


The next thing you should look at is the author of the website. Is the author identified? Is the author an expert in their field? Can you establish the author's credibility? Is the author affiliated to an academic institution or credible organisation?


Look at the accuracy of the website. Check for spelling errors, proper grammar, and well-written text. Are there any sources cited? Are those sources credible?


You should also check to see when the information was published. Is the information up to date? Are all of the links up to date and functioning?


There is one last thing you can look at, and this is the domain of the website. Domains like .edu and .gov are more credible than .com or .net domains.

5 0
3 years ago
"Write code that prints: Ready! countNum ... 2 1 Start! Your code should contain a for loop. Print a newline after each number a
BartSMP [9]

Explanation:

#include <iostream.h>

#inlcude<conion.h>

void main()

{

  int count, x;

  clrscr();

  cout<<"Enter the count:";

  cin>> count;

  cout<<"Ready!\n";

  for(x=count;x>0;x--)

  {

     cout<<x<<"\n";

  }

  cout<<"Start";

  getche();

}

This is a simple program where the output is expected to be in reverse order. So we run a for loop starting from the count and decrements the counter by 1 every time when the loop runs and print the value. So to print the output in "new line" we include "\n".

6 0
3 years ago
Other questions:
  • The _____ command icon looks like a small clipboard with a page attached.
    6·1 answer
  • What is the fundamental problem producers and consumers face?
    12·1 answer
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • Plz help me of this answer<br><br><br>language:python​
    7·2 answers
  • Most Internet users access commercial websites, which have higher-quality information because of higher editing standards and th
    12·1 answer
  • Identify any eight new programming languages and classify them based on their functionality.
    14·2 answers
  • An IT professional with a customer-service
    13·1 answer
  • Which one is better AMD Ryzen 5 Or Nvidia Gtx 2080 ti
    6·1 answer
  • Firestick optimizing system storage and applications
    14·1 answer
  • What are the differences between a cursor, insertion point and mouse pointer?​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!