Click link below to download
1. JD-GUI
2. Cavaj Java Decompiler
3. JCavaj Java Decompiler
2. Cavaj Java Decompiler
3. JCavaj Java Decompiler
public class JavaGetBinaryFromLetter
{
public static void main(String[]args)
{
String a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for(int i=0;i<a.length();i++)
{
char b=a.charAt(i);
int temp=(int)b;
String c=Integer.toBinaryString(temp);
System.out.println("BINARY VALUE FOR LETTER "+b+" IS : "+c);
}
}
}
public class JavaTernaryOperator
{
public static void main(String[]args)
{
int a=0;
int b=4;
int c=5;
//THIS IS EXAMPLE OF TERNARY OPERATOR
a=(b>c?b:c);
System.out.println(a);
}
}
public class JavaTernaryOperator
{
public static void main(String[]args)
{
int a=0;
int b=4;
int c=5;
if(b>c)
{
a=b;
}
else
{
a=c;
}
System.out.println(a);
}
}
import java.util.Scanner;
public class JavaHexToBin
{
public static void main(String[]args)
{
String[]hex={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
String[]binary={"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"};
Scanner s=new Scanner(System.in);
System.out.print("Put hex value : ");
String userInput=s.next();
String result="";
for(int i=0;i<userInput.length();i++)
{
char temp=userInput.charAt(i);
String temp2=""+temp+"";
for(int j=0;j<hex.length;j++)
{
if(temp2.equalsIgnoreCase(hex[j]))
{
result=result+binary[j];
}
}
}
System.out.println("IT'S BINARY IS : "+result);
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JavaDeterminePixelClicked extends Canvas implements MouseListener
{
boolean [] con={ false,false,false,false,false,false,false,false };
int[][]coor=new int[8][2];
Robot r;
public JavaDeterminePixelClicked()
{
addMouseListener(this);
try
{
r=new Robot();
}
catch(Exception exception)
{
exception.printStackTrace();
}
JFrame a=new JFrame(">>>>>TRY CLICK AT BLACK DOT<<<<<");
a.getContentPane().add(this,BorderLayout.CENTER);
a.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
a.setSize(500,500);
a.setLocationRelativeTo(null);
a.setVisible(true);
}
public void paint(Graphics g)
{
setBackground( new Color (255,255,255) );
super.paint(g);
g.setColor( new Color (0,0,0) );
g.drawLine(30,30,30,30);
g.drawLine(40,40,40,40);
g.drawLine(50,50,50,50);
g.drawLine(60,60,60,60);
g.drawLine(70,70,70,70);
g.drawLine(80,80,80,80);
g.drawLine(90,90,90,90);
g.drawLine(100,100,100,100);
}
public void mouseClicked(MouseEvent event)
{
Color temp=r.getPixelColor(event.getLocationOnScreen().x,event.getLocationOnScreen().y);
if(temp.getRed()==0&&temp.getGreen()==0&&temp.getBlue()==0)
{
int upperLeftX=getLocationOnScreen().x;
int upperLeftY=getLocationOnScreen().y;
int currentX=event.getLocationOnScreen().x;
int currentY=event.getLocationOnScreen().y;
if(currentX-upperLeftX==30&¤tY-upperLeftY==30)
{
if(con[0]==false)
{
con[0]=true;
}
else
{
JOptionPane.showMessageDialog(null,"This point was clicked");
}
}
if(currentX-upperLeftX==40&¤tY-upperLeftY==40)
{
if(con[1]==false)
{
con[1]=true;
}
else
{
JOptionPane.showMessageDialog(null,"This point was clicked");
}
}
if(currentX-upperLeftX==50&¤tY-upperLeftY==50)
{
if(con[2]==false)
{
con[2]=true;
}
else
{
JOptionPane.showMessageDialog(null,"This point was clicked");
}
}
if(currentX-upperLeftX==60&¤tY-upperLeftY==60)
{
if(con[3]==false)
{
con[3]=true;
}
else
{
JOptionPane.showMessageDialog(null,"This point was clicked");
}
}
if(currentX-upperLeftX==70&¤tY-upperLeftY==70)
{
if(con[4]==false)
{
con[4]=true;
}
else
{
JOptionPane.showMessageDialog(null,"This point was clicked");
}
}
if(currentX-upperLeftX==80&¤tY-upperLeftY==80)
{
if(con[5]==false)
{
con[5]=true;
}
else
{
JOptionPane.showMessageDialog(null,"This point was clicked");
}
}
if(currentX-upperLeftX==90&¤tY-upperLeftY==90)
{
if(con[6]==false)
{
con[6]=true;
}
else
{
JOptionPane.showMessageDialog(null,"This point was clicked");
}
}
if(currentX-upperLeftX==100&¤tY-upperLeftY==100)
{
if(con[7]==false)
{
con[7]=true;
}
else
{
JOptionPane.showMessageDialog(null,"This point was clicked");
}
}
}
}
public void mouseEntered(MouseEvent event)
{
//NOTHING
}
public void mouseExited(MouseEvent event)
{
//NOTHING
}
public void mousePressed(MouseEvent event)
{
//NOTHING
}
public void mouseReleased(MouseEvent event)
{
//NOTHING
}
public static void main(String[]args)
{
JavaDeterminePixelClicked jdpc = new JavaDeterminePixelClicked ();
}
}
public class GetDegreeFromRadian
{
public static void main(String[]args)
{
//CHANGE RADIAN VALUE TO WHAT VALUE THAT YOU WANT
double radian=1.00;
//PRINT ANGLE VALUE THAT WE GET FROM RADIAN
System.out.println( "IT'S ANGLE IS : " + radian* (180/Math.PI) );
}
}
import java.util.Scanner;
public class AscendingString
{
public static void main(String[]args)
{
Scanner s=new Scanner(System.in);
String[]a=new String[5];
for(int i=0;i<5;i++)
{
System.out.println(i+1+".Put your String");
String temp=s.nextLine();
a[i]=temp;
}
System.out.println("**********");
System.out.println("RESULT");
System.out.println("**********");
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{
String temp=a[i];
String tempB=a[j];
if(temp.compareTo(tempB)<0)
{
a[i]=tempB;
a[j]=temp;
}
}
}
for(int i=0;i<5;i++)
{
System.out.println(a[i]);
}
}
}
import java.util.Scanner;
public class Test
{
public static void main(String[]args)
{
Scanner s=new Scanner(System.in);
System.out.println("Put a number");
int a=s.nextInt();
System.out.println("IT'S RESULT");
System.out.println("***************");
for(int i=1;i<=a;i++)
{
System.out.println(i);
}
}
}
import java.util.Scanner;
public class Test
{
public static void main(String[]args)
{
Scanner s=new Scanner(System.in);
System.out.println("Put a number");
int myNumber=s.nextInt();
PrintNumber pn=new PrintNumber();
System.out.println("IT'S RESULT");
System.out.println("***************");
pn.print(myNumber);
}
}
class PrintNumber
{
public void print(int a)
{
if(a==1)
{
System.out.println(a);
}
else
{
int temp=a-1;
print(temp);
System.out.println(a);
}
}
}
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
public class SetJOptionPaneBackgroundColor
{
public static void main(String[]args)
{
UIManager uim=new UIManager();
uim.put("OptionPane.background",new ColorUIResource(255,0,0));
uim.put("Panel.background",new ColorUIResource(255,0,0));
JOptionPane.showMessageDialog(null,"Hello world","HELLO WORLD",JOptionPane.INFORMATION_MESSAGE);
}
}
import java.util.Scanner;
public class CountAllWhitespaceInString
{
public static void main(String[]args)
{
boolean a=true;
Scanner sc=new Scanner(System.in);
while(a)
{
System.out.println("Type EXIT to exit");
String b=sc.nextLine();
int whitespaceNumber=0;
if(!b.equalsIgnoreCase("exit"))
{
try
{
for(int i=0;i<=b.length()-1;i++)
{
char temp=b.charAt(i);
if(temp==' ')
{
whitespaceNumber++;
}
}
System.out.println("Whitespace number is : "+whitespaceNumber);
}
catch(Exception exception)
{
System.out.println("DON'T DO THAT");
}
}
else
{
a=false;
}
}
}
}
public class ReverseString
{
public static void main(String[]args)
{
String a="i love you";
StringBuffer b=new StringBuffer(a);
System.out.println(b.reverse());
}
}
import javax.swing.JOptionPane;
public class MySimplestPalindromeChecker
{
public static void main(String[]args)
{
String a=JOptionPane.showInputDialog(null,"What word that you want to check ?","Palindrome Checker",JOptionPane.QUESTION_MESSAGE);
if(a!=null)
{
String b=a;
StringBuffer c=new StringBuffer(b);
if(a.equals(c.reverse().toString()))
{
JOptionPane.showMessageDialog(null,"THIS IS A PALINDROME WORD");
}
else
{
JOptionPane.showMessageDialog(null,"THIS IS NOT A PALINDROME WORD");
}
}
}
}
public class Test2
{
public static void main(String[]args)
{
System.out.println("\u221A");
}
}
import javax.swing.JOptionPane;
public class Test2
{
public static void main(String[]args)
{
JOptionPane.showMessageDialog(null,"\u221A");
}
}