Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 632 Bytes

java.md

File metadata and controls

41 lines (30 loc) · 632 Bytes

Java

Initial Beginning

import java.util.Scanner; // Dont forget the ";"

public class class_name {
    public static void main(String[] args){

        Scanner inp = new Scanner(System.in);
        System.out.print("? ");
        String x = inp.nextLine();
        String x = inp.nextInt();

        // code here

    } // end of main{}
} // end of class{}

Basic Functions

  1. Print on console
System.out.print();
System.out.println();
  1. Get User Input
Scanner inp = new Scanner (System.in);
// Declare variable <= input
String x = inp.nextLine();
// ...
  1. if - else