Define what is the use of a goto statement?

1 Answer

Answer :

The goto statement is also included in the C# language. This goto can be used to jump from inside a loop to outside. But jumping from outside to inside a loop is not allowed.

Related questions

Description : Describe Jump statements: break, continue, and goto. 

Last Answer : Break terminates a loop or switch. Continue jumps to the next iteration of an enclosing iteration statement. Goto jumps to a labelled statement.

Description : Define what is the use of the return statement?

Last Answer : The return statement is associated with procedures (methods or functions). On executing the return statement, the system passes the control from the called procedure to the calling procedure. This ... the currently executed code to return some value to the caller of the currently executed code.

Description : Define what does a break statement do in switch statements?

Last Answer : The break statement terminates the loop in which it exists. It also changes the flow of the execution of a program. In switch statements, the break statement is used at the end of a case ... break statement is mandatory in C# and it avoids the fall through of one case statement to another.

Description : Define what is the difference between break and continue statement?

Last Answer : The break statement is used to terminate the current enclosing loop or conditional statements in which it appears. We have already used the break statement to come out of switch statements. The ... statement stops the current iteration and simply returns control back to the top of the loop.

Description : What is the difference between continue statement and goto statement ?

Last Answer : continue statement The continue statement is used to repeat a statement or loop conditionally or unconditionally . You can only jump to the top using the continue statement. can't work without continue statement if, ... . The goto statement can work directly without if, else if, for, while etc.

Description : In Goto statement the place to which control is transferred is identified by a statement so a. Label b. Display c. Break d. None of these

Last Answer : a. Label

Description : The statement is used to transfer the control to the end of statement block in a loop. a. Continue b. Break c. Switch d. Goto

Last Answer : b. Break

Description : Some of the situations where inline expansion may not work are: A) For functions returning values, if a loop, a switch or goto exists. B) If functions contain static variables and they are re-cursive. C) For functions not returning values, if return statement exist. D) All of the above.

Last Answer : D) All of the above.

Description : Write code to define and use your own custom attribute.

Last Answer : (From MSDN) // cs_attributes_retr.cs using System; [AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple=true)] public class Author : Attribute { public Author(string name) { this.name ... double version; string name; public string GetName() { return name; } }

Description : Define what is the main use of delegates in C#?

Last Answer : Delegates are mainly used to define call back methods.

Description : Define what is the use of the abstract keyword?

Last Answer : The modifier abstract is a keyword used with a class, to indicate that this class cannot itself have direct instances or objects, and it is intended to be only a ‘base’ class to other classes.

Description : What is purpose of Assembly Linker or define SDK Tool in .NET Framework?

Last Answer : Answer: In .NET whole the working should be with the helps of DLLs.So all of Visual Studio .Net compilers gernate assemblies or u can say dll.If we want to create an assembly with ... Studio .Net .This multi file can contain modules that are written in diffrenet langauage in one application.

Description : What does the Initial Catalog parameter define in the connection string?

Last Answer : The database name to connect to. 

Description : What does the Initial Catalog parameter define in the connection string?

Last Answer : The database name to connect to.

Description : Define what are the difference between const and readonly?

Last Answer : A const cannot be static, while readonly can be static. A const need to be declared and initialized at declaration only, while a readonly can be initialized at the declaration or by the code in the ... A const's value is evaluated at design time, while a read-only value is evaluated at runtime.

Description : Define what are the advantages of getting and set properties in C#?

Last Answer : 1. The get property accessor is used to return the property value. 2. The set property accessor is used to assign a new value.

Description : Define what is a New modifier?

Last Answer : The new modifier hides a member of the base class. C# supports only hide by signature.

Description : Define what is the Static Method?

Last Answer : It is possible to declare a method as Static provided that they don’t attempt to access any instance data or other instance methods.

Description : Define what is the difference between an abstract method & virtual method?

Last Answer : An Abstract method does not provide an implementation and forces overriding to the deriving class (unless the deriving class also an abstract class), whereas the virtual method has an ... abstract method does not provide implementation & forces the derived class to override the method.

Description : Define what is the difference between a class and an Interface?

Last Answer : 1. Abstract classes can have implementations for some of its members, but the interface can't have implementation for any of its members. 2. Interfaces cannot have fields whereas an ... 5. Abstract class members can have access modifiers whereas interface members cannot have access modifiers.

Description : Define what are sealed classes in c#?

Last Answer : The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class.

Description : Define what is the main difference between a sub procedure and a function?

Last Answer : Sub procedures do not return a value, while functions do.

Description : Define what is a basic difference between the while loop and do-while loop in C#?

Last Answer : The while loop tests its condition at the beginning, which means that the enclosed set of statements run for zero or more number of times if the condition evaluates to true. The do while loop iterates a set of statements at least once and then checks the condition at the end.

Description : Define what is the syntax to inherit from a class in C#?

Last Answer : When a class is derived from another class, then the members of the base class become the members of the derived class. The access modifier used while accessing members of the base class specifies ... syntax to inherit a class from another class In C# is as follows: class MyNewClass : MyBaseClass

Description : Define what is a static member?

Last Answer : The member defined as static which can be invoked directly from the class level, rather than from its instance.

Description : Define what Command is used to implement properties in C#?

Last Answer : get & set access modifiers are used to implement properties in c#.

Description : Define what is the difference between compile-time polymorphism and run-time polymorphism?

Last Answer : Compile time Polymorphism Compile time Polymorphism also known as method overloading. Method overloading means having two or more methods with the same name but with different signatures. Run time ... or more methods with the same name, same signature but with a different implementation.

Description : Define what are the different types of polymorphism?

Last Answer : There are two types of polymorphism. They are: Compile time Polymorphism Run time Polymorphism

Description : Define what is Generic?

Last Answer : 1. Generic help us to create flexible strong type collection. 2. Generic basically separate the logic from the datatype in order to maintain better reusability, better maintainability, etc.

Description : Define what are constructors and destructors?

Last Answer : Constructors and destructors are special methods. Constructors and destructors are special methods for every class. Each class has its own constructor and destructor and are called automatically when the ... access the class and the destructor destroys them when the objects are not required anymore.

Description : Define what is the difference between Shadowing and Overriding?

Last Answer : Overriding redefines only the implementation while shadowing redefines the whole element. In overriding derived classes can refer the parent class element by using “ME” keyword, but in shadowing you can access it by “MY BASE”.

Description : Define what is nested class?

Last Answer : Nested classes are classes within classes. A nested class is any class whose declaration occurs within the body of another class or interface.

Description : Define what is the main difference between a sub procedure and a function?

Last Answer : Sub procedures do not return a value, while functions do.

Description : Define what is meant by data encapsulation?

Last Answer : Data encapsulation also referred to as data hiding, is the mechanism whereby the implementation details of a class are kept hidden from the user. The user can only perform a restricted set of operations on the hidden members of the class by executing special functions called methods.

Description : Define what are the different types of literals in C#?

Last Answer : Boolean literals: True and False are literals of the Boolean type that map to the true and false state, respectively. Integer literals: Used to write values of types Int, uint, long, and ulong. Real ... by a double-quote character, such as © hello . The Null literal: Represents the null-type.

Description : Define what is an identifier?

Last Answer : Identifiers are nothing but names given to various entities uniquely identified in a program.

Description : Define what is an event?

Last Answer : An event is an action performed based on another method of the program. An event is a delegate type dass member that is used by an object or a class to provide a notification to other objects that an event has occurred. An event can be declared with the help of the event keyword.

Description : Define what are the different ways a method can be overloaded?

Last Answer : Different parameter data types, different number of parameters, different order of parameters.

Description : Define what is the difference between CONST and READONLY?

Last Answer : Both are meant for constant values. A const field can only be initialized at the declaration of the field. A read-only field can be initialized either at the declaration or.

Description : Define what is smart navigation?

Last Answer : The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

Description : Define what is a multicast delegate?

Last Answer : Each delegate object holds a reference to a single method. However, it is possible for a delegate object to hold references and invoke multiple methods. Such delegate objects are called multicast delegates or combinable delegates.

Description : Define what is the difference between Array and LinkedList?

Last Answer : The array is a simple sequence of numbers which are not concerned about each other’s positions. they are independent of each other’s positions. adding, removing or modifying any array element is very easy. Compared to arrays, a linked list is a complicated sequence of numbers.

Description : Define what is the difference between console and window application?

Last Answer : A console application, which is designed to run at the command line with no user interface. A Windows application, which is designed to run on a user’s desktop and has a user interface.

Description : Define what are the features of abstract class?

Last Answer : 1. An abstract class cannot be instantiated, and it is an error to use the new operator on an abstract class. 2. An abstract class is permitted (but not required) to contain abstract methods and accessors. 3. An abstract class cannot be scaled.

Description : Define what is a parameterized type?

Last Answer : A parameterized type is a type that is parameterized over another value or type.

Description : Define what is meant by operators in c#?

Last Answer : An operator is a member that defines the meaning of applying a particular expression operator to instances of a class. Three kinds of operators can be defined: unary operators, binary operators, and conversion operators. All operators must be declared as public and static.

Description : Define what are the special operators in C#?

Last Answer : C# supports the following special operators. is (relational operator) as (relational operator) type (tape operator) sizeof (size operator) new (object creator) .dot (member access operator) checked (overflow checking) unchecked (prevention of overflow checking)

Description : Define what is the difference between Array and ArrayList?

Last Answer : An array is a collection of the same type. The size of the array is fixed in its declaration. A linked list is similar to an array but it doesn’t have a limited size.

Description : Define what is the parameters?

Last Answer : Parameters are used to pass values or variable references to methods. The parameters of a method get their actual values from the arguments that are specified when the method is invoked. ... four kinds of parameters: value parameters, reference parameters, output parameters, and parameter arrays.

Description : Define what is meant by method overloading?

Last Answer : Method overloading permits multiple methods in the same class to have the same name as long as they have unique signatures. When compiling an invocation of an overloaded method, the compiler uses overload resolution to determine the specific method to invoke.