Sunday, 30 December 2018
Sunday, 4 November 2018
Code For add item in jcomboBox At Runtime : jcombobx tutorial
ADD Item in JcomboBox
By using addItem(String item)
For Example :
jComboBox1.addItem(addValue);
where
jComboBox1 : object of JComboBox
and
addValue : value which we want to insert into jcombobox
For Video Open Link : ADD Item in JComboBox --video
Saturday, 27 October 2018
square root of number in java Example | sqrt() function in java
/* java program to find square root of a Number */
class MathDemo{
public static void main(String args[]){
// values for square root
double a = 144;
double b = 9;
//result of square root
System.out.println("\nSquare root of 144 is : "+Math.sqrt(a));
System.out.println("\n Squre root of 9 is : "+Math.sqrt(b));
}
}
o/p
Square root of 144 is :12
Square root of 9 is : 3
class MathDemo{
public static void main(String args[]){
// values for square root
double a = 144;
double b = 9;
//result of square root
System.out.println("\nSquare root of 144 is : "+Math.sqrt(a));
System.out.println("\n Squre root of 9 is : "+Math.sqrt(b));
}
}
o/p
Square root of 144 is :12
Square root of 9 is : 3
Friday, 26 October 2018
How to Convert Double To String in JAVA Example
/* JAVA Program of Convert Double To String (Java Converion )*/
class ConversionDemo{
public static void main(String args[]){
//method 1 using valueOf Method
double value = 222.02;
String str = String.valueOf(value); // converion
System.out.println("using valueOf Method :"+str);
// method 2 using toString method
double dval = 303.04
String str2 = Double.toString(dval); //converion
System.out.println("Conversion Using toString Method :"+str2);
}
}
class ConversionDemo{
public static void main(String args[]){
//method 1 using valueOf Method
double value = 222.02;
String str = String.valueOf(value); // converion
System.out.println("using valueOf Method :"+str);
// method 2 using toString method
double dval = 303.04
String str2 = Double.toString(dval); //converion
System.out.println("Conversion Using toString Method :"+str2);
}
}
Sunday, 21 October 2018
isalnum() function in C programming - ctype.h library function
/* write a C program to check Enter character is Alphanumeric or Not */
#include<stdio.h>
#include<conio.h>
#include<ctype.h> // library for islower function must require it
void main()
{
char c;
printf("Enter character : ");
scanf("%c",&c);
if(isalnum(c)==0)
printf("Enter character is Not alphanumeric character");
else
printf("Enter character is alphanumeric character");
getch();
}
#include<stdio.h>
#include<conio.h>
#include<ctype.h> // library for islower function must require it
void main()
{
char c;
printf("Enter character : ");
scanf("%c",&c);
if(isalnum(c)==0)
printf("Enter character is Not alphanumeric character");
else
printf("Enter character is alphanumeric character");
getch();
}
isupper() function in ctype.h Library in C programming
#include<stdio.h>
#include<conio.h>
#include<ctype.h> // library for islower function must require it
void main()
{
char c;
printf("Enter character : ");
scanf("%c",&c);
if(isupper(c)==0)
printf("Enter character is Not a upper case character");
else
printf("Enter character is upper case character");
getch();
}
#include<conio.h>
#include<ctype.h> // library for islower function must require it
void main()
{
char c;
printf("Enter character : ");
scanf("%c",&c);
if(isupper(c)==0)
printf("Enter character is Not a upper case character");
else
printf("Enter character is upper case character");
getch();
}
islower() function in c - ctype.h library function
#include<stdio.h>
#include<conio.h>
#include<ctype.h> // library for islower function must require it
void main()
{
char c;
printf("Enter character : ");
scanf("%c",&c);
if(islower(c)==0)
printf("Enter character is Not a lower case");
else
printf("Enter character is Lower case");
getch();
}
#include<conio.h>
#include<ctype.h> // library for islower function must require it
void main()
{
char c;
printf("Enter character : ");
scanf("%c",&c);
if(islower(c)==0)
printf("Enter character is Not a lower case");
else
printf("Enter character is Lower case");
getch();
}
Subscribe to:
Posts (Atom)
-
/* action perform event for insert data into table Database : student_info Table : class5 root username of mysql db mysql@123 is a pas...
-
https://youtu.be/CWby7SYGX8E
-
index.html <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8...