Friday, 3 April 2015

Create a Frame In java

import javax.swing.*;   // swing class is placed in the javax.swing package
public class Main
{
    public static void main(String[] args)
{
          EmpetyFrame f = new EmpetyFrame(); 
// we create a sub class wd class name empetyframe                      
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// exit upon close event operation

        f.setVisible(true);
 // to show the frame main method calls setvisible method

}
}
class EmpetyFrame extends JFrame
{
public EmpetyFrame( ) 
// constructor sets size
{
setSize(default_width,default_height);
}
public static final int default_width = 300;
public static final int default_height = 300;
}

Thursday, 2 April 2015

Java Tutorial... How to write code for determining Strings starts or ends with particular substring ?

public class Main
{
    public static void main(String[] args)
{
String[] a={"sell","well","help","hell"} ; // Array of strings
for(String x:a)
if(x.startsWith("he"))
System.out.printf(" Strings that starts with he :" + x +"\n");
for(String x:a)
if(x.endsWith("ll"))
System.out.printf(" Strings that ends with ll :" + x + "\n");

   
}
}

Grammar Mistakes in Technical Paper Writing

Let me share some experience in this post with you. I'm currently in the second year of my Ph.D. program. We are in the middle of paper...