Archive for 2015

Inner Classes

Sunday, 5 July 2015
Posted by Unknown
class Outer  {      int outer_x = 100;     void test()       {          Inner...
class Stack {     private int stck[];     private int tos;     // allocate and initialize stack     Stack(int size)      ...
import java.util.Stack;class TestStack  {      public static void main(String args[])        {           ...
class Factorial  {      int fact(int n)       {           int result;          ...
class ContinueLabel  {     public static void main(String args[])       {         outer: for (int i=0; i<10;...
class Continue  {     public static void main(String args[])       {          for(int i=0; i<10; i++)           ...

Nested for Loops

Posted by Unknown
Tag :
class Nested  {     public static void main(String args[])       {        int i, j;       ...

Display Hello world using simple Applet Program

Thursday, 2 July 2015
Posted by Unknown
Tag :
import java.applet.Applet; public class applet extends Applet {     public void paint(Graphics g)     {         g.drawString("Hello...
import java.applet.Applet;import java.awt.Graphics;public class applet extends Applet {    @Override    public void paint(Graphics g)      {         ...
import java.applet.Applet;import java.awt.Graphics;public class applet extends Applet {    @Override    public void paint(Graphics g)      {        ...
import java.applet.Applet;import java.awt.Graphics;public class applet extends Applet {       public void paint(Graphics g)        ...
import java.applet.Applet;import java.awt.Graphics;public class applet extends Applet {       public void paint(Graphics g)         {           ...
import java.applet.Applet; import java.awt.Graphics; public class applet extends Applet {       public void paint(Graphics g)        {          ...
import java.applet.Applet; import java.awt.Graphics; public class applet extends Applet {     public void paint(Graphics g)      {        ...

Draw Lines using Applet

Posted by Unknown
Tag :
import java.applet.Applet; import java.awt.Graphics; public class applet extends Applet {     public void paint(Graphics g)      {        ...

String methods

Sunday, 28 June 2015
Posted by Unknown
class StringDemo {public static void main (String args[]){String str = "I am vijay";System.out.println("The string is: " + str);System.out.println("The string in upper case: " + str.toUpperCase());System.out.println("Length...
class arithmetic{    public static void main(String args[])     {        short x = 8;        int...

Print Odd Numbers

Posted by Unknown
Tag :
class printOdd {     public static void main(String args[])     {         for(int x=1; x<10; x=x+2)        ...

Print Even Numbers

Posted by Unknown
Tag :
class printEven{    public static void main(String args[])     {        for(int x=0; x<10; x=x+2)        ...

The for Loop

Posted by Unknown
Tag :
Syntax: for(initialization; condition; iteration)  statement; Program: class printNumber{    public static void main(String args[])     {       ...
Syntax: if(condition 1) statement 1; else if (condition 2) statement 2; else if (condition 3) statement 3; else  statement 4; Grade System Program: import java.util.Scanner; class result...
Syntax: if(condition) statement 1; else statement 2; Program: import java.util.Scanner; class result {     public static void main(String[] args)     {           ...
Syntax: if(condition) statement; Program: import java.util.Scanner; class result {     public static void main(String[] args)     {           ...
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;class palindrome{     public static void main(String[] args)    {       ...
  import java.io.BufferedReader; import java.io.InputStreamReader; class Reverse {     public static void main(String[] args)     {        ...
import java.util.Scanner;class fibonacci{   public static void main(String[] args)    {        System.out.print("Enter the number to display fibonicci...
import java.util.Scanner;class pyramidShape {  public static void main(String[] args)   {     System.out.print("Enter number of rows: ");     Scanner...
import java.util.Scanner;class diamondShape {      public static void main(String[] args)    {        System.out.print("Enter...
Sender Side Program import java.io.*; import java.net.*; class slidingSender {     public void process()     {         try    ...
Multicast Sender import java.net.*; import java.io.*; class MulticastSender implements Runnable {     static int port;     static MulticastSocket ms;    ...
  import java.io.*;class ShortPath{     public int vertex;    public int edge;    public int arrval[][]=new int[10][10];    public...
Client Side Program import java.io.*; import java.net.*; class TCPClient {   public static void main(String args[]) throws Exception   {        String sentence;...
Welcome to My Blog

Translate

Popular Post

Total Pageviews

- Copyright © 2025 Learning Java Program - Powered by Blogger -