Results 1 to 9 of 9
Thread: Java
Hybrid View
-
1st February 2011 13:09 #1Registered User
Join Date: Jun:2010
Location:
Posts: 171
Java
java (String ,int) . java
If you understand what you're doing, you're not learning anything.
-
1st February 2011 13:14 #2
, . ( - ) .
| Aorus X570 Master | Ryzen 9 5900X | Hellhound 7900XT | G.SKILL 32GB DDR4 3800 CL16 | Enermax Galaxy 1000W | SSD Corsair MP510 960GB & WD-RE3 2 x 1TB RAID0 | Pioneer BDR-209EBK | Creative X-Fi Titanium Fatal1ty & GigaWorks S750 | ViewSonic VX3276-2K-MHD |
-
1st February 2011 13:51 #3
java.util.* . , Exhumator , .
UD3R|Q9550+1283|4x2 G.Skill@1066|MX500+1002FAEX+640AAKS+ST31 60|RX580-8GB|1841BLT|SS-760XP|Define7|z24i|Edifier S350DB
geniusloci: ) ; ) ; ) ?
nope|r.i.p.
-
1st February 2011 21:43 #4Registered User
Join Date: Jun:2010
Location:
Posts: 171
Code:public class patient { public String fName; public String sName; public int priority; public void set(String fN,String sN,int prior){ fName=fN; sName=sN; priority=prior; System.out.printf("You entered patient %s %s with priority %d",fName,sName,priority); } }Code:import java.util.Scanner; public class glavna { public static void main(String [] args) { Scanner input=new Scanner(System.in); System.out.print("Enter first name: "); String firstName=input.nextLine(); System.out.print("Enter last name: "); String lastName=input.nextLine(); System.out.print("Enter priority: "); int priority=input.nextInt(); public patient[] list=new patient[5]; } }If you understand what you're doing, you're not learning anything.
-
1st February 2011 22:01 #5
public patient[] list=new patient[5];
public , ( ) patient, 1 .MSI X570-A PRO, AMD 5800X3D, Noctua NH-D15, Corsair Vengeance LPX 2x8GB-3600, ASUS RTX ROG 3080 Strix White OC, Samsung 980 Pro 1TB NVMe, Corsair RM750, FD Define R5, Dell 32" 4k G3223Q 144Hz + 3xSamsung G5 32" 144hz, SimLab P1-X, Simucube 2 Pro, HE Ultimate, SRB GT3 Wheel
-
1st February 2011 22:12 #6Registered User
Join Date: Jun:2010
Location:
Posts: 171
, ,
If you understand what you're doing, you're not learning anything.
-
1st February 2011 22:17 #7
:
99 100 ,Code:public patient[] list=new patient[5];
"public" .
Java .
, coding standards.UD3R|Q9550+1283|4x2 G.Skill@1066|MX500+1002FAEX+640AAKS+ST31 60|RX580-8GB|1841BLT|SS-760XP|Define7|z24i|Edifier S350DB
geniusloci: ) ; ) ; ) ?
nope|r.i.p.
-
1st February 2011 23:22 #8Registered User
Join Date: Jun:2010
Location:
Posts: 171
,
Code:public class glavna { public static void main(String [] args) { patient patientObject=new patient(); Scanner input=new Scanner(System.in); System.out.print("Enter first name: "); String firstName=input.nextLine(); System.out.print("Enter last name: "); String lastName=input.nextLine(); System.out.print("Enter priority: "); int priority=input.nextInt(); patient[] list=new patient[5]; list[0]=patientObject.set(firstName, lastName, priority); } }If you understand what you're doing, you're not learning anything.
-
2nd February 2011 04:32 #9
Set input-a .
PatientObject.
, , , ArrayList , java.util .
, , . , .Code:import java.util.ArrayList; public class glavna { public static void main(String [] args) { patient patientObject=new patient(); Scanner input=new Scanner(System.in); System.out.print("Enter first name: "); String firstName=input.nextLine(); System.out.print("Enter last name: "); String lastName=input.nextLine(); System.out.print("Enter priority: "); int priority=input.nextInt(); patientObject.set(firstName, lastName, priority); ArrayList<patient> list = new ArrayList<patient>(); list.add(patientObject); } }
<patient> , . Generics .
, - , - .
, - , delay .Code:public class patient { public String fName; public String sName; public int priority; public patient(String fN,String sN,int prior){ this.fName=fN; this.sName=sN; this.priority=prior; } }
- (, , ), - ( add , -).
- List Array, , .AorusUltra | R9 5950X | 4x8 RoyalZ 3600CL14 | 9600GT (yes)
| Strider 1200 Gold | 55" QLED UHD | Z-5500




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in