answersLogoWhite

0


Best Answer

No. That is only true in procedural languages. Although it is permitted to use goto statements in structured and object oriented languages, its usage is limited to local scope only, which reduces the "spaghetti code" that was prevalent in all procedural languages, and still is in low-level assembler and machine code.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is it true that the only way to transfer control from one place in the program to another in OOP is by using goto statement?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Explain goto and return in c?

A return statement is used to transfer the program control flow to the function that has called the current function under execution. If the function is main, then the program returns the control flow to the operating system. The syntax for return statement is:return return-type;A goto statement is used to transfer the control flow to a particular labelled statement, not necessarily back to the calling program. There are somerestrictionson using a goto statement. For eg: the goto statement should not skip any variable declarations. The use of goto statement is usually considered as a bad programming practice. The syntax for goto statement is:goto label_name;....label_name: statements;


What are the various control statement in C language?

Control statements are the statements that control the flow of program execution. For eg: loops: For, While, Do-While, decision making using if-then-else or switch-case and there's goto to transfer control.


What are break and continue statement in c language?

Break is used to exit the closest loop. Continue will cause the program to go to the beginning of the loop. for(int x=0;x<10;x++) { //continue; for(int y=0;y<10;y++) { break; } } The break statement causes the inner loop to stop at the first iteration. If the continue statement was uncommented, the inner loop would never be executed because the program would jump back to the beginning(until x = 10 of course).


What statement can be used to transfer control back to the main program after the execution of a subroutine?

It depends what language you are using. Structured languages provide the easiest method, simply call the function containing your subroutine and control will automatically return to the point of the call when the function ends. You can even use functions to return a value to the caller. If functions are not an option, the language might provide a gosub statement. This is similar to a goto statement but returns control to the caller, much like a function would in a structured language.


What is return means in programming?

A return statement exits the function in which it is declared and gives control to the calling code. Returning from the main function exits the program and gives control to the execution environment.

Related questions

Explain goto and return in c?

A return statement is used to transfer the program control flow to the function that has called the current function under execution. If the function is main, then the program returns the control flow to the operating system. The syntax for return statement is:return return-type;A goto statement is used to transfer the control flow to a particular labelled statement, not necessarily back to the calling program. There are somerestrictionson using a goto statement. For eg: the goto statement should not skip any variable declarations. The use of goto statement is usually considered as a bad programming practice. The syntax for goto statement is:goto label_name;....label_name: statements;


What are the various control statement in C language?

Control statements are the statements that control the flow of program execution. For eg: loops: For, While, Do-While, decision making using if-then-else or switch-case and there's goto to transfer control.


A control break occurs when a program?

passes logical control to a module contained within another program


Is there a way to transfer my asiamiles to another program?

yeah but if your asking your too stupid


What are break and continue statement in c language?

Break is used to exit the closest loop. Continue will cause the program to go to the beginning of the loop. for(int x=0;x<10;x++) { //continue; for(int y=0;y<10;y++) { break; } } The break statement causes the inner loop to stop at the first iteration. If the continue statement was uncommented, the inner loop would never be executed because the program would jump back to the beginning(until x = 10 of course).


How Do you Program a Sharp Aquos remote control to control a Sony tv?

Sharp Aquos is a brand of TV. You can't program it to control another brand of TV.


What statement can be used to transfer control back to the main program after the execution of a subroutine?

It depends what language you are using. Structured languages provide the easiest method, simply call the function containing your subroutine and control will automatically return to the point of the call when the function ends. You can even use functions to return a value to the caller. If functions are not an option, the language might provide a gosub statement. This is similar to a goto statement but returns control to the caller, much like a function would in a structured language.


Will a router transfer virus to the other computer?

It will, if you (or the virus) tells it to. However, even if a virus is transferred to another computer it will not run on that computer unless you or another program executes it, or unless the virus is able to exploit some security vulnerability in another program in order to run. A router will not transfer viruses to another computer on its own.


What are subroutine linkages?

The Mechanism that makes possible to transfer control between the calling program and Subroutine is reffered to as SUBROUTINE LINKAGE


How do I cancel balance on my iTunes account?

Once money is put in you cannot remove it or transfer it to another program.


I have a Quicken program on Windows 98 that I need to transfer to another computer. What's the best way to do it?

Run the installer for the Quicken program on the other computer.


What is return means in programming?

A return statement exits the function in which it is declared and gives control to the calling code. Returning from the main function exits the program and gives control to the execution environment.