como saber de que tipo es una variable en java
String myString = "Hola";
double myDouble = 0;
Person myPerson = new Person();
if(myString instanceof String){
System.out.println("Es de tipo String");
}else{
System.out.println("No es de tipo String");
}
if((Object)myDouble instanceof Double){
System.out.println("Es de tipo Double");
}else{
System.out.println("No es de tipo Double");
}
if(myPerson instanceof Person){
System.out.println("Es de tipo Person");
}else{
System.out.println("No es de tipo Person");
}
Also in Java:
- java create file
- number to char java
- declare array java inline
- java set value of arraylist
- Method used for getting metadata of a database in jdbc
- how to select a random element from an array in java
- java 8 collect multiple lists into single list
- best companies to workk in
- java if different ways
- count the number of words in a string java
- instantiate optinal java 8
- java define a generic class that produces
- java enum
- java string to boolean
- how to make int array java android
- java random number
- java prev permutation
- how to make a char uppercase in java
- java connect to mysql
- loop collection android
- change button color java swing
- Java create array of array
- java hello world
- print arraylist java