-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQB 736.java
39 lines (31 loc) · 832 Bytes
/
QB 736.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
39
//QB 736
import java.util.Scanner;
class Ex1 {
static int rno;
static String name;
static String clg = "LJU";
public static void main(String[] args) {
Ex1 s1 = new Ex1();
Ex1 s2 = new Ex1();
Ex1 s3 = new Ex1();
s1.method();
s2.method();
s3.method();
s1.display();
s2.display();
s3.display();
}
static void method() {
Scanner sc = new Scanner(System.in);
System.out.println("Enter Roll No.: ");
rno = sc.nextInt();
sc.nextLine();
System.out.println("Enter Name: ");
name = sc.nextLine();
}
static void display() {
System.out.println("Roll No. is " + rno);
System.out.println("Name is " + name);
System.out.println("College name is " + clg);
}
}