Sunday, 21 October 2018

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();

}

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();

}

Tuesday, 25 September 2018

Thread.join() Method in Multi Threading java


class MyThread extends Thread{
public void run(){
// print child thread 5 times here
for(int i =0 ; i<=5 ; i++){
System.out.println("child Thread....");
}
}
}

//main method class which is main thread here
class JoinDemo{
public static void main(String args[]){
// this is main thread
// print main thread here

// create thread
MyThread t = new MyThread();
t.start(); // start child thread here

try{
t.join();// pause main thread here and after complete t resume current thread
}catch(Exception e){
System.out.println("Exception caught "+e);
}


for(int i =0 ; i<=5 ; i++){
System.out.println(" Main Thread....");
}

}
}

JTable Hide and Show in Java Swing