A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Joined: Jun 30, 2006
Jul 19, 2012 20:29:37
private MyClass myObj = Mokito.mock(MyClass.class)
private MyClass myObj = new MyClass();
Doing the exact same thing of instantiating an instance of MyClass?
Joined: May 26, 2003
Jul 21, 2012 14:58:53
Well no. The later creates the real object. The former does not create the real object but instead creates a mock.
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
I agree. Here's the link:
subject: mock object
using this in a class itself
GC question, OCP book Exam 2 Question 1
Calling class methods by class object using Reflection
From main method to contractor, it is possible?
Why this private member can be seen?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013