public class Main
{
static void function(){
System.out.println("I am a function!");
}
public static void main(String[] args) {
function();
}
}
//declare a function like this:
void function(int parameter1)
{
//function body
}
//call the function like this:
function(1);
public class MyClass {
static void myMethod() {
System.out.println("You have called me! My name is: myMethod!");
}
public static void main(String[] args) {
myMethod();
}
}
package com.company;
public class Main {
static void one(){ // youCanPutWhatEverNameYouLikeInThePlaceOf"One"
System.out.println("HELLO");
}
public static void main(String[] args) {
one(); //theTerminalShouldSay"HELLO"
}
}
static void myMethod() {
//LINES OF CODE
}
import.java.io.BufferedReader;
public static String IN() {
java.io.BufferedReader d = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
String str = "";
try {
str = d.readLine();
} catch (Exception e) {
e.printStackTrace();
}
return str;
}
String s = "I can has cheezeburger?";
boolean hasCheese = s.contains("cheeze");