1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

1-D arrays in Java

Discussion in 'Java' started by itzkloive, Mar 23, 2008.

  1. itzkloive

    itzkloive New Member

    Joined:
    Mar 23, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    electronic
    Location:
    NJ
    I am kinda teaching myself java and got stuck trying to create a a program to translate 10 words bi-directional from english to spaniah, using two different String Arrays one consist of english words and one consist of spanish words. Can someone help this novice out?


    import java.io.*;//tell Java we are using java.io libary.
    import java.util.*;//Java utility package also for Scanner class

    public class transWords //Naming the program.
    {

    public static void main(String[ ]args)throws Exception
    {
    //This set-up allow for user to input using keyboard.
    Scanner input= new Scanner(System.in);


    //Declaring Array String.
    String[]englishTrans={"color","white","blue","green","black","purple",};
    //Declaring Array String.
    String[]spanishTrans={"en color","blanco","azul","verde","negro","purp├║reo",};
     

Share This Page