Sort by

recency

|

147 Discussions

|

  • + 0 comments

    import java.util.*;

    class Student {} class Rockstar {} class Hacker {}

    public class InstanceOFTutorial { static String count(ArrayList mylist) { int a = 0, b = 0, c = 0; for (int i = 0; i < mylist.size(); i++) { Object element = mylist.get(i);

            if (element instanceof Student) // 
                a++;
            if (element instanceof Rockstar) // 
                b++;
            if (element instanceof Hacker) // 
                c++;
        }
        String ret = Integer.toString(a) + " " + Integer.toString(b) + " " + Integer.toString(c);
        return ret;
    }
    
    public static void main(String[] args) {
        ArrayList mylist = new ArrayList();
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        for (int i = 0; i < t; i++) {
            String s = sc.next();
            if (s.equals("Student")) mylist.add(new Student());
            if (s.equals("Rockstar")) mylist.add(new Rockstar());
            if (s.equals("Hacker")) mylist.add(new Hacker());
        }
        System.out.println(count(mylist));
    }
    

    }

  • + 0 comments

    the SASSA status check is much more than a simple tool for tracking grant applications. It has become a cornerstone of efficiency, transparency, and accessibility within South Africa’s social welfare system. By enabling real-time access to information, reducing errors, ensuring timely payments, and empowering applicants, it contributes to a more inclusive, streamlined, and accountable social security framework Sassa status check. The system’s ability to adapt to new technological advancements, while still providing support for all beneficiaries, makes it a crucial part of the country's efforts to ensure that social grants are delivered fairly and effectively.

  • + 0 comments

    import java.util.*;

    class Student{} class Rockstar{ } class Hacker{}

    public class InstanceOFTutorial{

    static String count(ArrayList mylist){ int a = 0,b = 0,c = 0; for(int i = 0; i < mylist.size(); i++){ Object element=mylist.get(i); if(element instanceof Student) a++; if(element instanceof Rockstar) b++; if(element instanceof Hacker) c++; } String ret = Integer.toString(a)+" "+ Integer.toString(b)+" "+ Integer.toString(c); return ret; }

    public static void main(String []args){ ArrayList mylist = new ArrayList(); Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i=0; i

  • + 0 comments

    While Rummy involves a great deal of quick thinking, it also requires foresight and strategic planning. Players must not only consider their immediate moves but also anticipate what might happen several turns down the line. In particular, creating and maintaining sequences or sets requires a balance between the current hand and future possibilities https://cardrummy.app/ . Strategic thinking in Rummy encourages players to think in the long term, weighing different options and considering the potential outcomes of each decision. These strategic planning skills are transferable to real-world scenarios, such as in business or personal projects, where foresight and careful decision-making can lead to greater success.

  • + 0 comments

    static String count(ArrayList mylist){ int a = 0,b = 0,c = 0; for(int i = 0; i < mylist.size(); i++){ Object element=mylist.get(i); if(element instanceof Student) a++; if(element instanceof Rockstar) b++; if(element instanceof Hacker) , program is correct and output also correct but test case not passed c++; }

            my