Starting to Learn Java

in #coding3 months ago (edited)

Hey my hivean friends,

I decided to learn JAVA a few days ago, and asked Chat GPT to build a study routine for me. First of all, it gave me some subjects that would be important for me to learn. So, I asked it to organize all subjects in a Timetable so that I could adapt in my daily routine.

It was very good. So good that I decided to create a Pomodoro routine, and asked chat GPT to create an image with this representation for me.

And here's the image:

Eu decidi aprender java há alguns dias, e pedi ao Chat GPT construir uma rotina de estudos para mim. Primeiramente, ele me deu um algumas matérias que seriam importantes para eu aprender. Então, o pedi que as organizasse em uma Timetable para que eu pudesse incluir na minha rotina diária.

Ficou muito bom. Tão bom que eu decidi criar uma rotina Pomodoro, e pedi para que o chat GPT fizesse isso numa imagem para mim.

Ficou assim:

Legal, né?

Então tive a incrível idéia de pedir para que o chat GPT fizesse um programa de Java para mim, com notificações no Sistema operacional. Estou usando o intelliJ IDEA community version.

Aqui está o código:

Here's the code:

import java.awt.*; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; public class PomodoroScheduler { private static final String[] TASKS = { "Set up study space, review Java basics", "Break", "Practice writing basic Java programs", "Break", "Study Java object-oriented programming concepts", "Break", "Code along with a tutorial on Java OOP", "Break", "Explore Java collections framework", "Break", "Practice coding with collections", "Lunch Break", "Study Java exception handling", "Break", "Implement exception handling in your code", "Break", "Study Java input/output (I/O) operations", "Break", "Practice Java I/O", "Break", "Study Java multithreading basics", "Break", "Implement multithreading in your programs", "Break", "Explore Java networking", "Break", "Practice networking in Java", "Break", "Review and consolidate the day's learning", "Break", "Free Time" }; private static final int[] DURATIONS = { 25, 5, 25, 5, 25, 5, 25, 5, 25, 5, 25, 35, 25, 5, 25, 5, 25, 5, 25, 5, 25, 5, 25, 5, 25, 5, 25, 5, 25, 5, 25 }; public static void main(String[] args) { if (SystemTray.isSupported()) { ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); Runnable task = new Runnable() { int currentTask = 0; @Override public void run() { if (currentTask < TASKS.length) { displayNotification("Pomodoro Timer", "Time for: " + TASKS[currentTask]); scheduler.schedule(this, DURATIONS[currentTask], TimeUnit.MINUTES); currentTask++; } else { scheduler.shutdown(); } } }; scheduler.schedule(task, 0, TimeUnit.SECONDS); } else { System.err.println("System tray not supported!"); } } private static void displayNotification(String title, String message) { try { SystemTray tray = SystemTray.getSystemTray(); Image image = Toolkit.getDefaultToolkit().createImage("icon.png"); TrayIcon trayIcon = new TrayIcon(image, "Pomodoro Timer"); trayIcon.setImageAutoSize(true); trayIcon.setToolTip("Pomodoro Timer"); tray.add(trayIcon); trayIcon.displayMessage(title, message, TrayIcon.MessageType.INFO); Thread.sleep(5000); // Show notification for 5 seconds tray.remove(trayIcon); } catch (Exception e) { e.printStackTrace(); } } } Fiquem livres para experimentar e copiar. Aceito dúvidas e sugestões! Be free to experiment and copy. I accept all questions and suggestions! Esse foi outro incrível post de: This was another great post by: @xmauron3 "O futuro é Incrível"

Sort:  

You can create/make many good things in Java.

For example video games for mobile phones.

I remember playing many fun Java games on Sony Ericsson T230, K300i, V640i in my childhood.

Probably the ChatGPT can help in game creating/making too.

Good luck and have fun.

Yeah!! Chat gpt is awesome . It’s great to live in such a technological age like we do. Knowledge is for all.

Wish you the best brother, hope you bird is fine !!! Cheers !

Good luck with that. It broke my mind. 😆

Thank you @trinkowski ! Did you manage to learn it or you gave up ?

50/50. I never used it again.

Learning coding is very good because you can earn good money from it

I hope so! I’ll be posting regularly here so I can inspire more people to learn and also review my studies. I believe that’s a nice plan :) thanks for commenting!

revisite o codigo aqui e parece estar bem legal e simples para você iiniciar.

minha dica, execute ele com um debugger e rode linha a linha, vendo os parametros e resultados de cada operação.

Boa idéia !

Honestly, I tried to learn Java a long time ago, but I gave up. Object-oriented programming confused me a lot, and it was a very difficult time to find study materials. In my country, there was hardly any access to the internet. I wish you much success in your learning routine and in achieving your goals. Don’t get discouraged. Best regards!

Where are you from buddy ? I found some very good torrents with courses. Just search on duck duck go:

From zero to hero Java “.torrent”

Good luck! Do not give up brother !! I’m here with you in this journey! Let’s exchange knowledge and grow together!

Always use chat gpt for any questions you have and you will become unstoppable!

algum motivo especifico para querer aprender java?

eu gosto do pomodoro e uso, alias, hoje uso um jogo na blockchain para isso... rsrs

mas para aprender e estudar, acho os periodos de tempo muito curto. em pouco tempo muitas vezes é dificil escrever e testar rotinas de programação.

dependendo do seu tempo do dia a dia, tente juntar 2 intervalos ou 3 quem sabe.
vai dar tempo de testar, escrever e depurar mais e fixar na mente.

Boa idéia, vou tentar isso .

Um amigo meu trabalha com Java e me recomendou. Acredito que é um bom início já …

sim, gosto dela, hoje uso mto mais javascript, mas aprendendo uma aprende a outra tbm.

Oh, good luck @xmauron3 with learning Java! We covered it a few months ago, and there are still some parts I don’t fully understand. Maybe I just need more practice.

Good luck again! It’s not easy at first, but with determination, I’m sure you can do it. :))"

Thank you very much for your kind and wise words, my friend . Everyday is a new opportunity to get 1% better !!!! I’m loving to learn Java :) always wanted to learn how to code. Finally i decided to take action and couldn’t be happier 😁

I agree. Everyday is a new opportunity to get 1% better! 😁. By any chance, did you get that context from the book Atomic Habits? I just started reading that book a few days ago haha