set of methods set of classes that have that set of methods be able to talk to classes with out hierarchy structure … [Read more...] about What are interfaces in java?
Java
What is the difference between preincrementing and postincrementing a variable?
What is a preincrementing variable: PreIncrementing means that the variable is incrementedbefore the expression is evaluated: Example ++J What is a postincrementing variable: Postincremting means that the variable is incremented after the expression: … [Read more...] about What is the difference between preincrementing and postincrementing a variable?
Compare and contrast the if single-selection statement and the while repetition statement?
What is the if single-selection statement in Java: If the single selection is a statement in Java that evaluates to True or False meaning that if the statement results in True the work gets done on the true side if its evaluated false the true side gets ignored and … [Read more...] about Compare and contrast the if single-selection statement and the while repetition statement?
What is a conditional operator in java (?:)
(?:) smiley face with a hat that has a question also known in Java as the conditional operator what is it? The conditional operator can be a replacement of the if else statements in Java for example. (?:) ? --- means its a boolean expression meaning True or … [Read more...] about What is a conditional operator in java (?:)
How to use switch Statement in Java?
import javax.swing.JOptionPane; class cambien { public static void main (String [] args) { String response; response = JOptionPane.showInputDialog ("what is your age?"); if (response == null) { JOptionPane.showMessageDialog … [Read more...] about How to use switch Statement in Java?
How to use if statement to check for empty input box in java?
import javax.swing.JOptionPane; //imports swing class class Practice { public static void main (String [] args) { String response; //creates "respose" string response = JOptionPane.showInputDialog //assignment of response ("what is your first … [Read more...] about How to use if statement to check for empty input box in java?
Java Program Practice with while loop
class Test { public static void main (String [] args) { int x = 0; int y = 0; while ( x < 5 ) { y = y - x; System.out.print (x + "" + y + " "); x = x + 1; } } } … [Read more...] about Java Program Practice with while loop
Java Program Practice
class First { public static void main (String [] args) { int x = 3; while (x > 0) { if (x > 2) { System.out.print("a"); } x = x - 1; System.out.print("-"); if (x == 2) { … [Read more...] about Java Program Practice
Java Data Types
Data Types Storage Size Value Range Byte 8 bits -128 to 127 Short 16 bits -32,768 to 32,767 int 32 bits -2,147,483,648 to 2,147,483,647 long 64 bits -9.2 x 10E15 to 9.2 x 10E15 float 32 bits -3.4 x 10E38 to 3.4 x 10E38 double 64 bits -1.8 x 10E308 to … [Read more...] about Java Data Types
what is a constant?
Constants are very much like a variable in java. It's a placeholder in memory that holds a value that is assigned to it but the twist here is that the value will never be changed. Example of a constant in java. class example { public static void main … [Read more...] about what is a constant?