The paper introduces StatType, a statistical approach designed to resolve fully qualified names (FQNs) for API elements in code snippets from online forums like StackOverflow. StatType improves upon existing heuristic methods by integrating two factors: learning co-occurrence patterns from a large code corpus and leveraging contextual information from neighboring API names. The approach treats the problem as a statistical machine translation task and achieves high accuracy, with 97.6% precision and 96.7% recall, outperforming current methods.