You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PrinterWorld.java 547B

12345678910111213141516171819202122232425
  1. package de.rohith;
  2. public class PrinterWorld {
  3. private Integer[] intArray = new Integer[2];
  4. public PrinterWorld() {
  5. }
  6. public void print() {
  7. System.out.println("Hello World!");
  8. }
  9. public Integer returnInt() {
  10. return new Integer(3);
  11. }
  12. public Integer[] returnArrayWithCloning() {
  13. for (int i = 0; i < intArray.length; i++) {
  14. intArray[i] = new Integer(i++);
  15. }
  16. return (Integer[])intArray.clone();
  17. }
  18. public Integer[] returnArrayWithoutCloning() {
  19. return intArray;
  20. }
  21. }