Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Sigge Pigge

Greenhorn
+ Follow
since Aug 18, 2018
Sigge likes ...
Netbeans IDE Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sigge Pigge

Sorry for double post..(phone)
2 years ago
Two examples, first one we create an array
with an for-each loop:

And you can make it like this with
an simple for loop:
2 years ago
Two examples, first one we create an array
with an for-each loop:
2 years ago
@Norm, yes i know exactly what he try to do but its not possible, thats why i made some examples to easier understand.
3 years ago
Check my examples i posted earlier and you will understand.

You use the variable 'output' and adds your variable 'value' to it,
if you wanna change the value to 5 you need to use the variable 'output' again
and add 5 to it.

like this:


Or like this:
3 years ago

Mike London wrote:
Why is the output of the code below zero and not 5?



You can do it in many different ways but some examples..

Example 1:


Example 2:


Example 3:


Example 4:
3 years ago
Surround the Thread.sleep() with try-catch

To break the loop use if statement below the Thread:

3 years ago
Ok, thanks for the help!
3 years ago
Hello!

I know the use of variable,class, and methods with the final keyword but not when creating object.

Im creating a JFrame and i added JComboBox to it, and then i saw a example of someone who added the final keyword
at the beginning of it like this:

final JComboBox cb = new JComboBox(languages);  

So my question is, what is the use of it?
3 years ago