-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQB 711.java
38 lines (31 loc) · 886 Bytes
/
QB 711.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//QB 711
import java.util.Scanner;
class Ex1 {
int rno;
String name;
double mark;
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter Roll no. ");
int rno=sc.nextInt();
sc.nextLine();
System.out.println("Enter Name");
String name= sc.nextLine();
System.out.println("Enter marks ");
double mark = sc.nextInt();
Ex1 ab = new Ex1(rno,name,mark);
ab.display();
}
Ex1(int rno, String name, double mark) {
this.rno = rno;
this.name = name;
this.mark = mark;
}
void display() {
System.out.println("Student Details");
System.out.println("Roll No.is " + this.rno);
System.out.println("Name is " + this.name);
System.out.println("Marks is " + this.mark);
}
}