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

  • Home
  • SEARCH
  • 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 8536941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:46:55+00:00 2026-06-11T10:46:55+00:00

I have the below code put in Eclipse, and I cannot get Eclipse to

  • 0

I have the below code put in Eclipse, and I cannot get Eclipse to let me run it as a Java application. I was able to do so on the computer on which I wrote it, but I’ve tried twice since on two different computers and neither has the option. I’ve tried to set a manual configuration to do it and I’ve tried Alt+Shift+X, but neither worked. I can run Java applications on all of these computers normally, just not this one for some reason.

import java.util.Scanner;

public class Donor {

public String name;
public int age;
public double donation;

    Donor() {

    //Initialized to these values for debugging
    name = "NoName";
    age = 0;
    donation = 0;

    }

    Donor(String nameinit, int ageinit, double donationinit) {

    name = nameinit;
    age = ageinit;
    donation = donationinit;

    }

    public String toString() {

    String str = "";

    str += String.format("%s-30%i-6$%d-20", name, age, donation);

    return str;

    }

    public static void main(String[] args) {

    Scanner input = new Scanner(System.in);
    String nameinit = null;
    int ageinit = -1;
    double donationinit = -1;
    String outp = null;

    System.out.print("Enter the donor's name: ");
    nameinit = input.nextLine();

    System.out.print("Enter the donor's age: ");
    ageinit = input.nextInt();

    System.out.print("Enter the donation amount: ");
    donationinit = input.nextDouble();

    Donor d = new Donor(nameinit, ageinit, donationinit);
    outp = d.toString();

    System.out.printf("%s30 %s6 %s10", "Name", "Age", "Donation");
    System.out.print("\n" + outp);

    input.close();

    }

}
  • 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-11T10:46:56+00:00Added an answer on June 11, 2026 at 10:46 am

    Have you clicked with the right button and choose “run as” option, Java Application? It should work just fine in any environment.

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

Sidebar

Related Questions

I have below code which overrides equals() and hashcode() methods. public boolean equals(Object obj)
I have put the code below inside my AppDelegate, but when I start the
I have the below code snippet, which runs fine. But the problem is it
Currently I have the code below to put the data in a Hash. My
I have written the below code which has a text-field and a button. as
I have the below code which is working fine: success: function (upd_rsp){ //if email
i have the below code i want to put in a global method set
I have the below code which i have written to debug some information I
I have below code: <a href=# id=@item.Id name=vote ><img src=/Content/images/021.png style=float:left alt= /></a> which
I have below code: class Program { static void Main(string[] args) { Task[] tasks

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.