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
When an interrogator speaks highly about how a crime was committed, hoping to get the suspect to brag about his or her involveme
Alexeev081 [22]

I’d go with b. egotistical, i’m not entirely sure though. It seems like he is trying to appeal to the suspects EGO

8 0
3 years ago
Read 2 more answers
You can put a small level on your camera to help keep the horizons straight? TRUE OR FALSE
anastassius [24]
The answer is true and i believe it is best to put it at the 4 intersecting points<span />
5 0
3 years ago
Read 2 more answers
To apply format to text, both the text and the text box must be selected.
Xelga [282]
I say it is true
hope this helps!
5 0
3 years ago
List safety conditions when downloading shareware, free free where, or public domain software
Anit [1.1K]

Answer:

Explanation:

Freeware and shareware programs are softwares which are either free of charge or consist of a free version for a certain trial period. These programs pose a threat of habouring malware or viruses which could damage one's computer and important files and programs. Therefore, it is imperative that carefulness is maintained when trying to get these softwares.

Some of the necessary safety conditions that should be taken include;

1) Appropriate research about the software including taking more about the vendors and reviews.

2.) Once, a healthy review has been identified ; the download can begin with the Downloader ensuring that the download is from the recommended site.

3) Prior to installation the software should be scanned with an active anti-virus program to determine if there is possibility that a virus has creeped in.

4.) Some softwares may require that computer anti-virus be turned off during installation, this is not always a good idea as this act leaves the system vulnerable a d badly exposed.

6 0
3 years ago
To create a datetime object for the current date and time, you can use theGroup of answer choicestoday() method of the date clas
SVEN [57.7K]

var theDate = new DateTime (DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, hours, minute, second);

6 0
2 years ago
Other questions:
  • Write a recursive function, replace, that accepts a parameter containing a string value and returns another string value, the sa
    5·1 answer
  • What are some of the issues that organizations need to be aware of when designing and managing data?
    8·1 answer
  • In a system using the relocatable dynamic partitions scheme, given the following situation (and using decimal form): Job Q is lo
    5·1 answer
  • What is this line of code doing? scanf("%f", &amp;height);
    6·1 answer
  • Which picture should i put as my profile picture.
    15·2 answers
  • Use the drop-down menus to answer the questions.
    6·1 answer
  • Write a method that returns a String that is just the first and last character of the given string Your return value should be o
    8·1 answer
  • Which is a linear presentation?
    10·1 answer
  • How can I master networking my home/business computer(s) - Tv's - iot devices and make the whole system as secure as possible?
    12·1 answer
  • Select the correct answer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!