Skip to content

Instantly share code, notes, and snippets.

public class Test{
public static void main(String[] args){
int x = 12; // x is 12, a integer
System.out.println(x);
x = "Sugar"; // x is changed to sugar which is a string
System.out.println(x);
}
}
public class Test{
public static void main(String[] args){
int x = 12; // x is 12, a integer
System.out.println(x);
x = 13; // x is changed 13 which is another integer
System.out.println(x);
}
}
Test.java:5: error: incompatible types: String cannot be converted to int
x = "Sugar"; // x is changed to sugar
^
1 error
my_name = "sugar"
num = 20
new_num = 2.6
print(my_name)
print(num)
print(new_num)
num = 20 # the value assigned to the num variable here is a integer
print(num) # this line prints out 20
num = "sugar" # the value has been changed to a float here
print(num) # this line prints out the new value of num which is 'sugar'
int num = 20; // is a integer
float newNum = 2.5; // is a float
string myName = "sugar"; // is a string
System.out.println(num);
System.out.println(newNum);
System.out.println(myName);
public class Test{
public static void main(String[] args){
string y = "sugar"; // y is a string
System.out.println(y);
int x = 12.6; // x is specified as as integer but the value given is a float, the whole program won't run due to this.
System.out.println(x);
}
}
num = 20 # variable containing a integer
print(num) # this line prints out 20
new_num = "sugar" # variable containing a string
print(new_num) # this line prints out sugar
number = num + new_num # integer + string
print(number) # this line prints out an error, you can't add a integer and a string together
@Quadrisheriff
Quadrisheriff / auth0-kong.md
Created August 17, 2022 21:36 — forked from fsargent/auth0-kong.md
JWT Validation with Auth0 and Kong

To get setup with Auth0 and Kong.

Kong is pretty cool. Auth0 is pretty cool. They should work together. This guide details the fastest way to get your APIs protected using JWT tokens issued by Auth0.

Pre-requisites:

  • Create a Auth0 account. Account name is referred to "COMPANYNAME" for the sake of the guide.
  • Setup a Kong instance on your machine. This guide assumes a brand new blank instance.
  • Install httpie - a http command line utility built for humans (unlike curl).