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]
3 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]3 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
What was a result of george washington's belief in the sovereignty of the people instead of monarchy?
Ilya [14]
<span>George Washington's belief in the sovereignty of the people instead of monarchy led him to reject a third term as president.</span>
8 0
3 years ago
On the pie chart below, which “slice” represents 30% of the budget?
yan [13]

A is the final answer! :)

4 0
3 years ago
What is a protocol and what are the types of protocol​
wlad13 [49]
A protocol is a set of rules that governs the communications between computers on a network.

1. HTTP or HTTPs. This stands for Hypertext Transfer Protocol or Hypertext Transfer Protocol (secure).

2. FTP (File Transfer Protocol)

3. Email Protocols (POP3, IMAP, SMTP)

4. TCP(Transmission Control Protocol) and UDP(User Datagram Protocol)

Hoped that helped
3 0
4 years ago
Read 2 more answers
C programming Write a function named CalculateSphereVolume that takes one integer parameter intDiameter. The function should cal
FinnZ [79.3K]

Answer:

not familiar with C++. but basically save the constant 4/3 in a variable and use user input of cin << i  believe to ask for a radius. Then take that radius/input saved in a variable and cube it, then return the value.

Explanation:

i hope this works.

3 0
3 years ago
Cuando, Quien, Donde y Como empieza a funcionar Amazon?
vlabodo [156]

Answer:

It started working in July 16,1995. Mr Jeff Benzos was the founder of Amazon. An is located in 410 Terry Ave N, Seattle 98109,WA.

Explanation:

7 0
3 years ago
Other questions:
  • How is the numeric string that makes up a digital signature created?
    5·1 answer
  • Write a program that uses an "if" statement to determine if the number is greater than one. If the number is greater than 1, the
    9·1 answer
  • Before you enable data deduplication, what tool can you use to determine if data deduplication would benefit the tested volumes
    11·1 answer
  • We learned that an ideal multiple access protocol has FOUR desirable
    11·1 answer
  • How are procedural and object-oriented programming approaches similar?
    14·1 answer
  • TWO MINUTES LEFT<br> ________ __________ is the physical arrangement of devices on a network.
    9·1 answer
  • This algorithm requires you to find the perimeter of 12 different squares.
    14·1 answer
  • An attacker gained remote access to a user's computer by exploiting a vulnerability in a piece of software on the device. The at
    14·1 answer
  • Which fraction represents the shaded part of this circle? 1 2 O 4 Check Answer /3rd grade/​
    14·2 answers
  • Which of the following class definition defines a legal abstract class Group of answer choices public class Rectangle abstract {
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!