Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PART 2 of other question I asked this question is different Advanced Programming

ID: 3663802 • Letter: P

Question

PART 2 of other question I asked this question is different Advanced Programming Languages This is a discussion topic please go into detail discussing the rules governing redeclaration of local names the same as those governing redeclaring local names that rename class-level names? Question and instructions: Let's consider Java, a language with which everyone should be familiar, and explore its scope rules. One aspect of the scope rules of any language is when data or methods can have the same name. Are the rules governing redeclaration of local names the same as those governing redeclaring local names that rename class-level names? **** please don't just copy something off the internet and answer the question. This has to be in your own words and not a novel copied from a website or document. (The teacher also has access to the internet sites your copying from)

Explanation / Answer

There is 2 kinds of scope.

Local scope and global scope

Local scope:when the effect of variable is just confined to the method .Outside the method that that variable is not valid.So we can redeclare the same variable if we want in another method.But not inside the method in which we have already used it.

Global Scope:when we declare the variable outside any of the method.Then that variable becomes a variable in global scope.This cannot be redeclared in any methods,because its scope is confined to the entire program.