Questions tagged [bluej]

BlueJ is a popular Java IDE aimed at teaching the principles of object oriented programming.

BlueJ is an open source platform written in Java that's especially aimed at beginner developers. It presents items to the user in a much more easy and intuitive format than more comprehensive IDEs such as Netbeans or Eclipse, helping people get started quickly and easily whilst also understanding what's going on.

Download

The latest version of BlueJ is available from the download page, here.

Useful Links

1065 questions
-5
votes
2 answers

Generate Random Number Method in Interface Class

I have an interface class and in this class I need to create an abstract method that generates a random int. However, when I try to compile I get an error because abstract classes cannot have bodies. How can I create an abstract method that…
Nuki
  • 3
  • 2
-5
votes
3 answers

Make java give the the highest sum of 3 numbers out of 4 given

When given 4 numbers, how do i find which 3 numbers out of the 4 will give the greatest sum. So if given 3 2 5 5, i want java to sum 3 5 5 for a total of 13 I have been searching for about 20 minutes and all i find is how the find the highest number…
Tyler R
  • 3
  • 2
-5
votes
1 answer

How to make a method that needs the information of a private attribute?

I need to make the method calculaDesconto based on what the method defineCategoria in the cliente class returned to me and i just can't find a way to make it work. http://pastebin.com/4ta8dQUM
Rutzen
  • 1
  • 2
-5
votes
1 answer

Java program to find a pallindrome

I am a beginner in Java programming. I was a making a program to find if the entered word is a pallindrome or not can someone please tell me the logic i should use to make the given program?
Arpit
  • 25
  • 1
  • 11
-5
votes
3 answers

How to return the average horsepower of all objects that match a specified year? java

Hi been stuck on figuring out the math coding on how to find the average horsepower of a specific year? If anyone can help me code this that would be great. I can also provide more info on the ArrayList or Class if you like, just comment. Here is…
Tre
  • 37
  • 8
-5
votes
2 answers

nested loops pattern java

I have been struggling with this pattern,trying to use only the code required for a nested FOR loop. I am required not to use patterns,just a nested for loop: 123454321 1234 4321 123 321 12 21 1 1 The code required is Java and I am…
-6
votes
1 answer

Generate all permutations of digits in an number of unknown length without using recursion

Many of my friends and teachers argued me that the program of finding all possible permutations of digits, in a number of 'n' digits without using recursion is not possible while one said it is possible but tricky. So I need some help solving this…
-6
votes
3 answers

I am making a program in java on loops and encountered an error

The program is as follows... public class SDD { public static void main(String args[]) { int x=0, y=10; do{ ++x; y-=x++; }while(x<=7); return(y); } } The error is as…
-6
votes
1 answer

program not leaving while loop

Hey guys, i have this while loop for variable 'i' and i have created a board[][] which is 2x2 (so sizeX for the board is 2 in this example). The problem is i can't work out why it isn't leaving the while loop if it goes through one of the 'if'…
Jake
  • 1
-6
votes
3 answers

How do I return the sum of an array, with this code to start it off?

So this is what I have: public static void Positive () { int limit = 50; for(int i=1; i <= limit; i++){ System.out.print(i + ", "); } } That prints out all numbers 1-50 with a loop How do I return the sum of this using a loop?
-7
votes
2 answers

Create a class for a "WAR" Card game when I have a driver class ready

The directions for the assignment are: Program a game of War. In War, if the value of your card is greater than your opponent's card, you earn one point. If your opponent's card is greater than your card, your opponent gets a point. If you tie it is…
Bryan
  • 1
  • 1
-7
votes
1 answer

Int cannot be dereferenced (arrays)

I'm using BlueJ. This is the code that's giving me the error. public void printBackwards() { int count = 5; for (count = 5; count < holiday.length; count--) // Error: int cannot be dereferenced { …
G_Man
  • 33
  • 1
  • 7
-7
votes
1 answer

local variables in print method

I have wrote a print method which tell the user congratulates on their, but at the same time i have another field called Downloads, I wouls like to update the field downloads once the thr print method have been invoked, thanks and im using bluej
-9
votes
1 answer

Java Not Displaying Triangle

all! I appear to be having a problem with integrating a triangle shape to appear! This is the main: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; // Class definition public class Assignment extends…
user3186187
  • 37
  • 1
  • 2
  • 7
-11
votes
1 answer

Does BlueJ not require a main() method?

When I used the BlueJ IDE, I was able to run programs without using a main() method, whereas when I try the same code in NetBeans it says that the program doesn't have a main() method.
1 2 3
70
71