1/12
REVIEW
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Create an Array
type[] array name = { values, values};
Find Array length
arrayname.length;
Get an index of array
arrayname[index#];
set Array index
arrayname[index#]=value;
Traverse through Array
for (int i = 0; i<arrayname.length; i++)
{
// action or code
}
Create ArrayList
ArrayList<Type> array name= new ArrayList<type>();
Add or Remove in Arraylist
Add: arraylist.add(value);
Remove: arraylist.remove(index #);
Find Arraylist size
arraylist.size();
Set Arraylist index
arraylist(index#, value);
Get Arraylist index
arraylist.get(index#);
Traverse through Arraylist
for(int i = 0; i<arraylist.size(); i++)
Comparing Strings
String str1= "hello";
String str2= "hello";
str1.equalsl (str2)
☆ .equals() ☆
Math in Coding
Math.abs(x)
Math.max(x,y)
Math.min(x,y)
Math.pow(x,y)
Math.random()