1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lesantik [10]
2 years ago
8

Write java code to create a new class called "student". an object of the student class has attributes like student id, name and

address. instantiate an object of this class, with these attributes. thereafter, display these attributes to a user.
Computers and Technology
1 answer:
Fiesta28 [93]2 years ago
8 0
Here you go. I added a constructor and a toString overload to make the object creation and printing as easy as possible.

public class student {
    private String _id;
    private String _name;
    private String _address;

    public student(String id, String name, String address) {
        _id = id;
        _name = name;
        _address = address;
    }

    public String toString() {
        return "Id: " + _id + "\nName: " + _name + "\nAddress: "+ _address;
    }

    public static void main(String[] args) {
        student s1 = new student("S12345", "John Doe", "Some street");
        System.out.println(s1);
    }
}

You might be interested in
All spreadsheet formula should start with
inysia [295]
A formula in Excel will ALWAYS start with = then the function name like
=SUM(A1:A5)
5 0
3 years ago
Calls to the tostring( ) method emphasize the use of ____.
DaniilM [7]
<span>Polymorphic message
   
Methods in different classes with a similar function are given the same name. - Makes classes easier to use because programmers need to remember fewer method names. - Employed as much as possible. - Polymorphic message ex. is the toString method.</span>
5 0
2 years ago
Lance is at a bus station. his friend is using the atm machine to withdraw some money. lance notices a stranger deceptively watc
stich3 [128]

The person watching Lances friend typing the ATM pin is an example of shoulder browsing. Lances friend should change the ATM pin.

<h3>What does ATM mean?</h3>

This is known as automated teller machine. It is said to be a kind of unique computer that makes it easy to manage a bank account holder's money.

Based on the above, The person watching Lances friend typing the ATM pin is an example of shoulder browsing. Lances friend should change the ATM pin so that his funds will not be stolen.

Learn more about ATM from

brainly.com/question/12629434

#SPJ4

4 0
2 years ago
Read 2 more answers
How many currencies do recognize?
klemol [59]
The United Nations currently recognizes 180 currencies that are used in 195 countries across the world the United States dollar is a popular currency and about 66 countries either peg their currency to the US dollar or use it as their currency
3 0
3 years ago
Can some give me engineers names that start with the letter A-Z
Nadya [2.5K]

Answer:

elon musk/ bill gates/ jeff bezos/ henry ford/ tim cook

Explanation:

i googled it/ i added more

6 0
3 years ago
Other questions:
  • Where is the viscosity of engine oil found
    9·1 answer
  • PLEASE HELP!!!!! David has gone to the Niagara Falls with his camera. He wants to click photos of the people around him and also
    11·2 answers
  • "A(n) ___________ is a radio transceiver that plays the same role as a hub or switch in a wired network and connects the WLAN to
    14·1 answer
  • Technician A says that high pressure in recycled refrigerant is only caused by air contamination. Technician B says that recycle
    15·1 answer
  • An mp3 takes up about 16 kilobytes of memory per second of music. if you owned a one terabyte hard drive and filled it with only
    15·1 answer
  • What type of web provides a framework that allows data to be shared and reuse to deliver
    9·1 answer
  • Yeoo check dis out!!!!!! wait my full vid dont show hol on
    7·2 answers
  • Why is computer science hardware needed to solve problems with computers?
    9·1 answer
  • Where else can the computer send the results of processing other than to output​
    13·1 answer
  • Define foreign employment​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!