Anda di halaman 1dari 7

Can we call a base class method without creating instance? Describe the difference between a Thread and a Process?

Difference between EXE and DLL? Explain about session? Where it runs & what are different types of Explain Active X Explain Session In which cases you use override and new base? Value type & reference types difference? Example from .NET. Integer & What are the OOPS concepts? What is Active-X control? What is COM? What is Inheritance, Multiple Inheritance, Shared and Repeatable What is Method overloading? What is Method Overriding? How to override a function in C#? what is runnable interface? What is the difference between a Struct and a Class? What is the use of a form in html page? Is there any way to submit You have one base class virtual function how will call that function 1What are the concepts of oops?

Encapsulation: It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data. Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors. Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact nature of the situation. In general polymorphism means one interface, multiple methods, This means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compilers job to select the specific action (that is, method) as it applies to each situation.

2)Can we call a base class method without creating instance?


Its possible If its a static method. Its possible by inheriting from that class also. Its possible from derived classes using base keyword.

3)Describe the difference between a Thread and a Process?


The basic difference between process and thread is every process have its own data memory location but all related threads can share same data memory and have their own individual stacks. Thread is a light weighted process,collection of threads become process.

4)Difference between EXE and DLL?


An ActiveX Dll runs is an in process server running in the same memory space as the client process.An ActiveX Exe is an out of process server which runs in its own separate memory space. Advantages of ActiveX Dll 1) An in-process component shares its clients address space, so property and method calls dont have to be marshaled. This results in much faster performance. Disadvantages of ActiveX Dll If an unhandled error occurs it will cause the client process to stop operating. Advantages of ActiveX Exe -1) The component can run as a standalone desktop application, like Microsoft Excel or Microsoft Word, in addition to providing objects. 2) The component can process requests on an independent thread of execution, notifying the client of task completion using events or asynchronous call-backs. This frees the client to respond to the user. 3)If an error occurs the client processes can continue to operate. Disadvantages of ActiveX Exe 1) Generally slower than an ActiveX dll alternative.

5)Explain about session? Where it runs & what are different types of ?
HTTP is a protocol which does not maintain the state of the client. It is state-less protocol, to make the protocol stateful we need to provide the session handling mechanism. This will be provided as per the need of the Application.The basic categories are 4 ways: 1. Using Cookies 2. Using Session API in Servlets 3. Using Hidden form fields 4. URL Rewriting. The best one is using Session objects with help of Session API. Cookies are harmful because they are allowed to store on to the client machine. This way you can send a virus file

as cookie So normally the System Admin disables them to protect their network. The session API allows us to create SessionID and set for the client. per Client you can have one session object which will run in the Server 6)Explain Active X ? ActiveX is the name Microsoft has given to a set of strategic object-oriented programming technologies and tools. The main technology is the Component Object Model (COM). Used in a network with a directory and additional support, COM becomes the Distributed Component Object Model (DCOM). The main thing that you create when writing a program to run in the ActiveX environment is a component, a self-sufficient program that can be run anywhere in your ActiveX network (currently a network consisting of Windows and Macintosh systems). This component is known as an ActiveX control. ActiveX is Microsofts answer to the Java technology from Sun Microsystems. An ActiveX control is roughly equivalent to a Java applet. If you have a Windows operating system on your personal computer, you may notice a number of Windows files with the OCX file name suffix. OCX stands for Object Linking and Embedding control. Object Linking and Embedding (OLE) was Microsofts program technology for supporting compound documents such as the Windows desktop. The Component Object Model now takes in OLE as part of a larger concept. Microsoft now uses the term ActiveX control instead of OCX for the component object. One of the main advantages of a component is that it can be re-used by many applications (referred to as component containers). A COM component object (ActiveX control) can be created using one of several languages or development tools, including C++ and Visual Basic, or PowerBuilder, or with scripting tools such as VBScript. Currently, ActiveX controls run in Windows 95/98/NT/2000 and in Macintosh. Microsoft plans to support ActiveX controls for Unix.

7)Explain Session ?
One of the challenges to developing a successful Web application is maintaining user information over the course of a visit, or session, as the user moves from page to page in an application. Essentially, a session is the period of time that a unique user interacts with a Web application. HTTP is a stateless protocol, in the sense that a Web server is concerned only with the current HTTP request for

any given Web page. The server retains no knowledge of previous requests, even if these occurred only prior to the current request. This inability to remember the state of previous requests presents unique challenges when writing Web applications such as an online shopping cart, that need to track the catalog items a user has selected while moving around the various pages of the catalog. ASP.NET provides a solution for managing session information via the System.Web.SessionState namespace. This namespace describes a collection of classes used to enable storage of data specific to a single client within a Web application. The session-state data is used to give the client the appearance of a persistent connection with the application. Using the intrinsic ASP.NET Session object and a special user ID generated by the Web server, developers can create smart applications that can identify each user and collect information that an application can then use to track user preferences or selections.

8)In which cases you use override and new base?


Use the new modifier to explicitly hide a member inherited from a base class. To hide an inherited member, declare it in the derived class using the same name, and modify it with the new modifier.

9)You have one base class virtual function how will call that function ?
class a { public virtual int m() { return 1; } } class b:a { public int j() { return m(); } }

10)Value type & reference types difference? Example from .NET. Integer & .?
Most programming languages provide built-in data types, such as integers and floating-point numbers, that are copied when they are passed as arguments (that is, they are passed

by value). In the .NET Framework, these are called value types. The runtime supports two kinds of value types: Built-in value types The .NET Framework defines built-in value types, such as System.Int32 and System.Boolean, which correspond and are identical to primitive data types used by programming languages. User-defined value types Your language will provide ways to define your own value types, which derive from System.ValueType. If you want to define a type representing a value that is small, such as a complex number (using two floatingpoint numbers), you might choose to define it as a value type because you can pass the value type efficiently by value. If the type you are defining would be more efficiently passed by reference, you should define it as a class instead. Variables of reference types, referred to as objects, store references to the actual data. This following are the reference types: - class - interface - delegate This following are the built-in reference types: - object - string

11)What is Inheritance, Multiple Inheritance, Shared and Repeatable


Inheritence is defined as the mechanism of deriving a new class from an already existing class.The class from which new class derived is called parent or bae class and the derived one is called derived class.The new derived class will have the characteristics of its own and the base class.The main purpose of using inhertence concept is that nothing but the reusability of code.Muliple inheritence means deriving a new class from one or more base class. Multiple Inheritance brings up the possibility for a class to appear as a parent more than once in a class graph (repeated inheritance), and there is then a potential to share that class. Only one instance of the class will then appear in the graph (as is always the case in CLOS, because all *members* with the same name will be shared (receive a single slot) with the greatest common subtype as its type). C++ provides an alternative, where only parents specified as virtual (virtual bases) are shared within the same class lattice, allowing both shared and non-shared occurrences of a parent to

coexist. All features in Eiffel (C++ members) of a repeated parent that are not to be shared must be renamed along an inheritance path, else they are shared by default. This allows a finer granularity of control and consistent name resolution but requires more work for parents with many features. 12)What is Method overloading? Method overloading occurs when a class contains two methods with the same name, but differentsignatures.

13)What is Active-X control?


A control using ActiveX technologies. An ActiveX control can be automatically downloaded and executed by a Web browser. ActiveX is not a programming language, but rather a set of rules for how applications should share information. Programmers can develop ActiveX controls in a variety of languages, including C, C++, Visual Basic, and Java. An ActiveX control is similar to a Java applet. Unlike Java applets, however, ActiveX controls have full access to the Windows operating system. This gives them much more power than Java applets, but with this power comes a certain risk that the applet may damage software or data on your machine. To control this risk, Microsoft developed a registration system so that browsers can identify and authenticate an ActiveX control before downloading it. Another difference between Java applets and ActiveX controls is that Java applets can be written to run on all platforms, whereas ActiveX controls are currently limited to Windows environments. Related to ActiveX is a scripting language called VBScript that enables Web authors to embed interactive elements in HTML documents.

14)What is COM?
A software architecture developed by Microsoft to build component-based applications. COM objects are discrete components, each with a unique identity, which expose interfaces that allow applications and other components to access their features. COM objects are more versatile than Win32 DLLs because they are completely language-independent, have built-in interprocess communications capability, and easily fit into an object-oriented program design. COM was first released in 1993 with OLE2, largely to replace the interprocess communication mechanism DDE used by the initial release of OLE. ActiveX also is based on COM.

15)What is the use of a form in html page? Is there any way to submit ?
In html we can use JAVASCRIPT for validation purpose. Since we require a specific form name for validation and to specicy the action after certain operation is performed

16)what is runnable interface?


runnable interface is implemented when thread is use. it is needed to start thread

17)what is Method Overriding? How to override a function in C#?


Use the override modifier to modify a method, a property, an indexer, or an event. An override method provides a new implementation of a member inherited from a base class. The method overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method. You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override. 18)What is the difference between a Struct and a Class? The struct type is suitable for representing lightweight objects such as Point, Rectangle, and Color. Although it is possible to represent a point as a class, a struct is more efficient in some scenarios. For example, if you declare an array of 1000 Point objects, you will allocate additional memory for referencing each object. In this case, the struct is less expensive. - When you create a struct object using the new operator, it gets created and the appropriate constructor is called. Unlike classes, structs can be instantiated without using the new operator. If you do not use new, the fields will remain unassigned and the object cannot be used until all of the fields are initialized. - It is an error to declare a default (parameterless) constructor for a struct. A default constructor is always provided to initialize the struct members to their default values. - It is an error to initialize an instance field in a struct. - There is no inheritance for structs as there is for classes. A struct cannot inherit from another struct or class, and it cannot be the base of a class. Structs, however, inherit from the base class Object. A struct can implement interfaces, and it does that exactly as classes do. - A struct is a value type, while a class is a reference type.

Anda mungkin juga menyukai