If you declare a variable as an instance variable within a class, and you declare and use the same variable name within a method of the class, then within the method, a) the variable used inside the method takes precedence b) the class instance variable takes precedence c) the two variables refer to a single memory address d) an error will occur

Answers

Answer 1

Answer:

Option(a) is the correct answer for the given question.

Explanation:

If we declared a variable with the same name in class and method both then the variable which is declared inside the method overrides the definition of variable which is declared in class .It means the variable which is used inside the method takes precedence.

For example:

public class Main

{

int c=90; // class varaible or instance varaible

void sum1()

{

   int c=4; // method having same name as class varaible name

   c=c+10;

   System.out.println(c);

}

public static void main(String[] args)

{

 Main ob=new Main();

 ob.sum1();

}

}

Output:

14

In this example the variable 'c' is declared in both class and function but variable c takes the precedence inside the method sum1() and display 14.

Answer 2
Final answer:

When a variable is declared as an instance variable within a class and the same variable name is declared and used within a method of the class, the variable used inside the method takes precedence over the class instance variable.

Explanation:

When a variable is declared as an instance variable within a class, and the same variable name is declared and used within a method of the class, the variable used inside the method takes precedence over the class instance variable. This is because local variables within a method have higher priority than instance variables in terms of accessing and modifying their values. The local variable and instance variable are separate and refer to different memory addresses.


Related Questions

Name 3 responsibilities of TCP.

Answers

Answer:

 The three basic responsibilities of the TCP are:

TCP is the transport layer protocol and it is basically responsible for maintain the end to end network communication. TCP is used for delivering the data and also make sure that the order of the packets are similar with the actual message. The transmission control protocol (TCP) is basically handle the communication between the host for establish an efficient connection so that they can easily exchange the data or information. It also provide the flow control in the network protocol and help in the multiplexing of the data to make the network more reliable.  

. If the sub-expression on the left of the __________ logical operator is true, the right

sub-expression is not checked.

Answers

Answer: "║"(OR) logical operator

Explanation:   "ll" logical is used for defining the OR  logical condition.This condition returns a value of true or false according to given expression.This expression can work on the Boolean variables only.

In this operator if any argument turn out to be true , the value returned is true otherwise the answer returned will be false.It also features that if the left side of this operator is true then the right sub-part of it's not evaluated as it becomes true overall.

Example of expression->  x ║ y ;

What is the downside of wider channel bandwidth?

Answers

Answer: Wider channel bandwidth has several downside or disadvantages to it. Some of these are as follow:

a) Higher channel bandwidth means lower will be the number of channels being utilized.

b) Wider bandwidth may lead to an increase in the speed but on the other hand, it'll lead to several interference problems.

what are somd negetive aspects and some positive aspects of having robots as a part of workplace?

Answers

Answer and Explanation:

Some of the negative aspects of robots at work place:

Lesser flexibilityHigher maintenance and installation costFuture insecurity and risk if the system malfunctionsA decline in the opportunities for humansUnemployment as a result of automation and robot regulated work place.

Some of the positive aspects of robots at work place:

Higher accuracy Higher speeds More work in less timeProductivity and hence efficiency will increaseCost of some operations is reduced.Ease of employing in dangerous and hazardous fields by using specific robots for each task

A remediation liaison makes sure all personnel are aware of and comply with an organization's policies.

True

False

Answers

Answer:

False.

Explanation:

I believe this should be the work of a compliance liaison. Assume you have opened up an organization that is growing each day. You have employees who are required to be compliant with all the security standards and policies. Hiring a compliance liaison will ensure that these compliances are being carried out. Each department in an organization should work with a compliance liaison to ensure that its employees understand and comply fully with all security policies.

The method with the declaration public static char procedure(double d) has a method type of . a) public b) static c) char d) double

Answers

Answer:

Option(c) is the correct answer for the given question .

Explanation:

Public is the access modifier not a method type so option(a) option is wrong.

Static is not return type static keyword before the method of procedure means it is directly accessed with the help of class name so option(b) is also wrong.

double is the datatype of variable d it is not the method type so option(d) is also wrong  

So char is the method type of the method procedure.

Therefore option (c) is the correct answer.

. The first step in devising security services and mechanisms is to develop a security policy True False

Answers

Answer: True

Explanation: For the creation of the security services and function the first step is having a policy regarding the security measure that is to be taken.Security policy consist of the procedures and function that should be implement in the system as a plan.

It monitors the flow,accessing of external component ,data assessment etc fro the protection.After the policies are made then the implementation take place. The most common deployment of this policy is in information technology(IT)sector .Thus, the given statement is true..

Fill in the blank.
A _____ is the smallest unit of measurement used to describe computer processing storage.

Answers

Answer:

A  bit

Explanation:

A bit in computing or any digital communication can be defined as the smallest unit of data of storage. In the smallest scale, nothing comes before it. It is expressed in binary value storage of 0’s or 1’s. By default, eight bits make a byte.

. Which of the following is the command for backing up a database from the command line?
(a) mysqlslap
(b) mysqlshow
(c) mysql --backup
(d) mysqldump

Answers

Answer:d) mysqldump

Explanation: The backing up of the database is the function that is operated by the MYSQL. The database that is to be backed up is known as the dump data ,which contains the data files in the text format."mysqldump" command is the SQL command that is given for the extraction of the single database as well as multiple databases.

This command works by recreating the data files by copying it in a quick manner.Other options are incorrect because those commands don not work in MYSQL for creating a backup of database.Thus, the correct option is option(d).

A day has 86,400 seconds (24*60*60). Given a number of seconds in the range of 0 to 1,000,000 seconds, output the time as days, hours, minutes, and seconds for a 24- hour clock. E.g., 70,000 seconds is 0 days, 19 hours, 26 minutes, and 40 seconds. Your function should output: Time is W days, X hours, Y minutes, and Z seconds. Your function should take the number of seconds as an integer parameter Your function MUST be named howLong.

Answers

Answer:

// here is code in c++.

// include headers

#include <bits/stdc++.h>

using namespace std;

// function that calculate days, hours, minutes and seconds

void howLong(int sec)

{

   // find days

   int days=sec/86400;

   // update the seconds

   sec=sec%86400;

   // find hours

   int h=sec/3600;

   // update the seconds

   sec=sec%3600;

   // find minutes

   int min=sec/60;

   // update the seconds

   sec=sec%60;

   // output

   cout<<sec<<"seconds is "<<days<<" days,"<<h<<" hours,"<<min<<" minutes,and "<<sec<<"seconds."<<endl;

}

// driver function

int main()

{   // variable

   int sec;

   cout<<"Enter seconds:";

   // read the seconds

   cin>>sec;

   // call the function

   howLong(sec);

   

return 0;

}

Explanation:

Read the seconds from user.Then call the function howLong() with parameter seconds. In the function, it will first find the number of days by dividing the seconds with 86400 then update the remaining seconds.Next it will find the hours by dividing the remaining seconds with 3600 and update the remaining seconds.After that it will find the minutes by dividing the remaining seconds with 60 and update the remaining second.Then it will print the days, hours, minutes and seconds.

Output:

Enter seconds:70000

40seconds is 0 days,19 hours,26 minutes,and 40seconds.

Here's a Python implementation of the howLong function that takes the number of seconds as an integer parameter and outputs the time in days, hours, minutes, and seconds:

def howLong(seconds):

   days = seconds // 86400

   hours = (seconds % 86400) // 3600

   minutes = (seconds % 3600) // 60

   seconds = seconds % 60

   return "Time is {} days, {} hours, {} minutes, and {} seconds.".format(days, hours, minutes, seconds)

Thus, we format the output string using the obtained values for days, hours, minutes, and seconds and return it.

For more details regarding python, visit:

https://brainly.com/question/30391554

#SPJ6

Debbie would like to create a file that she can use as a starting point to create other files for her English class. What should she create?: *
a. a content control
b.a style
c. a template
d.a theme

Answers

Answer:

c. a template.

Explanation:

She should first create a Template so that she can use it as a starting point to create other files.

A template is file created with a blueprint with  a format that can be used for a group of documents.For example:- there are different templates present of the resume.

Hence the answer to this question is template.

Which of the following views hides the ribbon and shows text on the screen in an easy-to-read format?: *
a. Full Screen Reading
b. Web Layout
c. Print Layout
d. Draft

Answers

Answer: a)Full Screen Reading

Explanation: Full screen reading is the option present for the reading the text format easily on the system screen .This mode works by minimizing the extra data elements like menus of the screen. The full screen reading mode is usually preferred while there is the requirement of only reading without any editing.

Other options are incorrect because web layout is the layout of the web page, print layout is the tab for printing the layout of page options and draft is the written document which can be edited .Thus , the correct option is option(a)

Answer:

1. toolbar

2. reading

3. double-click

Explanation:

What is ‘White-Box’ testing?

Answers

Answer:

 The white box testing is the method in which it basically test the internal structure and working application in the software testing.

In the white box testing the programming skills are require for designing the various test cases.

White box testing is also known as open box testing and it require the specific knowledge of the programming language for examine the particular software testing output.

Answer:

    The White Box test is a software test in which the developer has access to the source code, knowing the internal structure of the product. Being analyzed and allowing the choice of specific parts of a component to be evaluated, allowing a precise search of the behavior of the structure.

    The white box test levels are Unit Tests and Static Test.

In Java, write a program that asks a user for the total cost of a purchase and calculates the tax and the total purchase price. Make sure to write out the cost of the purchase, the tax, and the total purchase price formatted to two decimal places using the NumberFormat class.

Answers

Answer:

646i01

Explanation:

Beause this number use 10

Which device makes computers that are connected to separate segments appear and behave as if they're on the same segment? (Please choose from one of the four options below)

Bridge

Hub

Router

Switch

Answers

Answer: Switch

Explanation:

 The switch is the device that is basically use for the connection for separate segment that basically appear in the similar segment in the computer network.

Switch is the ethernet that is based on the  LAN peruses approaching TCP/IP information packets containing goal data as they go into at least one info ports. The goal data in the bundles is utilized to figure out which yield ports that will be utilized to sending the information on to its proposed goal.

Therefore, Switch is the correct options.

 

Briefly tell me what a POST request does

Answers

Answer: POST request is the concept used in world wide web(www) for the working of HTTP (hyper text transfer protocol) .It is required for sending the data to the web servers by requesting through request messages.

The functions performed by POST are uploading of file, storing file ,providing information,updating information,filling web form etc,. POST is a type of request method which also contains content as body..

controls to keep password sniffing attacks from compromising computer systems include which of the following?

a.Static and recurring passwords

b.Encryption and recurring passwords

c.One-time passwords and encryption

d.Static and one-time passwords

Answers

Answer:

the answer is b your welcome

Prove the following theorems using truth table (a) X + XY = X (b) X + YZ = (X + Y)(X + Z)

Answers

Answer:

I attached you the answer in the picture

Explanation:

First, let's see the relationship between the logic gates and truth tables:

The operation of logic gates in relation to one another may be represented and analyzed using a branch of mathematics called Boolean Algebra which, like the common algebra, deals with manipulation of expressions to solve or simplify equations. Expressions used in Boolean Algebra are called, well, Boolean expressions.

AND Gate:

The AND gate is a logic gate that gives an output of '1' only when all of its inputs are '1'.  Thus, its output is '0' whenever at least one of its inputs is '0'. Mathematically, A∧B = A · B.

OR Gate:

The OR gate is a logic gate that gives an output of '0' only when all of its inputs are '0'. Thus, its output is '1' whenever at least one of its inputs is '1'. Mathematically, A∨B = A + B.

Having this in mind, we just need to use basic Mathematical Logic operations

in 2015, what percent of Internet users will access the web through mobile devices?

Answers

Answer:

52.7 percent.

Explanation:

In 2015 52.7 percent of the internet users accessed the internet from their mobile phones.

This number has kept on increasing throughout the years and it will keep on increasing because of the lucrative offers provided by the telecom service providers on the internet data packs and the revolution in India brought by Reliance Jio in 2016 because of which the rates of the data packs declined very sharply and also by every telecom service provider because of reliance Jio.

.An algorithm specifies the actions to be executed.

True

False

Answers

Answer:

True.

Explanation:

An algorithm for a problem provides the set of instructions that are required to solve a problem.It does not provide the full code.It is like an abstract solution of a problem.It is just like a recipe for cooking a dish.It will not cook food for you but can tell you how to cook.

Since it provides the action to be executed hence the answer is True.

Answer:

true

Explanation:

Why do small incremental code changes in software have to do with testing?

Answers

Answer:

It is method where the product is designed, implemented and tested incrementally until the product is finished.

Explanation:

Small incremental codes are used to find the errors or bugs in the program coding or in the development of software. The whole process of incremental codes in software testing is categorized in smaller chunks, and the process is executed in steps of design, requirement, and implementation. If an error occurs in each step of the testing phase, it will be detected. This process is economical and easy to use due to smaller chunks.

Discuss operations of vectors in computer graphics?

Answers

Answer:

  In the computer graphics, the vectors are basically used to compose various type of components. In the computer graphics it is basically known as vector graphics and it is composed of various types of components.

The operation of the vector in the computer vector is that it is basically used to create the digital images by the use of mathematical statement and command.

It is used to place the lines and the shape in the two- dimension and three- dimension spaces. IN the computer graphics, vectors are also used to represent the particular direction of the various objects.

The ____________ is a very popular form of logic used to update a sequential file when three different types of transactions are present.

(Points : 2) match and delete rule
balance line algorithm
bilateral update algorithm
simplex sequential file rule

Answers

Answer: Simplex sequential file rule

Explanation:

 The simplex sequential file rule is basically used to updated the given records in the form of order sequential file. It basically create new file which contain records that are already updated.

It contain three types of the transactions that is add, delete and change to updated the records in the sequential file. In the simplex sequential file, the transaction file records are same as the records in the master file.

On the other hand, all the given other options are incorrect because it does not involve in the transaction process.

Therefore, simplex sequential file rule  option is correct.  

Write an application that calculates and displays the weekly salary for an employee. The main() method prompts the user for hourly pay rate, regular hours, and overtime hours. Create a separate method to calculate overtime pay, which is regular hours times the pay rate plus overtime hours time 1.5 times rate; return the result to the main() method to be displayed

Answers

Answer:

// here is program in java.

// import package

import java.util.*;

// class definition

class Main

{

   // method to calculate weekly salary

   public static double fun(int h_p_r,int r_h,int o_h)

   {

       // calculate weekly salary

       double weekly_salary=(h_p_r*r_h)+(o_h*h_p_r*1.5);

       // return salary

       return weekly_salary;

   }

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read value from user

    Scanner scr=new Scanner(System.in);

    // ask to enter hourly pay rate

       System.out.print("enter hourly pay rate: ");

       // read hourly pay rate

       int hourly_pay_rate=scr.nextInt();

       // ask to enter regular hours

       System.out.print("enter regular hours: ");

       //read regular hours

       int regular_hours=scr.nextInt();

       // ask to enter overtime hours

       System.out.print("enter overtime hours : ");

       // read overtime hours

       int overtime_hours=scr.nextInt();

       // call the method

       System.out.println("weekly salary of an employee :"+fun(hourly_pay_rate,regular_hours,overtime_hours));

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read hourly pay rate, regular hours and overtime hours from user.Call the method fun() with these parameters.There weekly salary is calculated by multiply regular hours with hourly_pay_rate and overtime hours with 1.5 time of hourly_pay_rate.Sum both of them, this will be the weekly salary.return this to main method and print it.

Output:

enter hourly pay rate: 20

enter regular hours: 40

enter overtime hours : 10

weekly salary of an employee :1100.0

Which is the last line of defense in a physical security sense?

A. People

B. Interior barriers

C. Exterior barriers

D. Perimeter barriers

Answers

Answer: (A) People

Explanation:

 The physical security system is the basically used in the information system. It is used in the technical and the administrator element in the security system. This is the technology oriented system that is basically used to prevent from the hacking attacks in the system.

So, the people is the last statement of the defense in the physical security as the various security system is basically used by various people.

The network administrator is often involved in selecting and implementing network security measures such as firewalls and access codes.
True
False

Answers

Answer: True

Explanation:

 Yes, the given statement is true that the network administrator are basically involve in the select and implement the various network security measures like the access code and firewall.

The network administrator is basically responsible for managing, implementing and troubleshooting the LAN areas that is local area network in the organization. The network administrator is the technology which is widely used now a days for efficient development. It is also interface with the internet and wide area networks (WAN).

Write a program that continues to read positive integer values until user enters a negative value. The program should print average of entered values, maximum value and minimum value

Answers

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

int main()

{

// variable

   int n;

   int mi=INT_MAX;

   int mx=INT_MIN;

   double avg;

   int count=0;

   double sum=0;

   cout<<"enter a positive integer(Negative number to stop):";

   // read the input first time

   cin>>n;

   // read the input until user enter a negative number

   while(n>=0)

   {

   // calculate minimum

       if(n<mi)

       mi=n;

       // calculate maximum

       if(n>mx)

       mx=n;

       // count of entered numbers

       count++;

       // total sum of all number

       sum=sum+n;

       cout<<"enter a positive integer(Negative number to stop):";

       // read the input again

       cin>>n;

   }

   // calculate the average

   avg=sum/count;

   // print the average

   cout<<"average of "<<count<<" number is:"<<avg<<endl;

   // print the maximum

   cout<<"maximum of all number is:"<<mx<<endl;

   // print the minimum

   cout<<"minimum of all number is:"<<mi<<endl;

return 0;

}

Explanation:

Declare and initialize "mi" with maximum integer value.Similarly "mx" with minimum integer value.Read user input until user enter a negative number.Add all the number to variable "sum" and keep count of positive number entered with "count".When user enter a negative number then it will stop taking input and calculate average of all number by dividing sum with count. Also it will check for each and find the maximum and minimum among the all input.

Output:

enter a positive integer(Negative number to stop):23

enter a positive integer(Negative number to stop):10

enter a positive integer(Negative number to stop):34

enter a positive integer(Negative number to stop):22

enter a positive integer(Negative number to stop):5

enter a positive integer(Negative number to stop):-2

average of 5 number is:18.8

maximum of all number is:34

minimum of all number is:5

. Convert 2AF from hexadecimal to binary. Show your work.

Answers

Answer:

The answer is 2AF₁₆ = 687₁₀ =  1010101111₂.

Explanation:

To convert from hexadecimal base system to binary base system, first you can do an intermediate conversion from hexadecimal to decimal using this formula:

[tex]N = x_1 * 16^0 + x_2 * 16^1 + x_3 * 16^2 + x_4 * 16^3+ ... + x_n 16^n^-^1[/tex]

, where position of the x₁ is the rightmost digit of the number and:

A = 10.B = 11.C = 12.D = 13.E = 14.F = 15.

2AF₁₆ = 2*16²+A*16¹+F*16⁰ = 512 + 160 + 15 = 687₁₀

Now, transform from decimal to binary the number 687. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to 0:

687 ÷ 2 = 343 + 1;343 ÷ 2 = 171 + 1;171 ÷ 2 = 85 + 1;85 ÷ 2 = 42 + 1;42 ÷ 2 = 21 + 0;21 ÷ 2 = 10 + 1;10 ÷ 2 = 5 + 0;5 ÷ 2 = 2 + 1;2 ÷ 2 = 1 + 0;1 ÷ 2 = 0 + 1;

Now, construct the integer part base 2 representation, by taking the remainders starting from the bottom of the list:

687₁₀ =  1010101111₂

The basic building block of a system is the _____. (Points : 6) object
attribute
message
partition
method

Answers

Answer: Object

Explanation: Object is a major part of a system that has the relevance with the real world entities.The objects are used in the object-oriented approach in the operating system for the development and maintenance of it.

It is the component that comprises of the two major factors-code and data. The code and data are for the determination of the behavior and the status of the object respectively. Other options are incorrect because they don't operate as the building block for a system.

Write a program with the following output: ( Notice the beeline and space). Hello world! Hello

Answers

Answer:

#include <iostream>

using namespace std;

int main() {

cout<<"Hello world! Hello";//statement to print the statement.

return 0;

}

Explanation:

The above written program is in C++.In C++ cout is used to print ouput on the screen and it is called standard output.So to print Hello world! Hello you have to code

cout << "Hello world! Hello";

This will print the statement.

Answer:

Hello!

Explanation:

Other Questions
The chemical formula for sucrose (also known as table sugar) is C12H22011. How many carbon atoms are in 1 molecule of sucrose? O a. 22 O b. 13 Oc. 12 O d. 11 Oe. 72 Describe a real world situation that can be represented by the quotient -85\15. Find the amount to which $550 will grow under each of the following conditions. Do not round intermediate calculations. Round your answers to the nearest cent. (A) 9% compounded annually for 5 years. (B) 9% compounded semiannually for 5 years. (C) 9% compounded quarterly for 5 years. (D) 9% compounded monthly for 5 years. A computer monitor accelerates electrons and directs them to the screen in order to create an image. If the accelerating plates are 1.45 cm apart, and have a potential difference of 2.50 x 10^4 V , what is the magnitude of the uniform electric field between them? Vectors HaveA.magnitude only.B.magnitude and direction.C.direction.D.neither magnitude nor direction. What is the domain of the function y=2.X-6?E OFO O 05x Tatoo Inc. reported a net capital loss of $13,500 in 2018. The company had a net capital gain of $4,800 in 2016 and $3,500 in 2015. In 2017, although the company suffered a net operating loss, it had net capital gains of $1,500. What is the amount of Tatoo's capital loss carryover remaining after it applies the carryback? A certain reaction X + Y Z is described as being first order in [X] and third order overall. Which of the following statements is or are true?: The rate law for the reaction is: Rate = k[X][Y]2. If the concentration of X is increased by a factor of 1.5, the rate will increase by a factor of 2.25. If the concentration of Y is increased by a factor of 1.5, the rate will increase by a factor of 2.25. Ud. abre la puerta cada maana. (abrir)The verb is conjugated correctly.The verb is not conjugated correctly. Need help with question 9 What historical reality is represented in this fictional paragraph? the strictness of parents in the mid-1900s the types of technology popular in the mid-1900s the violence of comic heroes in the mid-1900s the challenges of education in the mid-1900s Describe how the branches on a cladogram show the relationships among organisms. A basketball team practices their shooting. The function f(x) represents the number of baskets made during practice, where x is the number of players at the practice. Does a possible solution of (12, 36) make sense for this function? Explain your answer. What term describes the ability of an animal to know the meaning of the signals it sends and receives?behaviorinstinctcommunicationcognition A man is paid $9.60 per hour for a 40 hour week and he is paid at a time and a half for overtime he worked when his wage for a certain week was $528.00. A suitcase is a rectangular prism whose dimensions are 1 3/4 feet by 1 3/4 feet by 2 1/4 feet. Find the volume of the suitcase. Enter the answer as a mixed number in simplest form. A survey of 525 adults aged 18-24 year olds was conducted in which they were asked what they did last Friday night. It found:166 hung out with friends152 ate pizza26 watched TV and ate pizza, but did not hang out with friends50 watched TV and hung out with friends, but did not eat pizza32 hung out with friends and ate pizza, but did not watch TV25 watched TV, hung out with friends, and ate pizza96 did not do any of these three activitiesHow may 18-24 year olds (of these three activities) only watched TV last Friday night? Explain how a genetic map (in map units) is related to actual physical distance (in base pairs of DNA). If an isotope of an element has 40 neutrons and a mass number of 79, how many electrons must it have? Low-level languages allow programmers to concentrate on the tasks they want to perform with their program rather than the details of how the CPU will execute those programs. True False