Wednesday, 28 August 2019

how to create and init a array with element in one line in java

depends on which version of java you are using, you have different solutions:

array in annotation. e.g.

@DataMongoTest(includeFilters = @ComponentScan.Filter({ Service.class, Component.class, Configuration.class }))

here Filters is an array,  you just need to {a, b, c}

No comments:

Post a comment