ChatGPT vs Java: An AI Experiment

Опубликовано: 09 Февраль 2023
на канале: Bill Barnum
1,347
30

I tested OpenAI's Chat on Java exam prompts, and it accurately answered many questions. However, its failure on an elementary question caught my attention. I delved deeper into its understanding of programming concepts and made a fascinating discovery.

Some very similar code returns the correct answer, but this is the question that I asked:

What would the following Java code return?

String a = "Hello";
a.substring(3, a.length() - 2);

AP Computer Science A APCSA AP CSA
Computer Science Education

#OpenAI #ChatGPT #Java