Welcome to Java!

Sort by

recency

|

573 Discussions

|

  • + 0 comments

    My code does the same solution as the question ask to do, but is says that is worng.What is wrong whit my code?

    public class Solution {

    public static void main(String[] args) {
       System.out.println("Hello, Wolrd.");
       System.out.println("Hello, Java.");
    }
    

    }

  • + 0 comments

    am new member where can i start with ?

  • + 0 comments

    simpliest, easiest, and shortest answer

    public class Solution {

    public static void main(String[] args) {
        /* Enter your code here. Print output to STDOUT. Your class should be named Solution. */
        char A = 'A';
        int An = A;
    
        int[] hello = {'H' - An, 'e'-An,'l'-An,'l'-An,'o'-An,','-An,' '-An};
    
        int[] first = {'W'-An, 'o'-An, 'r'-An, 'l'-An, 'd'-An, '.'-An};
        int[] second = {'J'-An, 'a' -An, 'v'-An, 'a'-An, '.'-An};
    
        for(int i = 0; i <2; i++)
        {
                  for(int k = 0; k< hello.length; k++)
                {
                    System.out.print((char)(hello[k]+An));
                }   
    
        if(i == 0)
        {
    
                for(int k = 0; k< first.length; k++)
                {
                    System.out.print((char)(first[k]+An));
                }
         }
         else
         {
                for(int k = 0; k< second.length; k++)
                {
                    System.out.print((char)(second[k]+An));
                }
    
        }
        System.out.println();
        }
    }
    

    }

  • + 0 comments

    public class Hello {

    public static void main(String[] args) {

    System.out.println("Hello, World");
    System.out.println("Hello, Java");
    

    } }

  • + 0 comments

    public static void main(String[] args) {

        System.out.println("Hello, World.\nHello, Java.\n");
                }
    

    } //AS SIMPLE AS THAT