Define what is the difference between console and window application?

1 Answer

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.

Related questions

Description : Write a hello world console application. 

Last Answer : using System; namespace Console1 { class Class1 { [STAThread] // No longer needed static void Main(string[] args) { Console.WriteLine("Hello world"); } } }

Description : Give examples of hex, currency, and fixed point console formatting.

Last Answer : Console.Write("{0:X}", 250);  FA Console.Write("{0:C}", 2.5);  $2.50 Console.Write("{0:F2}", 25);  25.00

Description : How would you read and write using the console?

Last Answer : Console.Write, Console.WriteLine, Console.Readline 

Description : When would you use the Watch window? 

Last Answer : You would use the Watch window to observe the values of application variables while in Break mode.

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 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 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 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 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 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 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 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 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 difference between static and instance methods?

Last Answer : A method declared with a static modifier is a static method. A static method does not operate on a specific instance and can only access static members. A method declared without a static modifier is an ... can be explicitly accessed as this. It is an error to refer to this in a static method.

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 : Define what is the difference between value type and reference type?

Last Answer : 1. Value types are stored on the stack and when a value of a variable is assigned to another variable. 2. Reference types are stored on the heap, and when an assignment between two reference variables occurs.

Description : Define what is the difference between Custom Control and User Control?

Last Answer : Custom Controls have compiled the code (DLLs), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be ... the toolbox and dragged - dropped from it. A User Control is shared among the single application files.

Description : Define what is the difference between string keyword and System. String class?

Last Answer : String keyword is an alias for System. String class. Therefore, the System. String and string keyword are the same, and you can use whichever naming convention you prefer. The String class provides many methods for safely creating, manipulating, and comparing strings.

Description : Define what is the difference between constants, readonly and, static?

Last Answer : 1. Constants: The value can’t be changed. 2. Read-only: The value will be initialized only once from the constructor of the class. 3. Static: Value can be initialized once.

Description : Define what is the difference between Class And Interface?

Last Answer : Class is a logical representation of an object. It is a collection of data and related sub procedures with a definition. The interface is also a class containing methods which are not having any definitions. Class does not support multiple inheritances. But interface can support.

Description : Define what are the difference between Structure and Class?

Last Answer : 1. Structures are value type and Classes are a reference type 2. Structures can not have contractors or destructors. 3. Classes can have both contractors and destructors. 4. Structures do not support Inheritance, while Classes support Inheritance.

Description : Define what is the difference between “out” and “ref” parameters in C#?

Last Answer : “out” parameter can be passed to a method and it need not be initialized whereas “ref” parameter has to be initialized before it is used.

Description : Define what is the difference between “throw ex” and “throw” methods in C#?

Last Answer : “throw ex” will replace the stack trace of the exception with stack trace info of rethrowing point. “throw” will preserve the original stack trace info.

Description : Define what is the difference between “finalize” and “finally” methods in C#?

Last Answer : Finalize – This method is used for garbage collection. So before destroying an object, this method is called as part of the cleanup activity. Finally – This method is used for executing the code irrespective of exception occurred or not.

Description : Define what is the difference between “dispose of” and “finalize” variables in C#?

Last Answer : Dispose of - This method uses interface - IDisposable interface and it will free up both managed and unmanaged codes like - database connection, files, etc. Finalize - This method is called internally ... called explicitly. It is called by the garbage collector and can't be called from the code.

Description : Define what is the difference between “constant” and “read-only” variables in C#?

Last Answer : Const keyword is used for making an entity constant. We cannot modify the value later in the code. Value assigning is mandatory to constant variables. read-only variable value can be changed ... and value to read-only variables can be assigned in the constructor or at the time of declaration.

Description : How would you ensure that all relevant registry entries were removed in the event that installation of your application failed?

Last Answer : You can ensure that registry entries are removed, as well as perform any other “clean-up” tasks, by creating an Installer class and writing the appropriate code in the Rollback event handler. Then create a new Custom Action and set the InstallerClass, and EntryPoint properties to appropriate values.

Description : What is the purpose of a bootstrapper application? When do you not need to create one?

Last Answer : A bootstrapper application automatically detects if Windows Installer is installed on the target machine. If Windows Installer is not present, it installs Windows Installer before proceeding with the rest ... Installer 1.5 already installed) or have had Microsoft Installer 1.5 installed previously.

Description : What is meant by a SQL injection attack? How can you prevent them from occurring in your application? 

Last Answer : SQL injection attacks occur when a malicious user attempts to execute SQL code by passing a SQL string to the application through user input. You can guard against SQL injection attacks by validating the format of all strings derived from user input that are used to form ad hoc SQL statements.

Description : How do you enable your application to use .NET base class library members without referencing their fully qualified names?

Last Answer : Use the Imports keyword (Visual Basic .NET) or the using keyword (Visual C#) to make a .NET Framework namespace visible to your application. 

Description : How can you tell the application to look for assemblies at the locations other than its own install ?

Last Answer : Answer: Use the directive in the XML .config file for a given application.

Description : What is an application domain ?

Last Answer : An application domain (often AppDomain) is a virtual process that serves to isolate an application. All objects created within the same application scope (in other words, anywhere along the sequence ... (the runtime cannot guarantee isolation when unsafe code is loaded in an application domain).  

Description : What namespaces are necessary to create a localized application? 

Last Answer : System.Globalization and System.Resources.

Description : Can you change the value of a variable while debugging a C# application? 

Last Answer : Yes. If you are debugging via Visual Studio.NET, just go to Immediate window. 

Description : How do you debug an ASP.NET Web application?

Last Answer : Attach the aspnet_wp.exe process to the DbgClr debugger. 

Description : Explain the three services model commonly know as a three-tier application.

Last Answer : Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).

Description : What namespaces are necessary to create a localized application?

Last Answer : System.Globalization and System.Resources. 

Description : Can you change the value of a variable while debugging a C# application? 

Last Answer : Yes. If you are debugging via Visual Studio.NET, just go to Immediate window. 

Description : How do you debug an ASP.NET Web application?

Last Answer : Attach the aspnet_wp.exe process to the DbgClr debugger.

Description : Explain the three services model commonly know as a three-tier application.

Last Answer : Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources). 

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 : 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 : What does the Initial Catalog parameter define in the connection string?

Last Answer : The database name to connect to.

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 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.