Questions tagged [composite]

The Composite pattern is a design pattern that allows a group of objects to be treated in the same way as a single instance of an object. It is one of the Gang of Four's structural design patterns.

Overview

The Composite pattern is a design pattern that allows a group of objects to be treated in the same way as a single instance of an object.

It is one of the Gang of Four's structural , first published in Gamma et al.'s book "Design Patterns: Elements of Reusable Object-Oriented Software".

The Composite pattern may sometimes coincide with the use of composite data types and composite variables.

See also

979 questions
-5
votes
1 answer

Classifying a range of numbers as either prime or composite

Write source code that classifies all numbers from 2 to 20 as being either a composite number or a prime number. I am only able to do a code where it's only one number not a range of numbers num=2 if num > 1: for i in range(2, int(num/2)+1): …
-5
votes
3 answers

Method to check whether a number is prime or composite

public boolean isPrimeNum (int n) { boolean isPrime= true; for( int i=2; i<= n; i++) { if( n%i==0) { isPrime= false; } isitPrime= true; if(isPrime) System.out.println("its a prime number"); else …
LipstickQueen
  • 19
  • 1
  • 1
  • 3
-5
votes
1 answer

getting error on generating gwt charts in composite?

I am developing application on GWT . i want to generate pie charts on gwt composite. i am using Google's Chart Tools API Library for GWT for it . i have also imported gwt visualization jar in the project. i also have inherited it in gwt.xml. i am…
-6
votes
1 answer

Java multiple inputs lead to an exception

When I input in in a "1 2" format it gives error if in "1 enter 2" It gives error I'm tasked to create a lambda that has a function that deals with knowing what the user input is. The user would chose to determine either odd, even, prime, composite…
1 2 3
65
66