Results 1 to 9 of 9

Thread: Java

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered 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.

  2. #2
    Exhumator's Avatar
    Join Date: Jan:2005
    Location: Sofia
    Posts: 14,687
    , . ( - ) .
    | 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 |

  3. #3
    System.gc()'s Avatar
    Join Date: Apr:2007
    Location: back in time
    Posts: 1,075
    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.

  4. #4
    Registered 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.

  5. #5
    Street Racer Rain9333's Avatar
    Join Date: Feb:2007
    Location: Bg, Gb
    Posts: 824
    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

  6. #6
    Registered User
    Join Date: Jun:2010
    Location:
    Posts: 171
    , ,
    If you understand what you're doing, you're not learning anything.

  7. #7
    System.gc()'s Avatar
    Join Date: Apr:2007
    Location: back in time
    Posts: 1,075
    :
    Code:
    public patient[] list=new patient[5];
    99 100 ,
    "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.

  8. #8
    Registered 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.

  9. #9
    shaderwiz Phaser's Avatar
    Join Date: Jul:2004
    Location: Denmark
    Posts: 1,454
    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 .

    , - , - .

    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;
    		
    	}
    	}
    , - , delay .

    - (, , ), - ( add , -).

    - List Array, , .
    AorusUltra | R9 5950X | 4x8 RoyalZ 3600CL14 | 9600GT (yes) | Strider 1200 Gold | 55" QLED UHD | Z-5500

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |