ASP में cookie बनाने के लिए किस command का उपयोग किया जाता है?
In ASP, which command is used to create a cookie?
ARequest.GetCookies
BRequest.Cookies
CResponse.Cookies
DResponse.GetCookies
सही उत्तर / Answer: (C)
हल / Solution
Cookie server बनाता है और response के साथ browser को भेजता है। इसलिए ASP में cookie Response object से बनती है, जैसे Response.Cookies("user") = "Ram"। इसके साथ Expires देकर उसकी अवधि भी तय की जा सकती है। Request.Cookies सिर्फ़ browser से लौटी cookie पढ़ता है, नई cookie नहीं बनाता। GetCookies नाम की कोई command ASP में नहीं होती। इसलिए सही उत्तर Response.Cookies है।
A cookie is created by the server and sent to the browser with the response. So in ASP a cookie is made with the Response object, for example Response.Cookies("user") = "Ram". Its lifetime can be set with the Expires property. Request.Cookies only reads a cookie that came back from the browser; it cannot create a new one. ASP has no command called GetCookies.
C# भाषा में ऐसे method जो बिना body और definition के, सिर्फ़ abstract keyword के साथ declare किए जाते हैं, क्या कहलाते हैं?
In C# language, what are the methods called that are declared only with the abstract keyword, without a body or definition?
AAbstract class
BAbstract method
CA और B दोनोंBoth A & B
Dइनमें से कोई नहींNone of these
सही उत्तर / Answer: (B)
हल / Solution
जिस method के आगे abstract लिखा हो और body न हो, उसे abstract method कहते हैं। जैसे public abstract void Draw(); इसमें curly braces नहीं होते, सीधे semicolon आता है। इसकी body derived class override करके देती है। Abstract class एक class है, method नहीं। वह इन methods को अपने अंदर रखती है, इसलिए विकल्प 1 ग़लत है। 'A और B दोनों' भी इसी कारण ग़लत है।
A method marked abstract and having no body is called an abstract method. For example, public abstract void Draw(); has no curly braces, only a semicolon. The derived class gives its body by overriding it. An abstract class is a class, not a method. It only holds such methods, so option 1 is wrong. For the same reason, Both A and B is also wrong.
ASP में cookie का मान पढ़ने के लिए किस command का उपयोग किया जाता है?
In ASP, which command is used to retrieve a cookie value?
ARequest.GetCookies
BRequest.Cookies
CResponse.Cookies
DResponse.GetCookies
सही उत्तर / Answer: (B)
हल / Solution
Cookie browser में रहती है और हर request के साथ server पर लौटती है। इसलिए उसे पढ़ने के लिए Request object लगता है, जैसे Request.Cookies("user")। Response.Cookies उलटा काम करता है; यह cookie बनाकर या बदलकर browser को भेजता है। Request.GetCookies और Response.GetCookies नाम की कोई command ASP में नहीं होती। इसलिए cookie का मान पढ़ने के लिए Request.Cookies सही है।
A cookie is stored in the browser and comes back to the server with every request. So it is read through the Request object, for example Request.Cookies("user"). Response.Cookies does the opposite job; it creates or changes a cookie and sends it to the browser. ASP has no command called Request.GetCookies or Response.GetCookies. So Request.Cookies is used to retrieve a cookie value.
C# भाषा में abstraction को किस keyword द्वारा declare किया जाता है?
By which keyword is abstraction declared in C# language?
AAbs
BAbstr
CAbstract
DAbstrac
सही उत्तर / Answer: (C)
हल / Solution
C# में abstract class और abstract method दोनों abstract keyword से बनते हैं। कोड में यह छोटे अक्षरों में लिखा जाता है, जैसे abstract class Shape या public abstract void Draw();। ऐसी class का object सीधे नहीं बनता और abstract method की body derived class देती है। Abs, Abstr और Abstrac अधूरे शब्द हैं। C# में इनमें से कोई keyword नहीं है, इसलिए लिखने पर compiler error देगा।
In C#, both abstract classes and abstract methods are declared with the abstract keyword. In code it is written in lowercase, for example abstract class Shape or public abstract void Draw();. You cannot create an object of such a class directly, and the derived class gives the body of an abstract method. Abs, Abstr and Abstrac are incomplete words. None of them is a C# keyword, so the compiler would report an error.
form से user की जानकारी पढ़ने के लिए प्रायः किस ASP object का उपयोग किया जाता है?
Which ASP object is often used to retrieve user information from forms?
AApplication objectThe Application object
BRequest objectThe Request object
CSession objectThe Session object
DResponse objectThe Response object
सही उत्तर / Answer: (B)
हल / Solution
जब user form भरकर submit करता है, तो उसका data browser से server पर आता है। ASP में यह data Request object से पढ़ा जाता है। POST method वाले form के लिए Request.Form("name") और GET के लिए Request.QueryString("name") लगता है। Response object उलटी दिशा में output भेजता है। Application और Session objects data सँभालकर रखते हैं, form का data नहीं पढ़ते। इसलिए उत्तर Request object है।
When a user fills in a form and submits it, the data travels from the browser to the server. In ASP this data is read with the Request object: Request.Form("name") for a POST form and Request.QueryString("name") for GET. The Response object works in the other direction and sends output. The Application and Session objects store data; they do not read form input.
C# भाषा में interface के द्वारा क्या प्राप्त (achieve) किया जाता है?
What is achieved through an interface in C# language?
AConstructor
BDestructor
CAbstraction
Dइनमें से सभीAll of these
सही उत्तर / Answer: (C)
हल / Solution
interface में methods के सिर्फ़ prototype लिखे जाते हैं, यानी नाम, parameter और return type। उनकी body वह class देती है जो interface को implement करती है। इस तरह user को पता रहता है कि क्या काम होगा, पर यह नहीं कि कैसे होगा। यही abstraction है। interface में constructor या destructor बनाया ही नहीं जा सकता, इसलिए विकल्प 1, 2 और 'इनमें से सभी' ग़लत हैं।
An interface contains only method prototypes, that is the name, parameters and return type. The class that implements the interface supplies the body. So the user knows what work will be done, but not how it is done. This is abstraction. An interface cannot have a constructor or a destructor at all, so options 1 and 2 are wrong, and All of these is wrong too.
server से user को output भेजने के लिए प्रायः किस ASP object का उपयोग किया जाता है?
Which ASP object is often used to send output to the user from the server?
AApplication objectThe Application object
BRequest objectThe Request object
CSession objectThe Session object
DResponse objectThe Response object
सही उत्तर / Answer: (D)
हल / Solution
ASP में Response object server से browser की ओर जाने वाला सब कुछ सँभालता है। Response.Write() से text भेजा जाता है, Response.Redirect() से user को दूसरे page पर भेजा जाता है, और Response.Cookies से cookie बनाई जाती है। Request object उलटी दिशा का काम करता है, यानी browser से आया data पढ़ता है। Application और Session objects data सँभालकर रखते हैं, output नहीं भेजते।
In ASP, the Response object handles everything that goes from the server to the browser. Response.Write() sends text, Response.Redirect() sends the user to another page, and Response.Cookies creates cookies. The Request object works in the other direction and reads data coming from the browser. The Application and Session objects store data; they do not send output. So the answer is the Response object.
C# में abstraction किसके द्वारा प्राप्त (achieve) किया जाता है?
How is abstraction achieved in C#?
Aabstract class के द्वाराBy using abstract class
Binterface के द्वाराBy using interface
Cconstructor के द्वाराBy using constructor
DA और B दोनोंBoth A & B
सही उत्तर / Answer: (D)
हल / Solution
C# में abstraction के दो साधन हैं: abstract class और interface। abstract class में abstract methods बिना body के होते हैं और derived class उन्हें override करती है। interface में methods के prototype होते हैं और class उन्हें implement करती है। दोनों में user को सिर्फ़ काम दिखता है, अंदर का तरीक़ा नहीं। इसलिए A और B दोनों सही हैं। Constructor का काम object बनाते समय data को शुरू करना है, abstraction नहीं।
C# has two tools for abstraction: the abstract class and the interface. In an abstract class, abstract methods have no body and the derived class overrides them. An interface holds method prototypes and a class implements them. In both cases the user sees only what is done, not how it is done. So both A and B are correct. A constructor only sets up data when an object is created; it does not give abstraction.
"time.inc" फ़ाइल को शामिल (include) करने का सही तरीका क्या है?
What is the correct way to include the file "time.inc"?
A<!--#include file="time.inc"-->
B<include file="time.inc">
C<% #include file="time.inc" %>
D<% include file="time.inc" %>
सही उत्तर / Answer: (A)
हल / Solution
ASP में किसी दूसरी फ़ाइल को page में जोड़ने के लिए Server Side Include (SSI) directive लगता है। इसका रूप HTML comment जैसा होता है: <!--#include file="time.inc"-->। server page चलाने से पहले इस पंक्ति की जगह उस फ़ाइल की सामग्री रख देता है। यह directive <% %> के अंदर नहीं लिखा जाता। <include> नाम का कोई tag भी नहीं होता। इसलिए विकल्प 1 सही है।
In ASP, another file is added to a page with a Server Side Include (SSI) directive. It looks like an HTML comment: <!--#include file="time.inc"-->. Before running the page, the server puts the file's content in place of this line. The directive is not written inside <% %> script blocks, and there is no tag called <include>. So option 1 is correct.
C# Programming में abstraction को कितने तरीक़ों से प्राप्त (achieve) किया जा सकता है?
In how many ways can abstraction be achieved in C# programming?
A1
B2
C3
D4
सही उत्तर / Answer: (B)
हल / Solution
C# में abstraction पाने के दो रास्ते हैं। पहला है abstract class, जिसमें कुछ methods बिना body के और कुछ पूरी body के साथ हो सकते हैं। दूसरा है interface, जिसमें आमतौर पर सिर्फ़ method के prototype होते हैं और उनकी body implement करने वाली class देती है। इसलिए उत्तर 2 है। 1 मानने पर interface छूट जाता है, और 3 या 4 गिनने के लिए कोई तीसरा तरीक़ा है ही नहीं।
C# gives two ways to achieve abstraction. The first is an abstract class, which can have some methods without a body and some with a full body. The second is an interface, which usually holds only method prototypes, and the class that implements it gives the body. So the answer is 2. Choosing 1 leaves out interfaces, and there is no third or fourth way to count.
आगे के 10 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति