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 8953447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:05:48+00:00 2026-06-15T14:05:48+00:00

Hello I wrote a program that simulates a java quiz. the program has 3

  • 0

Hello I wrote a program that simulates a java quiz. the program has 3 nested classes first class asks for the user information(name id# etc) after all is provided a second class is called this class is the actual quiz the quiz ends when the user answers all the question or the time runs out at that point the third class scores the quiz. If the user fails he can press a button that allow him to take the quiz one more time. when the try again choice is selected a variable that keep track of tries is implemented by one. However, the problem is that the variable that keeps track of how many tries the user has taken gets wiped because the way i wrote the code the program starts all the way back from class 1 , then class 2 and class 3 and for some reason that variable goes back to its initial value when the class reloads the second time.
Is there a way i can save the variable so it does not get wiped?
Any help will be much appreciated.

  • 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-15T14:05:49+00:00Added an answer on June 15, 2026 at 2:05 pm

    I suggest to write value in a file so that when the class get reloaded it will read from there.

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

Sidebar

Related Questions

I wrote a program called Hello.py that looks like this: import pygame, sys from
Problem: I wrote a hello world java program, compiled and created a jar file
Assume we have a trivial Java program that consists of just one class: public
I wrote a program that reverses each word in a string. For example hello
I wrote a simple c++ program that prints Hello World! #include <iostream> using namespace
i have wrote a program to test the MediaPlayer class, and it has three
Hello wrote a program that outprints this; 0 01 012 0123 01234 012345 01234
I just started learning C, and wrote my hello world program: #include <stdio.h> main()
I just started learning C, and wrote my hello world program: #include <stdio.h> main()
I wrote this small C++ program and built it(Release) #include<iostream> int main(){ std::cout<<Hello World;

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.