Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Dec 2006
Offline Last Active Aug 21 2014 10:33 AM

Posts I've Made

In Topic: I've got problems with interviews

04 July 2014 - 09:03 PM

This doesn't just sound like you don't know specific things like the linked list loop problem. It sounds like you don't place much value in understanding more than whatever it takes to get your code to run. That doesn't make you a person who I would want to work with.



Its the bad interviewing methods of the industry that is killing my skills,


Originally I was top a class programmer. Then I had a break lasting several months (supposed yo be a temporal quit - due to family issues). Then I couldn't get in any more.


But I still kept up by developing great personal projects (a RT 3D photographic scanner- for example), Except that through the years, as I concentrated more on development, My theoretical rehearsing stop, that affected interviews.  My coding skills remained top class at first until i'm forced to work outside the industry 9 hours a day, 5/6 days a week (in a retail, restaurant - find it boring, not my calling), and now, after some few years of that , even my programming skills (and analysis skills) is now starting to get extremely rusty.


Its a chain effect that I wouldn't wish on my enemy


Yes, now i realise the solution was extremely simple, but i was attending to the forum during breaks in my long shift, was tired, lacked patience...  if I'd known my judgement would be affected that much i would have waited for my day-off 

In Topic: iterator output not in sync

03 July 2014 - 01:43 PM

I do apologise 

   Wooh, rip-off, DeafManNoEars, BitMaster, Lasctose  et al


It did work with the correct behaviour with Wooh exact code


I dont know what mistakes i made originally that caused the errors that i observed the first times i tried it, I must overwritten some other code


My apologies and many thanks

In Topic: iterator output not in sync

03 July 2014 - 10:11 AM

So, why are you not adding the actual fix as Wooh and especially rip-off already told you? Repeatedly. If that fix does not work, do as rip-off told you: post the errors (either the compile-time errors or the new behavior).


I did exactly that.

Perhaps you are so much in a hurry to dismiss me that you didnt read the posts properly or follow the logic properly. (with respectsmile.png : I don't mean to sound awful)  

I know u know the following already but to reiterate I will add this anyway - Eclipse IDE doesn't work like visual studio. U see red error lines. not compile errors.

Put the cursor on it and you see the errors. I immediately knew that vector3D v = vecIterator.next(); wouldn't work because the return type doesn't match vector3D data type


   so   System.out.println("iterator list output " + v.x + " " + v.y + " " + v.z);   also had red lines. No compile errors (or it the editor automatically compiles without printing to the console)


 All i was asking was a fresh eyes to look at it but you all kept refering to Wooh's fix which can never be the correct fix

In Topic: iterator output not in sync

03 July 2014 - 08:51 AM

This is the correct code, and should work. If this isn't working for you, you'll have to post that code so we can see why it isn't. We're not psychic, to help you, we'll need to see the full code, not just isolated snippets. If there are errors, please post them. If the output is unexpected, please note how and post it.


The whole code was posted in my 1st  and 5th posts. 

Afterwards isolated snippets was because those were the only changes smile.png  

But I will post all again here in one shot biggrin.png  


Consist of the

                  class conceptPractice   which contains the main() function

                  class  myIterator

                  class  vector3D


  output as in first post.                m  thanx

public class conceptPractice {
	static myIterator scanArray;
	public static void main( String[] args ){
		scanArray = new myIterator();

import java.util.ArrayList;
//import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

public class myIterator{
	List<vector3D> vec = new ArrayList<vector3D>();
	vector3D  myTwoDimVec[][] = new vector3D[3][5];
	myIterator( ){
		for(int i=0; i<myTwoDimVec.length; i++){
			for(int j=0; j<myTwoDimVec[i].length; j++){

                                          //but this code makes it 10, 20, 30 11, 21, 31 12, 22, 32 etc
                                          // comment as in first post

				myTwoDimVec[i][j] = new vector3D(10+(i*myTwoDimVec[i].length+j), 20+(i*myTwoDimVec[i].length+j), 30+(i*myTwoDimVec[i].length+j));

				vec.add( myTwoDimVec[i][j] );
	public void createListVector3D(){
		for(int i=0; i<myTwoDimVec.length; i++){
			for(int j=0; j<myTwoDimVec[i].length; j++){
				System.out.println("2 dimen array output   "+myTwoDimVec[i][j].x + "   " + myTwoDimVec[i][j].y + "   " + myTwoDimVec[i][j].z );
		ListIterator<vector3D>  vecIterator = vec.listIterator();

		System.out.println( "=============================================================");
		while( vecIterator.hasNext()){
			System.out.println( "iterator list output   " + vecIterator.next().x +  "   " + vecIterator.next().y  +  "   " + vecIterator.next().z  );

//=============================== vector3D class ==================================================

import java.io.*;
import java.math.*;
public class vector3D{ 
	float x;
	float y;
	float z;
	vector3D(float a, float b, float c){
		x = a;
		y = b;
		z = c;
	public void sum(){

In Topic: iterator output not in sync

02 July 2014 - 12:13 PM

Does that even compile? The vector3D class you posted does not have a "next" method.


*.next() and *.hasNext()  is part of the iterator class  ie     ListIterator<vector3D> vecIterator = vec.listIterator();


if you try to run all i posted originally you will see that the vector3D class doesn't have to have *.next() and *.hasNext()


i added  the code below becus it was suggested by @wooh..  

   vector3D v = vecIterator.next();
    System.out.println("iterator list output " + v.x + " " + v.y + " " + v.z);