Code Snippets Interview Questions
Questions Answers Views Company eMail

What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }

575

Write a program that will convert an integer pointer to an integer and vice-versa.

516

Write a program that implements a date class containing day, month and year as data members. Implement assignment operator and copy constructor in this class.

537

Write code that allows to create only one instance of a class?

484

Write code to add functions, which would work as get and put properties of a class?

490

Write code to make an object work like a 2-d array?

472

Write a code snippet to display an integer in a binary format?

488

what is the structure of xml document ?

338

What is xml schema?

338

What is a cdata section in xml?

322

How to print sum of the numbers starting from 1 to 100?

436

Write a python program to swap the first and last value of a list?

510

Write a program to reverse a number in python?

457

Write a python program to check common letters in two input strings?

483

What is the output when we execute list(“hello”)?

624


Un-Answered Questions { Code Snippets }

import java.awt.*; import java.awt.event.*; public class Agency extends Frame implements ActionListener { Label l1,l2,l3,l4; Button b1; TextField t1,t2; String s1,s2,s3,s4; public static void main(String args[]) { new Agency().setVisible(true); } public Agency() { super("Gas Agency Package"); setSize(1280,800); setBackground(Color.lightGray); setLayout(null); // setLayout(new BorderLayout()); t1=new TextField(20); t1.setBounds(440,150,200,30); t1.setBackground(Color.white); t2=new TextField(20); t2.setBounds(440,180,200,30); t2.setBackground(Color.white); t2.setEchoChar('*'); l1=new Label("Gas Agency Package"); l1.setBounds(400,30,300,50); l1.setFont(new Font("TimesRoman",Font.BOLD,25)); l1.setAlignment(Label.CENTER); l2=new Label("Enter your ID and Passoword"); l2.setFont(new Font("TimesRoman",Font.BOLD,20)); l2.setBounds(270,80,300,50); l3=new Label("Enter ID"); l2.setFont(new Font ("TimesRoman",Font.BOLD,20)); l3.setBounds(270,150,120,50); l4=new Label("Enter Passoword"); l2.setFont(new Font ("TimesRoman",Font.BOLD,20)); l4.setBounds(270,180,140,50); add(l1); add(l2); add(l3); add(t1); add(l4); add(t2); b1=new Button("Login"); b1.setBackground(Color.white); b1.setBounds(400,280,100,70); b1.addActionListener(this); add(b1); } public void actionPerformed(ActionEvent e) { if(e.getSource()==b1) { s3="svce"; s4="svce"; s1=t1.getText(); s2=t2.getText(); if(s1.equals(s3) && s2.equals(s4)) { //System.out.println("password is correct"); MenuForm m= new MenuForm(); m.setVisible(true); //this.dispose(); } else { System.out.println("password not correct"); } this.dispose(); } } } plzzzzzzz xplain me this java code like why i m including this packages n the whole code plzzzzzz

1958


Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?

2905


Could u please tell me any UNIX scripts that 'll lead to find the network latency of the servers.?or else any unix command to find the network latency of a server?Thnx in advance...

1699


c# code to Count number of 1's in a given range of integer (0 to n)

4297


What is 301 redirects in php? When are we used 301 redirects in our projects?

1973






What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }

635


How can get all database name using Php and Sql?

1770


How to Print Asp.net GridView Data on Button Click using Javascript?

680


What is full form of PEPSI

1858


What is the functionality of SetForegroundWindow?

568


You have been asked to install a servlet engine (tomcat, glassfish, etc.) for a companies servlets. Assuming the company has an existing web/DBMS server (which may or may not be on the same server), explain in detail how would you implement the development project and a deployment solution.

2122


Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?

7328


Why XSLT is important for XML?

395


an on-line examination application using html jsp servlet and jdbc. including session management and cookies

4467


Why XML has been used for development?

320