Showing posts with label Programing. Show all posts
Showing posts with label Programing. Show all posts
Home » Posts filed under Programing
implementation of Luhn algorithm using java 8
Posted by Aamir khan
More about → implementation of Luhn algorithm using java 8
Labels:
Programing
How to Convert RGB to CMYK and CMYK to RGB in java
Posted by Aamir khan
More about → How to Convert RGB to CMYK and CMYK to RGB in java
Labels:
Programing
How to Shorten a Name in java
Posted by Aamir khan
How to Shorten a Name in java?
Without going in depth i would like to show you the Code...
/*----Program begin---*/
import java.util.Locale;
public class ShortName{
public static void main(String[] args) {
String name = "Aamir khan";
String[] shortName = name.split("\\s");
int len = shortName.length;
switch(len){
case 3: System.out.printf("%1.1s. %1.1s. %s", shortName[0].toUpperCase(Locale.ROOT),
shortName[1].toUpperCase(Locale.ROOT), shortName[2]);
break;
case 2: System.out.printf("%1.1s. %s", shortName[0].toUpperCase(Locale.ROOT),
shortName[1]);
break;
case 1: System.out.printf("%s", shortName[0]);
break;
default: System.out.println("Errorr !!! occured");
}
System.out.println("");
}
}
/*---Program End---*/
updated one:
/*---Program Begin ---*/
public static void main(String[] args) {
String name = "Avul Pakir Jainulabdeen Abdul kalam";
String[] splitedName = name.split("\\s");
String shortName = "";
int len = (splitedName.length - 1);
for (int i = 0; i < len; i++)
shortName = shortName.concat(splitedName[i].charAt(0) + ". ");
shortName = shortName.concat(splitedName[len]);
System.out.println(shortName.toUpperCase());
}
/*---Program End---*/
Note : There may be other ways to do the same task, above code is just an idea and can be Optimize
Labels:
Programing
Printing Numbers in Hindi using Java
Posted by Aamir khan
More about → Printing Numbers in Hindi using Java
Labels:
Programing
How to sum of Elements in an Array without Second Variable
Posted by Aamir khan
Here We Are with a simple JAVA program that will print sum of given Integer Elements without Second Variable......
Below is your Program
// @author Aamir khan
// @url aamir-4u.blogspot.com
public class ArrayAdditon {
public static void main(String args[]){
int add[]={1,2,3,4,5,45,67,45,78,89,90};
int i;
for(i=0;i<add.length;i++){
try{
add[i]+=add[i+1];
add[i+1]=add[i];
} catch (Exception e) {
}
}
System.out.println("Total = "+add[add.length-1]);
}
}
Download the Code from here
Labels:
Programing
How to Delete Selected Element from an Array
Posted by Aamir khan
Some days ago my Teacher ask to me Delete an Element From an Array.
i came back to my Room, Open up My Laptop and start Programming and find a simple way to delete the Element from an array.
so here i Would Like to Share that code with you to help you in your Project...
Click to See Code on Pastebin.com
Please note that The array, which stores a fixed-size sequential collection of elements of the
same type.
Since Arrays are Fixed so we can not Delete any Element.
in the Above Example we are just Skipping the "I" Element to do the Trick.
if you have your way to that than we Would Love to know that feel free to share with us in comments
Labels:
Programing
Top Recommended JAVA Books
Posted by Aamir khan
Here I have Collect Some Useful and Very Effective Books for JAVA Programmer
Core Java Books [Java SE] :
Effective Java 2nd Edition By Joshua bloch
The JAVA Prog Language By Gosling,Ken Arnold,Holmes.
Core Java vol - 1 and vol-2 By Cay Horstmann and Gary Cornell
Java How To Program By Deitel
Thinking in Java By Eckel
Java Concurrency in practice By Goetz,Bloch,Holmes,Lea,Tim,Bowbeer
Java Puzzlers - Traps, Pitfalls, And Corner Cases -Joshua Bloch, Neal Gafter
Head First Java By Kathy Sierra and Bert Bates
Java: A Beginner's Guide By Herb Schildt
Beginning Java By Ivor Hortons
Mobile/Embedded Development Books [Java ME]:
J2ME - Complete Reference By James Keogh
Java ME Game Programming By John P. Flynt and Martin Wells
Wireless Game Development in Java with MIDP 2.0 By -Ralph Barbagallo
J2ME & Gaming By -Jason Lam
J2ME in a nutshel--O'Reilly
Enterprise Java Books [Java EE]:
Real World Java EE Patterns Rethinking Best Practices
Head First Servlets and JSP
Head First EJB By Kathy Sierra, Bert Bates
FREE Core Servlets and JavaServer Pages by Marty Hall and Larry Brown http://pdf.coreservlets.com/
Frameworks Related Books:
Apress.Spring.Persistence.with.Hibernate By Manning
Struts.2.in.Action.May.2008.Manning. By Manning
Certification Books:
A Programmers Guide To Java Cerification By Mughal/Rasmussen
SCJP Sun Certified Programmer for Java 5 Study Guide By Sierra
SCJD Exam with J2SE 5 By Andrew Monkhouse, Terry Camerlengo
SCJP Sun Certified Programmer for Java 6 - Sierra & Bates
OCA/OCP Java SE 7 Programmer - Sierra & Bates
Other Technology & Related Books :
Head First Design Patterns By Eric and Elisabeth freeman
JDBC Recipies-A Problem solution Approach Mahmoud Parsian
Java Swing 2nd Edition By [James Elliott, Robert Eckstein, Marc Loy, David Wood, Brian Cole]
Java 3D Programming By Daniel Selman
Java 2D Graphics By Jonathan Knudsen
JVM and Java Language Specification - Oracle
JavaFX By Carl Dea
Some Miscellanous Books:
Wicked Cool Java No Starch Publications
----------------------------------------------------------------------------------
Although the Best Way to get Start With is JAVA DOC that i will sure Recommend to Read from Oracle.com
Note: i have try my best to keep all the Best Books Keep in Above List But if you are Missing You favorite Books in Above List Feel free to Share us..
Labels:
E-books,
Programing
How to Write a java Program to Hibernate or Shutdown Windows
Posted by Aamir khan
So here we are with a Simple java Code that will Hibernate your Windows
package practice; import java.io.IOException; /** * * @author Aamir khan @hacktw */ public class Hibernate { public static void main(String[] args) throws IOException { Runtime r = Runtime.getRuntime(); r.exec("shutdown /h"); } }
you can use "shutdown -s" for Shutdown and "shutdown -r" for Restart
Labels:
How to,
Programing
how to calculate log5 in c++
Posted by Aamir khan
More about → how to calculate log5 in c++
Labels:
E-books,
How to,
Programing