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
To give your app users the ability to open your app directly from other apps by clicking a link, you should use:.
pickupchik [31]
<span>To give your app users the ability to open your app directly from other apps by clicking a link, you should use:  deep link. With the deep link and its URL functionality, existing app users are driven directly inside the mobile app itself. 
</span>Deep links are usually made up of two parts: a scheme (part of the link that identifies which app to open).<span>and a </span>host and path (<span>the unique location in the app where your content exists).</span>

7 0
2 years ago
A document with a(n) ____ guarantees that the document was indeed sent by a specific individual and that it hasn t been tampered
BARSIC [14]
The answer is A) digital signature
8 0
3 years ago
A characteristic of a 3D model that a 2D model does not have is:
Bas_tet [7]

Answer:

Volume

Explanation:

A characteristic of a 3D model that a 2D model does not have is:

<em>Volume</em>

<em>PLEASE</em><em> </em><em>DO MARK</em><em> </em><em>ME AS</em><em> </em><em>BRAINLIEST UWU</em><em> </em>

3 0
3 years ago
Ideally, how often should you back up the data on your computer? once an hour once a day once a month once a year
AleksAgata [21]
It really depends on your type of data, if it's sensitive data or not. And it also depends on what type of backup (Incremental, Decremental, etc.). But you should aim to backup at least once a week, and also do a backup of your original backup.
6 0
3 years ago
Read 2 more answers
The common channel signaling (CCS) system provides a separate network dedicated to control and signaling over the PSTN. This ena
dezoksy [38]
The correct answer is A.True
8 0
2 years ago
Other questions:
  • Fundamental types of data, such as strings, integers, and real numbers, are known as
    5·1 answer
  • You are asked to optimize a cache design for the given references. Th ere are three direct-mapped cache designs possible, all wi
    7·1 answer
  • Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    10·1 answer
  • What is the most commen code used in games?
    13·1 answer
  • Explain in a few sentences the difference between analytical papers and argumentative papers.
    8·2 answers
  • I stole you pokemon cards :o
    6·2 answers
  • Write a Python program segment, using a loop, to calculate and print the sum of the odd integers from 20 to 120. (Hint: 21 23 25
    13·1 answer
  • Your task is to implement a function replace_once(t, d), that takes a text t and a replacement dictionary d, and returns the res
    10·1 answer
  • Write a method that accepts an integer argument and returns the sum of all the integers from 1 up to (and including) the number
    14·1 answer
  • The terminology used to describe a possible path to resolution to a problem from one end to the other is called what?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!