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]
2 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]2 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
What is the purpose of the literature review section of research paper
navik [9.2K]

variation of colored sediment

5 0
3 years ago
The director of HR realizes that the KSAs currently used for hiring entry-level engineers are outdated. In order to establish wh
Vaselesa [24]

Answer:

Job analysis

Explanation:

The HR should preferably use job analysis.

6 0
3 years ago
What is the abuse of electronic messaging systems to indiscriminately send unsolicited bulk messages, many of which contain hoax
Ilya [14]

I think the answer is spam
5 0
2 years ago
What is the best definition for a relationship?
velikii [3]

Answer:

special instance of a dataset

7 0
3 years ago
How to make a Tip Calculator in code?
ki77a [65]
You should have the percentage of tip based on the service that you received.
Then you multiply the percentage of tip by the amount of money that you have to pay for what you bought.
4 0
3 years ago
Other questions:
  • What car dealership websites did you use to conduct your research?​
    8·1 answer
  • The equation of certain traveling waves is y(x.t) = 0.0450 sin(25.12x - 37.68t-0.523) where x and y are in
    14·1 answer
  • You are provisioning a server with eight-core 3 GHz CMP that can execute a workload with an overall CPI of 2.0 (assuming that L2
    5·1 answer
  • Why is television reactive, requiring no skills or thinking
    11·1 answer
  • Jennifer recently bought a new computer to type a new manuscript she’s been working on. She also stored a lot of movies on it to
    10·1 answer
  • The communication channel used in IMC must rev: 12_06_2018_QC_ CDR-223 Multiple Choice match the traditional channel used in tha
    14·1 answer
  • List three tacos there are several from the opening page of the help and support center.
    5·1 answer
  • When you use a business class with an object data source, the business class Group of answer choices must have attributes that m
    5·1 answer
  • B) The company's chief financial officer recognizes the need for an upgrade to the smart watches, but does not understand why th
    8·1 answer
  • A homeowner uses a smart assistant to set the house alarm, get packages delivery updates, and set time on the outdoor lights. Wh
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!