Uncategorized

Java Font Example

Java AWT supports graphics drawing in colors and fonts. To support colors and fonts, the Java.awt package come with two classes – class Color and class Font. Java Font Example to create font objects and changing change string fonts.

Output Screenshot on Java Font Example Font f1 = new Font(“Monospaced”,…

Java Made Simple: Create Checkbox Example

Checkbox Example tutorial is given in Question/Answer format for easy understanding. 1. What is Checkbox? Checkbox is one of the GUI components Java supports. 2. When Checkbox is preferred by the Programmer? Checkbox is used when the user has got only two options to choose in between like Yes or…

Java Interface Inheritance

Java Interface Inheritance – Example – Explanation – Screenshot – Simple terms for a Beginner Interfaces were introduced by the Java Designers to support multiple inheritance. Not only that, interfaces give a template methods from which new classes can be developed easily. Interface gives plan of methods required to achieve…

Java Scanner class

To make coding less, the Designers introduced java.util.Scanner (Scanner is not from java.io package) in Java 5. Earlier to Java Scanner class, keyboard input was taken using DataInputStream and BufferedReader, both requiring extra code of parsing the user input. Java Scanner avoids parsing. Example on Java Scanner taking Keyboard input…

Java Method Example

A method in Java, like a function in C/C++ (in fact, a function of C/C++ is called a methods in Java), embeds a few statements. A method is delimited (separated) from the remaining part of the code by a pair braces. Method increases reusability. When the method is called number…

Get Super classes of a Class Java Reflection API

It is advised to read the notes on Java Reflection API before attempting the programs. Example to get super classes of a class with Java Reflection API