Files are the foremost visible and therefore the most precious feature of any computing system to its users. Files provide a mechanism fo...
Read More
Swap two variable values without temp variable
void swap(int x,int y) { x=x+y; y=x-y; x=x-y; }
Read More
How you can force the garbage collection?
Garbage collection automatic process and can't be forced. You could request it by calling System.gc(). JVM does not guarantee that GC...
Read More
Defining an abstract class
Definition:- A class containing abstract method is called Abstract class. An Abstract class can't be instantiated. Examp...
Read More
Difference and similarities between an interface and an abstract class
--> Abstract class is a class which contain one or more abstract methods, which has to be implemented by sub classes. Interfa...
Read More
Difference between private, protected, and public
--> These keywords are for allowing privileges to components such as java methods and variables. Public: accessible to all cla...
Read More
Inheritance
Inheritance is the process by which one object acquires the properties of another object. This shows the hierarchical classificati...
Read More
Constructor
Constructor is used to initialize objects of its class. A constructor initializes an object immedia...
Read More
Methods/Functions
Methods are functions that operate on instances of classes in which they are defined. Objects can ...
Read More
Class
Class is a template for an object. General form of class includes: class classname { ...
Read More
Program for border layout example
import java.awt.*; import java.awt.event.*; import java.applet.*; public class BorderLayoutExample extends Applet { public static...
Read More
Program for component demo
import java.awt.*; import java.applet.*; public class ComponentDemo extends Applet { //Declaring AWT Components TextField txtf...
Read More
Create a frame window within an applet
import java.awt.*; import java.awt.event.*; import java.applet.*; class SampleFrame extends Frame { SampleFrame(String title) ...
Read More
Program for button demo
import java.awt.*; import java.awt.event.*; import java.applet.*; public class BorderLayoutExample extends Applet { public static...
Read More
Taking a closer look towards program
We will have a closer look at program written in last post Compilation and execution: - /* This program welcomes you to the world ...
Read More
Compilation and Execution
As I mentioned in my post regarding Bytecode , compiling and executing a program involves following steps: Step1: Write the source co...
Read More
Data Types
Data type: - A data type is a term that refers to the kind of data that variable may hold in a program. For example: - ...
Read More
Variables and constants
Variable: - An entity that may vary during program execution is called variable. Variable names are names given to memory location. In ...
Read More
Java Applets and applications and servlets
Some of programs that we come across in Java programming. Applet programs. Application programs. Servlet programs. Ap...
Read More
What is Bytecode?
Bytecode enables Java to be a truly object-oriented language. This makes Java different from other languages. As I mentioned in ...
Read More
Subscribe to:
Posts (Atom)