Link to home
Start Free TrialLog in
Avatar of gutta_naveen
gutta_naveen

asked on

couple of questions

question 1)
                   What is Design Pattern and why it is important ?
question 2 )
                   What are the essential parts of Exception Handling ?
                    I know ...try ...catch....throw...can anyone name more than this

question 3)  what is the technical term used to define the class below ?
               
class CanHash
{
  public:
     virtual bool operator == (const CanHash& ) const =0; // Compare two objects.
     virtual const char* KeyG() const =0; // Return the Key field.
 };

question 4) Can you give the difference between the two , and when you need to use whcih one ?

                             char* KeyG() const;
                             const char* KeyG() ;


               
Avatar of Axter
Axter
Flag of United States of America image

Sounds like homework or Interview questions.

FYI:
It's against EE policy to do homework questions.
Avatar of gutta_naveen
gutta_naveen

ASKER

Hi ,

      It's very easy to ask question in a different way , that doesn't look like a Home Work Or Interview . In that case you might have ended up in answering my questions if you knew the answers. Only difference was .... i was straight unlike other's.

  Let me come to point..... i work in a corporate company...and the questions i have asked was neither Interview nor HomeWork. You are correct upto some point..... those are the questions asked in one of the exam written by my room-mate in his online courses. And the exam is also over and we were going thru question paper and were not able to figure some of the above which i asked here. One more point ...those are not an easy questions to answer.

thanks
FYI:
I notice you're grading record:
B A B B
Please check out the EE grade guide lines.

>>What are the essential parts of Exception Handling ?
>> I know ...try ...catch....throw...can anyone name more than this
There's also catch all, which is catch(...)

>>what is the technical term used to define the class below ?
It's an abstract class, because of he pure virtual function.

>>Can you give the difference between the two , and when you need to use whcih one ?

//Returns a non-constant pointer and,
char* KeyG() const;// Can not modify member variables and can not call a member function that is not const

const char* KeyG() ;//Can modify member variables, but returns a constant pointer



const char* KeyG() ;//Can modify member variables, but returns a constant pointer

--->> one more point i came to know in this case is that..."const" can be used before the function only when the return type is a * or an & type . And you can store in a non-constant pointer variable.

 *  ) in pointer case , you can not change any of them
 &  ) in reference case , it gives only read access and not write

-------------------------------------------------

 could anyone tell me what is design pattern is all about.........

thanks

 
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial