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
What is the wave speed of a wave that has a frequency of 100 Hz and a wavelength of 0.30m?
swat32

<u><em>Answer:</em></u>

<u><em>The speed is  </em></u>

<u><em>= </em></u>

<u><em>30 </em></u>

<u><em>m </em></u>

<u><em>s </em></u>

<u><em>− </em></u>

<u><em>1 </em></u>

<u><em> </em></u>

<u><em>Explanation: </em></u>

<u><em>The speed of a wave is given by </em></u>

<u><em> </em></u>

<u><em>speed </em></u>

<u><em>( </em></u>

<u><em>m </em></u>

<u><em>s </em></u>

<u><em>− </em></u>

<u><em>1 </em></u>

<u><em>) </em></u>

<u><em>= </em></u>

<u><em>frequency(Hz) </em></u>

<u><em>× </em></u>

<u><em>wavelength (m) </em></u>

<u><em> </em></u>

<u><em>The frequency is  </em></u>

<u><em>f </em></u>

<u><em>= </em></u>

<u><em>100 </em></u>

<u><em>H </em></u>

<u><em>z </em></u>

<u><em> </em></u>

<u><em>The wavelength is  </em></u>

<u><em>λ </em></u>

<u><em>= </em></u>

<u><em>0.3 </em></u>

<u><em>m </em></u>

<u><em> </em></u>

<u><em>The speed is </em></u>

<u><em> </em></u>

<u><em>v </em></u>

<u><em>= </em></u>

<u><em>λ </em></u>

<u><em>f </em></u>

<u><em>= </em></u>

<u><em>0.3 </em></u>

<u><em>⋅ </em></u>

<u><em>100 </em></u>

<u><em>= </em></u>

<u><em>30 </em></u>

<u><em>m </em></u>

<u><em>s </em></u>

<u><em>− </em></u>

<u><em>1 </em></u>

<u><em> </em></u>

<u><em></em></u>

<u><em></em></u>

<u><em></em></u>

6 0
3 years ago
Can anyone help me with these assignments??? Hands On Assignments- Insertion of Symbols, Special Characters, and Images.... and
Alekssandra [29.7K]

Answer:

yes send me the worksheet

Explanation:

5 0
3 years ago
Is designed to access a computer or operating system without the knowledge or permission of the user.
kramer

Answer:

Spyware

Explanation:

Spyware is a type of program that is installed with or without your permission on your personal computers to collect information about users, their computer or browsing habits tracks each and everything that you do without your knowledge and send it to remote user.

5 0
2 years ago
What is the user requirements of an educational app
VARVARA [1.3K]
Ummmmm I don’t know but I wanna know now.....
7 0
3 years ago
Tower of Hanoi algorithm 4 disks
Sophie [7]
????is this a question
4 0
3 years ago
Read 2 more answers
Other questions:
  • Henry has to create software that manages a database of all his clients of his firm. He wishes to run software on another comput
    10·2 answers
  • The theory of continental drift suggests that at one time,
    15·2 answers
  • The official record of a high school student's performance is called:
    6·1 answer
  • _____ are likely to support bigger government, social welfare programs, and legalized abortion.
    8·2 answers
  • If a user wants to add an expansion card to increase the memory of a computer, where should the user insert the card?
    12·2 answers
  • The computer output for integer programs in the textbook does not include reduced costs, dual values, or sensitivity ranges beca
    14·1 answer
  • Explain in a few sentences the difference between analytical papers and argumentative papers.
    8·2 answers
  • If you wanted to look up an article from the Chicago Tribune the best place to start would be
    7·1 answer
  • Importance of computer education​
    9·1 answer
  • What are some signs that could help you determine that a date and time was inserted as a special object instead of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!