Java Engineering Programs Blog

hierarchical clustering program in java

hierarchical clustering program in java

import java.io.*; import java.lang.*; class hclustering { public static void main(String args[])throws IOException { int n,temp; String temp1; DataInputStream in=new DataInputStream(System.in); System.out.println(“Enter no of elements”); n=Integer.parseInt(in.readLine()); String clust1[]=new String[n]; int clust2[]=new int[n]; System.out.println(“Enter elements”);...

k-nearest neighbor program in java

k-nearest neighbor program in java

import java.util.Scanner; class KNN { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n,x1_qi,x2_qi; System.out.print(“Enter no of records in training data set : “); n=sc.nextInt(); int x1[] = new int[n]; int x2[]...

convert string to int java

convert string to int java

Learn Java Programming for Beginners There are Two methods to convert String to integer,first is Using Integer.parseInt() and other is without using Integer.parseInt() method. Method 1: In this method i am using Integer.parseInt(),this method...

Macro Processor program in java

Macro Processor program in java

import java.io.*; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; class macro { public static void main(String args[])throws IOException { int MDTC=1; int MNTC=1; int index=1; int macroindex=0; String arg[]=new String[10]; String mname[]=new String[10]; String MNT...