butbanksy

Untitled

Feb 14th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. public class xd {
  2. public static void main(String[] args) {
  3. String a = "ABCDEF";
  4. String b = "EFGHIJ";
  5. String c = a.concat(b);
  6. System.out.println(c);
  7. System.out.println(a= a.replace("A", "X"));
  8. System.out.println(a.indexOf(b));
  9. String e = "Hello";
  10. String f = "Hello";
  11. if (e.equals(f)) {
  12. System.out.println("It's the same");
  13. } else System.out.println("Not the same");
  14. char T [];
  15.  
  16. T=e.toCharArray();
  17. System.out.println(T[0]);
  18. for (int i=0; i<c.length(); i++)
  19. System.out.println(c.charAt(i));
  20.  
  21. }
  22.  
  23. }
  24.  
  25.  
  26.  
  27. public class Test {
  28. public static void main(String[] args) {
  29. Personne p1 = new Personne(20, "Mahmoud");
  30. System.out.println(p1.toString());
  31. p1.setAge(21);
  32. System.out.println(p1.getAge());
  33.  
  34. Fonctionnaire p2 = new Fonctionnaire(21, "Hajar", 20000);
  35. System.out.println(p2.toString());
  36.  
  37. Personne [] tp;
  38. tp= new Personne [3];
  39. tp[0]= new Personne (22, "Banksy");
  40. tp[1]= new Personne (33, "Hello");
  41. for (int i=0; i<tp.length; i++){
  42. tp[i].toString();
  43. }
  44.  
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment