Accenture Interview Question Analysts


Country: India
Interview Type: In-Person


Comment hidden because of low score. Click to expand.
0
of 0 vote

class template :

template <typename t1, typename t2>
class hello{
---
---
};

The above structure is generic for all types passed for t1,t2.(It is called class template)

Template class: class generated by giving values to generic types
Initialise : "hello<int>"
But, the initialisation of generic types with int, refer to classes generated from template.

- teja on September 11, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

hello<int,int>

- Anonymous on September 11, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Since this answer will depend on language, here is my answer based on C++

I don't believe that there is anything like "template class" in c++. C++ only allow you to define templates and these templates are what which define the classes which people usually think that it means "class template".

Let me try to explain with example.

template <class typeName> class myExampleClass{
 ...

};

Now what we have here above here is a class template. Now when you declare something like

myExampleClass<int>

is class myExampleClass which is created, works on it and the behavior is defined by class template given above. "template class" doesn't make any sense as far as C++ is concerned.

- Bruce on October 13, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book walking you through getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More