Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class xd {
- public static void main(String[] args) {
- String a = "ABCDEF";
- String b = "EFGHIJ";
- String c = a.concat(b);
- System.out.println(c);
- System.out.println(a= a.replace("A", "X"));
- System.out.println(a.indexOf(b));
- String e = "Hello";
- String f = "Hello";
- if (e.equals(f)) {
- System.out.println("It's the same");
- } else System.out.println("Not the same");
- char T [];
- T=e.toCharArray();
- System.out.println(T[0]);
- for (int i=0; i<c.length(); i++)
- System.out.println(c.charAt(i));
- }
- }
- public class Test {
- public static void main(String[] args) {
- Personne p1 = new Personne(20, "Mahmoud");
- System.out.println(p1.toString());
- p1.setAge(21);
- System.out.println(p1.getAge());
- Fonctionnaire p2 = new Fonctionnaire(21, "Hajar", 20000);
- System.out.println(p2.toString());
- Personne [] tp;
- tp= new Personne [3];
- tp[0]= new Personne (22, "Banksy");
- tp[1]= new Personne (33, "Hello");
- for (int i=0; i<tp.length; i++){
- tp[i].toString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment