ABAP Stack require 3 System Landscape
ABAP requires 3 systems Landscape because ABAP modifies programs and moves them as a program to the consolidation for Testing. Since ABAP has both have Client Dependent and Client Independent data(s) and programs (cross client data consists of Programs and Data Dictionary), modification to such programs cannot be tested reliably in the same (development) system, which anyway would work correctly. So to simulate a production environment the changes need to be tested in Quality System. So an ABAP system would require 3 and not 2 systems landscape.
JAVA Stack require 4 System Landscape
In a Java stack the program are not moved alone, they are moved along with its other dependencies as a Software Component (jar, ear files). In the development system a user can copy the program and modify it and but would require a consolidation system for consolidating and building the application (Software Component). So a program is transported from Development System to Consolidation System. The Consolidation system will build the application. Once the software components are built they would be moved to Test System for Testing and finally to delivery System (Production System). Thus a Java Stack would require a 4 system landscape for a development Infrastructure.
In addition to these 4 Servers, there would be one more system which will host the Netweaver Development Infrastructure Application (NW + NWDI)
Development System -> Consolidation System -> Test System -> Productions System
Development : will have the modified Sources
Consolidation : Will consolidate the modified program from Development system and will be built as a Software component (jar File)
Testing : Software Component will tested here
Production : Productions System
Product -> Software Component -> Development Component -> Program
SAP NW 2004s Development Infrastructure