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

1093 questions
-3
votes
4 answers

An error in my codes. I cant find that

import java.io.*; import java.util.Scanner; public class Helloworld{ public static BufferedReader input=new BufferedReader(new InputStreamReader(System.in)); public static void main(String[]args) throws IOException{ …
-3
votes
1 answer

Class, interface, or enum expected when compiling

I sat down and tried to write code for this prompt, and I made this. However, when I compile it in BlueJ, I get: class, interface, or enum expected. 1) How do I fix this error? It seems like I forgot something, but I cant remember what I forgot. 2)…
AndrewAustin
  • 55
  • 1
  • 8
-3
votes
3 answers

How to find the number of a specific element in an arraylist in Java (blueJ)

I have and array list and in that array list there are 5 elements called pound and 3 called penny. How can I calculate the number of times that pound occurs in the array list
Daniel Watson
  • 13
  • 1
  • 4
-3
votes
1 answer

Java "cannot find symbol- variable totAMTpizza'

I am trying to make a simple program in java by BlueJ. But while compiling it gives me a error that "cannot find symbol- variable totAMTpizza". Anyone with the fix.
-3
votes
2 answers

Incorrect Output Error by Rachit Bhargava

I have made a program for question: Write a program in Java to input first name, middle name and last name. Validate the digital signature that contains first name and last name. If the signature doesn't contain any of these, print "Invalid…
Rachit Bhargava
  • 170
  • 1
  • 12
-3
votes
5 answers

how to generate a unique random number?

when storing to student may happen to have the same id, so how can i avoid the duplication, I have tried the while loop and the for each loop but it did not work public void addStudent(Student student) { student.setId(ganerateNewRandom("aa",…
Ghassar Qhasar
  • 75
  • 1
  • 11
-3
votes
2 answers

Use while loop to add many objects to arraylist

Taking an intro course to Java, using BlueJ. Have two objects, and object called account with relevant details and an ArrayList called bankAccounts containing accounts. I am tasked with adding multiple accounts to bankAccounts using a while loop. …
HandsomeRob
  • 445
  • 3
  • 7
  • 14
-3
votes
4 answers

String.contains(otherString) gives "unexpected type"

String doubleSpace = " "; String news = "The cat jumped. The dog did not."; while (news.contains(doubleSpace) = true) { news=news.replaceAll(" ", " "); } The above will not compile, giving the error "unexpected type. required:variable,…
xxyxxyxyx1
  • 79
  • 7
-4
votes
1 answer

Keeping a running average of values in java

I am trying to calculate the average of values given via repeated function calls. Actually Bluej allows me to put the number to rate but if i am trying to put again it replaces the previous one, i want to be stored and after that an average to be…
Rares
  • 7
  • 3
-4
votes
4 answers

Solving for N=N+1 Java algorithm

I have this sequence : 8, 9, 11, 14, 18, 23, 29, 36, 44, ... I have to write a method that calculates n numbers according to this rule and outputs them to the console. The nth number is to be returned. n is passed to the method as a parameter. If n…
-4
votes
1 answer

How can I make my program only input specific words, if anything other than said word is entered, retry input

I want to make a registration program. So there is 5 enrollments possbiel, lets say music, English, history, sports, photography. I want to make it so it will ask the user to enter to enroll into only 3 units out of the 5 options listed above. only…
-4
votes
1 answer

Reverse a line that has multiple values

I am working on a program that allows the user to input an integer, double, character, and a string. I have used variables to store the numbers in I am using BlueJ as my IDE, and my question is how I can reverse a system.out.println line that has…
NightCode
  • 29
  • 5
-4
votes
1 answer

Java breakout game - remove bricks

I have added multiple rows of bricks to my breakout game however i now have the task of removing these bricks once they have been hit. I have added a for loop which seems to rebound off a row of bricks roughly in the middle but doesnt remove any. I…
RHH
  • 41
  • 1
  • 9
-4
votes
1 answer

I was making a program on BlueJ but i am unable to figure was is wrong in the code

I made a program in BlueJ to display the even numbers from 1 to 100. But the Output is even numbers from 8 to 100. So i request you to please help me to rectify my error. For this i would be thankful to you. public class EvenNumbers1to100 { …
Arpit
  • 25
  • 1
  • 12
-4
votes
2 answers

Adding a class to an ArrayList collection

I'm currently working on an assignment where it's asking me to modify my previous method. My current method is: public ParkingTicket issueParkingTicket(ParkedCar car,ParkingMeter meter){ if(isParkingTimeExpired(car,meter) == true){ …
Paul Kim
  • 17
  • 3