الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

مساعدة في : تصحيح برنامج بلغة الجافا

Featured Replies

بتاريخ:

اذا حبيت اكتب برنامج بلغة الجافا  بحيث انو يطبعها مرتبه تصاعديا كتبت الكود بس كمان بيطلعو اخطاء بليز شوفو وين الخطأ

import javax.swing.*;
public class array {
    
    public static void main(String[] args) {
        
    int x[]=new int[10];  
    
 for(int i=0;i<=x.length;i++)
      x[i]=Integer.parseInt(JOptionPane.showInputDialog("enter the num"));
     
     for(int j=0;j<=x.length;j++)
     
             {
         int    temp=x[i];
             x[i]=x[j];
             x[j]=temp;
         for(int i=0;i<x.length;i++)
        System.out.print(x[i]);
             }
 
    
     
 
    
    }}
بتاريخ:
  • كاتب الموضوع

اذا حبيت اكتب برنامج بلغة الجافا  بحيث انو يطبعها مرتبه تصاعديا كتبت الكود بس كمان بيطلعو اخطاء بليز شوفو وين الخطأ

 

import javax.swing.*;

public class array {

    

    public static void main(String[] args) {

        

    int x[]=new int[10];  

    

 for(int i=0;i<=x.length;i++)

      x=Integer.parseInt(JOptionPane.showInputDialog("enter the num"));

     

     for(int j=0;j<=x.length;j++)

     

             {

         int    temp=x;

             x=x[j];

             x[j]=temp;

         for(int i=0;i<x.length;i++)

        System.out.print(x);

             }

 

    

     

 

    

    }}

بتاريخ:
  • كاتب الموضوع

انا حاولت اصحح الاخطاء الى واجهتني بس كمان مافي فايده ؟؟

بتاريخ:

يوجد method جاهزة تتعامل مع المصفوفة وتعمل sort  لعناصرها 

Arrays.sort(array);
بتاريخ:

الى حضرتك الكود بعد التعديلات

public class Array {
    public static void main(String[] args)
    
    
    {  
        int arr []={3,20,60,7,1,10,80};
      //  int num;
        int temp;
       // arr[num]=Integer.parseInt(JOptionPane.showInputDialog("enter the num"));
            for (int i = 0; i < arr.length; i++)
            {
                     for(int j = i+1; j < arr.length; j++)
                     {
                             if(arr[i] > arr[j ])
                             {
                             temp = arr [j ];
                             arr [j ]= arr [i];
                             arr [i] = temp;
                             }
                     }
            }
            
        System.out.print(" The Sort Array is: ");
            for (int i = 0; i < arr.length; i++)
            {   
              System.out.print(" " + arr[i]);
            }
        System.out.println("");
    }
}
بتاريخ:
  • كاتب الموضوع

شكككرا لك جزيلا بس ليه سويتي تعليق ل // arr[num]=Integer.parseInt(JOptionPane.showInputDialog("enter the num"));

تم تعديل بواسطة اميره بقشان

بتاريخ:

أنا أعطيت قيم المصفوفة في البداية لذلك لم أكن بحاجة الى ان يدخلها المستخدم عن طريق إستخدام JOptionPane.showInputDialog

لذلك عملته تعليق لإني لم أستخدمه 

انا اعطيت القيم ثابته ..وتستطيعين إستخدام JOptionPane.showInputDialog حتى تكون كل مرة القيم مختلفة مثل مايريد المستخدم 

حاولي أن تعملي هكذا مثال وإن لم تستطيعي عملها أساعدك إن شاء الله

بتاريخ:
  • كاتب الموضوع

شكرا كثير لك استطعت بادخال قيم متغيره باستخدام الJOptionPane.showInputDialogجزيل الشكر لك اختي

بتاريخ:

ممتاز ..بالتوفيق 

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.