I dont really know specifically what im searching for, which is why i haven't just found this via searching the web. Have you guys come accross or know of any sort of quiz questions like where it gives you a for loop which isn't in the normal format and then asks you what would x be? or how many times will this println?

Just wanna get some exam practise. Thank you.

Recommended Answers

All 3 Replies

I personally found use of pre/post ++/-- operators combined with self addition / substraction quite frustrating.
E.g.

int i = 0;
		for(; i < 10; i++) {
		     i -= i++ - --i;
		     //OR try this: i += ++i + i--;
		     System.out.println("Hello World!") ;
		}

Q = how many times would you hello the world?

Haha yeah thats what i meant mate, couldnt really describe it, do you have any links to these kind of questions en masse? lol that question you posted is bloody evil. Without compiling it I'm guessin it would print hello world 10 times beccause the sum is a double negative and so i iterates as ++1 each time? that right m8?

10

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.