Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8760005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:56:37+00:00 2026-06-13T14:56:37+00:00

So, I have an assignment question for assignment of certain variables in a parliament

  • 0

So, I have an assignment question for assignment of certain variables in a parliament class. I kept it as basic as possible, but when I create a subclass called, say, CanadaParl it doesn’t let me change any of the String fields. Int fields work fine. For the Strings it keeps saying Error: cannot find symbol = variable Bob (where Bob is the String I’m trying to enter as the name of the PM field). I’m using BlueJ for my coding interface.

This is an example of the method in the Class:

public void changePM(String newPM) {
    primeMinister = newPM;
}

Would this be the wrong way to go about update to a new String? I was just using a previous example for changing fields I saw, but I can’t remember if it had a String included in it or not.

Edit: Sorry for the mixup. I wasn’t paying attention initially and copied the int methods. The methods where the subclass changes the int values are working, but the String changes give the error above.

Here’s the whole class:

public class Parliament
{
int members = 0;
int parties = 0;
public String primeMinister = "";
public String oppLeader = "";
public String speaker = "";
boolean inSession = false;
boolean majority = true;


public void changeMembers(int newValue) {
    members = newValue;
}
public void changeParties(int newValue) {
    parties = newValue;
}
public void changePM(String newPM) {
    primeMinister = newPM;
}
public void changeOL(String newOL) {
    oppLeader = newOL;
}
public void changeSpk(String newSpk) {
    speaker = newSpk;
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:56:38+00:00Added an answer on June 13, 2026 at 2:56 pm

    Are you quoting your string ? For example, is Bob entered as “Bob” in your graphical user interface? The “cannot find symbol” seems to indicate that you might not be.

    This might also explain why primitives work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is an assignment question from school: Create a recursive method called toBinary that
Hello I have one c++ Programming assignment question. I tried hard but somehow I
I have a Assignment question about Java Generics. The given class is Product.java. It
This is my assignment question Create a class with its own operator new. This
Hello is have a question for a school assignment i need to : Read
Is it possible to have assignment in a condition? For ex. if (a=some_func()): #
I have an assignment to create a GUI using MATLAB GUIDE and am having
I have an assignment to create a secure communication between 2 people with a
I have a class test which isn't standard constructable nor assignable due to certain
I have Assignment due in which i'm stuck on a question. Add a Sales

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.