Giter VIP home page Giter VIP logo

fz-aoc-java1's Introduction

POST TEST

Java Basic

  1. Apakah Java merupakan singkatan dari JavaScript?

    Tidak
    
  2. Bagaimana menuliskan variabel dengan angka bernilai 7?

    int = 7;
    
  3. Bagaimana perintah untuk menampilkan output “Hello World”?

    System.out.println("Hello World");
    
  4. Bagaimana penulisan kode untuk menampilkan output angka 1 hingga 29?

      int num = 0;
    
         do {
             num++;
             System.out.println(num);
         } while (num < 29);
    
  5. Indeks pada array pada Java dimulai dari?

    pada index 0
    
  6. Bagaimana penulisan kode untuk menampilkan output Nama Anda. Jika terdapat range 1-100 bilangan dan ketika angka merupakan kelipatan dari tanggal hari ini, maka yang tampil adalah Nama Anda, selain dari itu adalah angkanya?

    import java.time.LocalDateTime;
    
     public class App {
         public static void main(String[] args) {
    
         String myName = "Hazpi Nurafgan";
         int i = 0;
         while (i < 100) {
             i++;
             if ((i % LocalDateTime.now().getDayOfMonth()) == 0) {
                 System.out.println(myName);
             } else {
                 System.out.println(i);
             }
    
         }
         }
    
     }
    
  7. Bagaimana penulisan untuk membuat method pada Java?

        <!-- 
        AccessModifier TipeData nameMethod(tipeDataParams nameParams){
            // code...
        } 
        -->
    
        example :
          public int sumNum(int x, int y) {
            return x + y;
        }
    
  8. Bagaimana perintah untuk memanggil method pada Java?

    public class App {
        public static void main(String[] args) {
    
            App app = new App();
            System.out.println(app.sumNum(5, 5));
        }
    
        public int sumNum(int x, int y) {
            return x + y;
        }
    
    }
    

fz-aoc-java1's People

Contributors

hazgan12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.