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
Veseljchak [2.6K]
3 years ago
9

Write a Student class in Java which has a name, id_number, year (e.g. 2) and

Computers and Technology
1 answer:
Fittoniya [83]3 years ago
8 0

Answer:

Following are the code in java

public class Student

{

// member variables

String name;

String id_number;

int year ;

String programme_code ;

// default constructor

public student()  //default constructor

{

name="san";

id_number="12";

year =2010;

programme_code="ECE";

}  

 // method to display the member variables of the Student

 public void display() // dispaly the value

{

System.out.println("Name is  : "+name);

System.out.println("ID is  : "+id_number);

System.out.println("Year is  : "+year);

System.out.println("Programme code is : "+programme_code);

  }

public static void main (String[] args) // Main method

{

 Student ob=new Student();

 ob.display(); // calling the method display  

}  

}

Explanation:

In this we create a class "student "  name,id_number, year and  programme_code are the variable after that create a default constructor and initialize the variable and finally display the variable .In the main method we create a object of student class i.e ob ,and call display method  with object ob.

Output:

Name is  :san

ID is  : 12

Year is  :2010

Programme code is : ECE

You might be interested in
Designing a medium to large network requires a combination of technologies and there isn't one "right way." Think about the tech
allochka39001 [22]

Technology allows for easy accessibility, communication and information technology could connect student and faculty computers and servers.

<h3>What is computer networking?</h3>

It is the ability of computers to communicate with one another. It makes use of a communication technology that would allow different computers to be connected to each other.

Technologies that will be used include,

  • Communication technology
  • Information technology

The different types of networking systems that can be used for communication and information include,

  • Local area network
  • Wide area network
  • Computer area network

Local Area Network (LAN):  It is a computer network that can be used in a small confined area such as a school, laboratory, office, or group of buildings.

Thererfore, technologies you would use to connect student and faculty computers, servers, multiple buildings include communication and information technology.

Learn more on technology here,

brainly.com/question/23418761

7 0
2 years ago
Write the definition of a function divide that takes four arguments and returns no value . The first two arguments are of type i
Nastasia [14]

Answer:

#include <iostream>

using namespace std;

void divide(int numerator, int denominator, int *quotient, int *remainder)

{

*quotient = (int)(numerator / denominator);

*remainder = numerator % denominator;

}

int main()

{

int num = 42, den = 5, quotient=0, remainder=0;

divide(num, den, &quotient, &remainder);

 

return 0;

}

Explanation:

The exercise is for "Call by pointers". This technique is particularly useful when a variable needs to be changed by a function. In our case, the quotient and the remainder. The '&' is passing by address. Since the function is calling a pointer. We need to pass an address. This way, the function will alter the value at the address.

To sum up, in case we hadn't used pointers here, the quotient and remainder that we set to '0' would have remained zero because the function would've made copies of them, altered the copies and then DELETED the copies. When we pass by pointer, the computer goes inside the memory and changes it at the address. No new copies are made. And the value of the variable is updated.

Thanks! :)

8 0
3 years ago
The ____ command is used to disconnect a datatable object from the database. (
lisabon 2012 [21]
The delete from command I think
7 0
3 years ago
Read 2 more answers
What is the role of consumers in determining what is produced in a market economy
gregori [183]

Consumer preferences and resource scarcity determine which goods are produced and in what quantity; the prices in a market economy act as signals to producers and consumers who use these price signals to help make decisions.

(i got this from google btw)

hope this helped :) pls give branliest

3 0
4 years ago
Read 2 more answers
Is a web-based architectural approach in which users interact via a web browser or other web-enabled view layer with application
katrin2010 [14]
Hi,

Yes to include real-time interaction between users on website you need more than just raw HTML and CSS. You would need functionality so include JS or .NET framework (C# or VB), you could also add Python, but most of all in order to control user information: Database.

Hope this helps.
r3t40
7 0
3 years ago
Other questions:
  • You work as the Network Administrator for Perfect solutions Inc. The company has a Linux- based Network. You are a root user on
    15·1 answer
  • What is cyber stalking and how does it work?
    7·2 answers
  • What feature is available to add a suggestion in the margin of someone else's document?
    7·1 answer
  • Sometimes when a baby is born they need to be kept in an incubator for a period of time. A manufacturer would like to design a n
    11·1 answer
  • Amazon Web Services and Microsoft Azure are some of the most widely used _______.
    7·1 answer
  • Write a function named "list_concat" that takes a list of strings as a parameter and returns the concatenation of all the values
    13·1 answer
  • Choose the answer. Janice's IT department found that her computer had a program on it that was collecting her personal informati
    5·1 answer
  • Read the steps in the process of making a video.
    5·2 answers
  • _____ are labels for data, while _____ tie values together into one entity.
    15·1 answer
  • 5. Why do we need programming language?​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!