-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram46.java
More file actions
51 lines (37 loc) · 1.25 KB
/
Copy pathprogram46.java
File metadata and controls
51 lines (37 loc) · 1.25 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
// Create a Mobile class and print its specifications.
class Mobile{
String name;
int price;
String processor;
int Memory;
int Memory2;
int camera1;
int camera2;
int battery;
String software;
void displayDetails(){
System.out.println("Name : " + name);
System.out.println("Price : " + price + "Rs.");
System.out.println("Processor : "+ processor);
System.out.println("Memory : " +Memory + " GB RAM");
System.out.println("Storage : " + Memory2 + " GB Storage");
System.out.println("Battery : " + battery + " mAH");
System.out.println("Cameras : " + camera1 + " MP Rear " + camera2 + " MP Front ");
System.out.println("Software : " + software);
}
}
public class program46 {
public static void main(String[] args) {
Mobile m1 = new Mobile();
m1.name = "Samsung Galaxy S25 Ultra";
m1.Memory = 12;
m1.Memory2 = 256;
m1.battery = 5000;
m1.camera1 = 200;
m1.camera2 = 12;
m1.price = 91599;
m1.processor = "Snapdragon 8 Elite, Octa Core, 4.47 GHz";
m1.software = "Android 15";
m1.displayDetails();
}
}