Friday 16 June 2017

How to Create a Basic Java Applet in NetBeans

Program:

package JavaCoders;
/**
 *
 * @author Bsb
 */
import java.applet.Applet;
import java.awt.Graphics;
public class applet_example extends Applet

{

Thursday 15 June 2017

Program in java to check if two Strings are Anagram or not

Anagram program in java

Program:

package JavaCoders;
import java.util.Arrays;
public class Anagram
{
void ana(String s1,String s2)
{
String st1=s1.replaceAll("\\s", "");
String st2=s2.replaceAll("\\s", "");
boolean b=true;
if(st1.length()!=st2.length())

How to print sum of even numbers in java

Program:

package JavaCoders;
import java.util.Scanner;
/**
*
* @author Bsb
*/
class even_sum
{
public static void main(String[] args)
{
int i;
int sum=0;
System.out.println("Enter the number upto you want to sum:");
Scanner sc=new Scanner(System.in);
int num=sc.nextInt();
for(i=1;i<=num;i++)


Tuesday 13 June 2017

How to reverse string in java

Program:

package JavaCoders;

import java.util.Scanner;
public class rev_string
{
public static void main(String[] args)
{
String str1="";
String str2="";
System.out.println("Enter the string to be reversed:\n");
Scanner scn=new Scanner(System.in);
str1=scn.next();
for(int i=str1.length()-1;i>=0;i--)
{
str2=str2+str1.charAt(i);
}
System.out.println("Reversed String is: "+str2);
}
}

OUTPUT:

How-to-reverse-string-in-java

You can also go to link that ellaborate it more:

Monday 12 June 2017

Simple Program of Typecasting in java

Simple Program of Typecasting in java Program:

package JavaCoders;
class Conversion
{
public static void main(String[] args)
{
String x="20000";
int a=67;
short b;
long c;
float d;
double e;
char f;
String z;
b=(short)a;
c=a;
d=a;
e=a;
f=(char)a;

Tutorial of JSP AJAX

AJAX INTRODUCTION :

Ajax stands for Asynchronous JavaScript and XML. Basically Ajax is not a programming language but it is a technique for using JavaScript. Basic features of Ajax are:

1. You can download any file in the background process from the web server.
2. User can dynamically update any page without the waiting by the user.
3. Web pages can be easily updated without reloading the current page.
4. It can request date from the server after the page has been loaded.
5, It can receive data from the server after the page has been loaded.
6. It can send the data to the server at the background.
7. Ajax is a web browser technology independent of web server software.
8. To get the data from the server you don't even have to click the button, you can just move your mouse for the action.

XMLHttpRequest Object:
XMLHttpRequest is the object to get the data from the server, it can get the information from the server without reloading the page.

Creating XMLHttpRequest Object: Basically all the browsers have built-in XMLHttpRequest Object. The syntax for creating XMLHttpRequest Object is:

var h= new XMLHttpRequest();

Saturday 3 June 2017

Java Program to display current date and time

Program to display current date and time in java:

Post By: Balwant Singh

package kuw_ord.test;
import java.util.*;
public class date
{
public static void main(String[] args)
{
Date bs=new Date();
System.out.println(bs.toString());

}

}

Oracle / PLSQL: FOR LOOP

set serveroutput on; declare a1 varchar2(100); begin select count(*) into a1 from employees; for i in 1..a1 loop dbms_output.put_line...