Academic Journal
Java Code Generation Using Prompt Engineering Techniques.
| Τίτλος: | Java Code Generation Using Prompt Engineering Techniques. |
|---|---|
| Συγγραφείς: | Truong, A.1,2 (AUTHOR) anhtt@hcmut.edu.vn, Le, Phuong1,2 (AUTHOR), Tran, Hau1,2 (AUTHOR) |
| Πηγή: | International Journal of Software Engineering & Knowledge Engineering. May2026, Vol. 36 Issue 6, p873-900. 28p. |
| Θεματικοί όροι: | Prompt engineering, Java programming language, Automation software, Language models, Code generators |
| Περίληψη: | Automated code generation using large language models (LLMs) has attracted significant attention due to its potential to enhance software development. However, ensuring both accuracy and efficiency in generated code remains challenging. Prior research has mainly advanced along two directions: (i) enhancing models through architectural improvements, larger parameter scaling, and domain-specific fine-tuning; and (ii) refining prompt engineering techniques to better structure inputs and guide outputs. In this work, we pursue the latter direction and introduce a prompt engineering-based approach for Java code generation. Rather than directly generating Java code from natural language specifications, we propose a two-step pipeline: (i) generating intermediate Python code and, (ii) translating Python into Java. This design leverages the strong performance of LLMs on Python while enabling systematic optimization of the translation stage. To achieve this, we propose a set of translation strategies combining prompt engineering principles — including explicit instructions, syntax guidance, and domain keyword constraints — with advanced reasoning strategies such as Zero-shot Chain of Thought (Zero-shot-CoT) to efficiently generate Java code. Experiments on the HumanEval-X benchmark using the CodeGeeX3 model show that the proposed strategies significantly improve the accuracy of Java code generation. We further evaluate across diverse programming tasks, including file operations, HTTP APIs, database connectivity, parallel computing, and graphical applications, confirming the robustness of our approach. Finally, we validate the generality of our findings using ChatGPT (GPT-4o), observing substantial improvements over baseline prompt designs. [ABSTRACT FROM AUTHOR] |
| Copyright of International Journal of Software Engineering & Knowledge Engineering is the property of World Scientific Publishing Company and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.) | |
| Βάση Δεδομένων: | Business Source Index |
| FullText | Text: Availability: 0 |
|---|---|
| Header | DbId: bsx DbLabel: Business Source Index An: 191661497 RelevancyScore: 1412 AccessLevel: 6 PubType: Academic Journal PubTypeId: academicJournal PreciseRelevancyScore: 1411.61413574219 |
| IllustrationInfo | |
| Items | – Name: Title Label: Title Group: Ti Data: Java Code Generation Using Prompt Engineering Techniques. – Name: Author Label: Authors Group: Au Data: <searchLink fieldCode="AR" term="%22Truong%2C+A%2E%22">Truong, A.</searchLink><relatesTo>1,2</relatesTo> (AUTHOR)<i> anhtt@hcmut.edu.vn</i><br /><searchLink fieldCode="AR" term="%22Le%2C+Phuong%22">Le, Phuong</searchLink><relatesTo>1,2</relatesTo> (AUTHOR)<br /><searchLink fieldCode="AR" term="%22Tran%2C+Hau%22">Tran, Hau</searchLink><relatesTo>1,2</relatesTo> (AUTHOR) – Name: TitleSource Label: Source Group: Src Data: <searchLink fieldCode="JN" term="%22International+Journal+of+Software+Engineering+%26+Knowledge+Engineering%22">International Journal of Software Engineering & Knowledge Engineering</searchLink>. May2026, Vol. 36 Issue 6, p873-900. 28p. – Name: Subject Label: Subject Terms Group: Su Data: <searchLink fieldCode="DE" term="%22Prompt+engineering%22">Prompt engineering</searchLink><br /><searchLink fieldCode="DE" term="%22Java+programming+language%22">Java programming language</searchLink><br /><searchLink fieldCode="DE" term="%22Automation+software%22">Automation software</searchLink><br /><searchLink fieldCode="DE" term="%22Language+models%22">Language models</searchLink><br /><searchLink fieldCode="DE" term="%22Code+generators%22">Code generators</searchLink> – Name: Abstract Label: Abstract Group: Ab Data: Automated code generation using large language models (LLMs) has attracted significant attention due to its potential to enhance software development. However, ensuring both accuracy and efficiency in generated code remains challenging. Prior research has mainly advanced along two directions: (i) enhancing models through architectural improvements, larger parameter scaling, and domain-specific fine-tuning; and (ii) refining prompt engineering techniques to better structure inputs and guide outputs. In this work, we pursue the latter direction and introduce a prompt engineering-based approach for Java code generation. Rather than directly generating Java code from natural language specifications, we propose a two-step pipeline: (i) generating intermediate Python code and, (ii) translating Python into Java. This design leverages the strong performance of LLMs on Python while enabling systematic optimization of the translation stage. To achieve this, we propose a set of translation strategies combining prompt engineering principles — including explicit instructions, syntax guidance, and domain keyword constraints — with advanced reasoning strategies such as Zero-shot Chain of Thought (Zero-shot-CoT) to efficiently generate Java code. Experiments on the HumanEval-X benchmark using the CodeGeeX3 model show that the proposed strategies significantly improve the accuracy of Java code generation. We further evaluate across diverse programming tasks, including file operations, HTTP APIs, database connectivity, parallel computing, and graphical applications, confirming the robustness of our approach. Finally, we validate the generality of our findings using ChatGPT (GPT-4o), observing substantial improvements over baseline prompt designs. [ABSTRACT FROM AUTHOR] – Name: AbstractSuppliedCopyright Label: Group: Ab Data: <i>Copyright of International Journal of Software Engineering & Knowledge Engineering is the property of World Scientific Publishing Company and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract.</i> (Copyright applies to all Abstracts.) |
| PLink | https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=bsx&AN=191661497 |
| RecordInfo | BibRecord: BibEntity: Identifiers: – Type: doi Value: 10.1142/S0218194025500974 Languages: – Code: eng Text: English PhysicalDescription: Pagination: PageCount: 28 StartPage: 873 Subjects: – SubjectFull: Prompt engineering Type: general – SubjectFull: Java programming language Type: general – SubjectFull: Automation software Type: general – SubjectFull: Language models Type: general – SubjectFull: Code generators Type: general Titles: – TitleFull: Java Code Generation Using Prompt Engineering Techniques. Type: main BibRelationships: HasContributorRelationships: – PersonEntity: Name: NameFull: Truong, A. – PersonEntity: Name: NameFull: Le, Phuong – PersonEntity: Name: NameFull: Tran, Hau IsPartOfRelationships: – BibEntity: Dates: – D: 01 M: 05 Text: May2026 Type: published Y: 2026 Identifiers: – Type: issn-print Value: 02181940 Numbering: – Type: volume Value: 36 – Type: issue Value: 6 Titles: – TitleFull: International Journal of Software Engineering & Knowledge Engineering Type: main |
| ResultId | 1 |