• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Switching Enviroments

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a apprentice and have done my first year of this apprenticeship. I started in August 2024 and now its the end of my first year. After the summer holidays, I'll be working in the company. I've been told that they use Eclipse, and we work with Swing. In the first year I learned how to code in Java a little bit. I learned what objects, classes, instances are. Just the like most basic stuff. I don't know if it is considered basics because on how easy it is. What I also learned is how to use JavaFx with SceneBuilder. I made a project management system with it and it had all sorts of stuff. Excel Exporter and everything. I learned pretty well and after that I didn't touch Java a single bit since we are learning other Stuff too.

What I currently know in Java without using anything is how to create classes, objects and instancing. That are things i can do without looking anything up.

Now I'm switching to Eclipse and i did a full factory reset on my computer to have everything cleanly organized.

What i currently have installed:
- Eclipse IDE 2025-06
- JDK 21
- Everything (from voidtools)
- Obsidian
- DevToys
- Git

My boss said that I don't need to install plugins because Eclipse has many built in features.
Is there something I should install or do?
What should I learn during summer holiday? (4 weeks)
Which Documentations should I read?

Thank you in advance


 
Saloon Keeper
Posts: 28993
214
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch,  Vijiyarathan!

Eclipse is virtually nothing but plugins. However, if you install the enterprise java spin, most of the plugins that you need for desktop and web-based Java developments will be pre-installed. With the possible exception of a plugin for WYSIWYG Swing design.

As far as what to study, I suppose that you'll have to determine that based on what you feel you might need most but understand least.

If you expect to develop Swing apps, study that. JavaFX is similar in some ways to Swing, but they're not interchangeable.
 
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd take a stab at some Swing exercises.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And have you tried any typical beginners' excercises?
For example:
- Hello World.
- Compute first 100 prime numbers.
- Compute Euler's number.
- Order some array using Bubble sort.
 
Vijiyarathan Rithush
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've done Hello World and compute first 100 prime numbers.
 
Petr Šlechta
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Euler's number is e = 1 + 1/1 + 1/(1*2) + 1/(1*2*3) + 1/(1*2*3*4) + ...
If you want to play, you can use the BigDecimal class and compute 100 decimal digits of e.
 
Marshal
Posts: 81607
593
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vijiyarathan Rithush wrote:I've done Hello World and compute first 100 prime numbers.

Please show us your HelloWorld, and tell us how you computed those prime numbers.
 
Carey Brown
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For general java exercises go to hackerrank.com.

In Swing
* Get to know Layout Managers
* Tables

Once you have a general grasp of layout managers tussle with the GridBagLayout but you'll want to use the GBC helper class which is floating around the internet or I can post you one if you need it.
 
Vijiyarathan Rithush
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think there are improvements I could make.
I could've done it without an ArrayList and it would be way easier.
But I wanted to implement it since we basically only learned with ArrayList





Hoping for suggestions on Improving.
 
Rancher
Posts: 5146
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suggestions:
Replace the while statement with a for statement:

Remove statements:  5 and 14
This restricts the scope of num and cleans up its usage.

Replace for loop starting  on line 17:


 
Carey Brown
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want an interesting exercise look up computing primes with  the Sieve of Eratosthenes. Extremely fast. You could even incorporate a "BitSet" object when writing the code.
 
Vijiyarathan Rithush
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the advice and tipps.

I have a small problem with Eclipse. I don't know if its the same for everyone but when I type in the { then i dont get the closing bracket even if i turned it on.
 
Petr Šlechta
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the prime numbers example you test whether the number can be divided by all numbers.
It would be faster to use only already computed prime numbers.

And another suggestion: In this test you evaluate the square root in every iteration.
I would do it only once.

You can program Hello World using JFrame.
 
Petr Šlechta
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vijiyarathan Rithush wrote:... but when I type in the { then i dont get the closing bracket even if i turned it on.

Try to press Enter. I do not know if it helps, I have it turned off.
 
Carey Brown
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Petr Šlechta wrote:And another suggestion: In this test you evaluate the square root in every iteration.
I would do it only once.


Init looks like sqrt is calculated every time through the loop but the compiler is smart enough to call sqrt only once.
 
Petr Šlechta
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I am trying to test if it is faster when I change the cycle to:And it seems the speed is the same.

Edit: I looked at the byte code and it is not optimized. But the virtual machine may make other optimizations.
 
Carey Brown
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're  right. I guess it's left up to the  JIT compiler to do that optimization. So, it's a safer bet to write it the way you suggest.
 
We don't have time to be charming! Quick, read this tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic