Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String []args){
- String[] words = new String[3];
- words [0] = "Hello";
- words[1] = "to";
- words[2] = "you";
- System.out.println(words[0]);
- System.out.println(words[1]);
- System.out.println(words[2]);
- String[] fruits = {"apple", "banana" , "pear", "kiwi"};
- System.out.println(fruits[0]);
- System.out.println(fruits[1]);
- System.out.println(fruits[2]);
- System.out.println(fruits[3]);
- for (String fruit: fruits){
- System.out.println(fruit);
- }
- int value = 0;
- String text = null;
- System.out.println(text);
- String[] texts = new String[2];
- System.out.println(texts[0]);
- texts[0] = "one";
- System.out.println(texts[0]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement