100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary IEB IT Java Notes $8.97   Add to cart

Summary

Summary IEB IT Java Notes

1 review
 87 views  1 purchase
  • Course
  • Institution

This document outlines approaches to everything required for the IEB IT Java Practical Examination. These notes were developed by a candidate in the Top 1% in the IEB for Information Technology in 2020.

Preview 2 out of 5  pages

  • July 26, 2022
  • 5
  • 2020/2021
  • Summary
  • 200

1  review

review-writer-avatar

By: ulrichvh66 • 1 year ago

avatar-seller
Java Coding Notes

Typecasting
String → int
int num = Integer.parseInt (Str);

String → double
double num = Double.parseDouble (Str);

double → int
int intNum = (int) dblNum;

int → double
double dblNum = intNum;

int → char (Converts to ASCII Value)
char ch = (char) intNum;

char → int (Converts to ASCII Number)
int intNum = (int) ch;

int → String
String str = “ ” + intNum;

double → String
String str = “ ” + dblNum;

String → char
char ch = str.charAt(index);
.toUpperCase() or .toLowerCase()

char → String
String str = “ ” + ch;

Formatting and Arithmetic
Constants / Finals:
public/private static final <type> <name> = <value>;

Useful Tools:
String.format("%.2f", <double>); round off to 2 decimals
System.arraycopy (<sourceArr>, <sourcePos>, <destArr>, <destPos>, <size>); copy
part of an array into another array

Math Class:
Square Root: Math.sqrt (x)
Raise to Power: Math.pow (x, exponent)
Round off: Math.round (x)
Absolute Value: Math.abs (-x)
Random Number: Math.random () * (max) + (start)

Nikhar Ramlakhan © Page 1 of 5

, Java Coding Notes

Array Handling
Declaring an array:
[variable type] [variable name] [] = new [variable type] [size];


Inputting an array with a known amount of values:
int array [] = new int [10];
for (int loop = 0; loop < 10; loop++){
array [loop] = [input method];
}//end for loop

Inputting an array with an unknown amount of values:
int count = 0;
String wrdArr [] = new String [10]
wrdArr [count] = [input method];
while (!wrdArr [count].equalsIgnoreCase (“stop”)){
count++;
wrdArr [count] = [input method]
}//end while loop

Displaying an array:
for (int loop = 0; loop < [size]; loop++){
System.out.println (array [loop]);
}//end for loop


Inserting into an array:
public void shiftRight (int insertPos, String newString){
for (int loop = size; loop > insertPos; loop--){
stArr [loop + 1] = stArr [loop];
}//end for loop
stArr [insertPos] = newString;
size++;
}//shiftRight insert method

Deleting from an array
public void shiftLeft (int removePos){
for (int loop = removePos; loop < size; loop++){
stArr [loop] = stArr [loop + 1];
}//end for loop
size--;
}//shiftLeft delete method
Or you can just override the deleted array index with the last index and call a
sort method.



Nikhar Ramlakhan © Page 2 of 5

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller NikharRamlakhan. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $8.97. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

78600 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$8.97  1x  sold
  • (1)
  Add to cart