• Post Reply Bookmark Topic Watch Topic
  • New Topic

static vs dynamic class loading  RSS feed

 
Rajiv KumarRai
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please help me understand the difference between static and dynamic class loading.
It will be more helpful if examples are given , especially for dynamic class loading(without using reflection)

Thanks.
 
Campbell Ritchie
Marshal
Posts: 56581
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is something you do not need to know about. It is implementation dependent so might vary from implementation to implementation and version to version.
 
Rajiv KumarRai
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree its implementation dependent. But this question is asked generally in
job interviews. So I needed a general answer
 
Campbell Ritchie
Marshal
Posts: 56581
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Job interview questions often have little or nothing to do with real life. You will have to have a sensible and correct answer which shut the interviewer up satisfies the interviewer.
Start by telling us what you said last time they ask such a question.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some good explanations here
http://stackoverflow.com/questions/19519787/when-do-we-use-static-and-dynamic-class-loading

Frankly speaking this is one of the most stupidest questions which morons ask at interviews.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajiv KumarRai wrote: So I needed a general answer

When you use the 'new' keyword -> static
When you use something like Class.forName -> dynamic
 
Campbell Ritchie
Marshal
Posts: 56581
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote: . . . this is one of the most stupidest questions which morons ask at interviews.
Which is why it is worth Rajiv KumarRai's while telling us how they answered such questions.
 
Rajiv KumarRai
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have yet to face that question in an interview. Right now
am preparing for an interview and came across that question
in a list of interview questions. Hence I asked it here.
 
Campbell Ritchie
Marshal
Posts: 56581
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In which case I shall ask that question.
 
Campbell Ritchie
Marshal
Posts: 56581
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't expect any more responses from me; I am going to hide in the corner and die of shame for asking such a question.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!