You may be thinking about Robots, Alexa, Ironman, and many more such models while reading or listening about Artificial Intelligence. Many movies take up their themes based on AI so that they can show us how beneficial it is to our human society. Developing computer systems that are equal or exceed human intelligence is the heart of Artificial Intelligence.
AI is a field of computer science that emphasizes the creation of intelligent machines that can work, act or react like humans.
Coming on to the programming part, as you have mentioned that you are interested in building AI in stock marketing, for that R programming is the best language as it helps in dealing with analyzing and manipulating data.
Stock marketing deals with data predictions and calculations and R programming can produce a well-designed quality plot for the same. It applies various statistical and machine learning functions. The main theme in stock marketing is predictive trading based on sentiments. This comprises of analyzing news headlines, social media comments, blogs and more, AI can predict the direction of stocks and the moves of other traders via sentimental analysis — the process of categorizing opinions (or sentiment) people have shared in text. This can be easily done with R programming.
And you can refer to the following link: https://intellipaat.com/tutorial/artificial-intelligence-tutorial/ as it explains the same.
As far as java is concerned, it can also be considered a good programming language. It has tools that make graphics and interfaces look appealing. There are many frameworks in AI and the one particularly written in Java is Deeplearning4j. It is an open-source, distributed deep-learning library for java. It is integrated with Hadoop and Apache Spark. DL4J(Deep-Learning4j) brings AI to business environments for distributed GPUs and CPUs.