oraclemag-marchapril15

Oracle Java Magazine – March/April 2015

Welcome to the March/April 2015 issue of # Magazine! In this issue, we examine how developers can improve Java performance—from code to platform tuning. Plus, find out how Netflix uses Java to fulfill 2 billion content requests per day.

Improving the Observability of Fork/Join Operations
When adding parallelism might help performance

On Demand
Netflix moves fast to give customers a superior viewing experience. Java makes it happen.

Performance, Innovation, and Success
Find out how collaboration drives a healthier Java ecosystem.

Understanding Java JIT Compilation with JITWatch
See the effects of small source code changes and Java HotSpot VM switches.

The Quantum Physics of Java
Discover how modern chip design affects Java programs.

Improving the Performance of Java EE Applications
Incorporate performance tuning into your development lifecycle.

And more!

Dowload free at # Java Magazine Website
beABetterProgrammer

5 tips to be a Better Programmer

Here are five tips to be a better programmer.

  1. Coding is a craft; you learn it by doing it. That is why training courses have such a strong practical element. It is also a skill that is easy to forget, so use it or lose it.
  2. Even when familiar with the basic constructs, it is still worth fully understanding the detailed syntax of the language you are using. Languages contain many subtleties.
  3. Learn some theory and then do some practical. First gain a good understanding of the principles, purpose and limits of a new technology. Next, start to build an application using the technology.
  4. Many developers start to build something, and may even get it to work, without really knowing what exactly they are doing, or why. That is why having a good understanding is important. With software development, theory and practice go hand in hand.
  5. For the practical bit, it is fine to start by copying code or following step-by-step instructions. But then try, by yourself, building a program from scratch. That is when you really get a sense of achievement.

betterprogrammer

programming-java

Multiple Heritance in Java 8

One of the newest features from Java 8 is the capability and freedom of using multiple heritance with defaults method. java-installer

Take a look at the example below:

Remembering that, even with some existing restrictions when building an interface it is still a fast simple way of multiple heritance that have never existed before at Java. You can see uncountable new interesting options of OOP design.
Therefore, take so much care! Every power comes with responsabilities…

java-magazine-december-2014

Java Magazine – November/December 2014

Welcome to the November/December 2014 issue of Java Magazine! In this issue explore the Java development for Internet of Things and discover how kids are learning Java in programs all over the world.

java-magazine-december-2014Java Development for the Internet of Things
Oracle’s Henrik Ståhl discusses the Internet of Things for Java developers.

Java Development for the Internet of Things – Part II
Oracle’s Henrik Ståhl discusses the Internet of Things for Java developers.

Java: The Next Generation
Teach kids to code and give them tools for success.

Robots Make Factories Smarter
Keba’s systems help usher in the next industrial revolution.

Code Java on the Raspberry Pi
BlueJ brings Java SE 8 development directly to the Raspberry Pi.

jdeps, Compact Profiles, and Java Modularity
We look at the future of Java modularity.

The Device I/O API
A standard API for peripherals and low-level hardware control just arrived for Oracle Java SE Embedded.

And much more!

HTTPS

Java HTTPS Client Example

Question: Can you share some source code for a Java HTTPS client application?

Sure, here’s the source code for an example Java HTTPS client program I just used to download the contents of an HTTPS (SSL) URL.

I used this program to troubleshoot a problem with Java and HTTPS URLs, including all that nice Java SSL keystore and cacerts stuff you may run into when working with Java, HTTPS/SSL, and hitting a URL.

This Java program should work if you are hitting an HTTPS URL that has a valid SSL certificate from someone like Verisign or Thawte, but will not work with other SSL certificates unless you go down the Java keystore road.

package foo;
import java.net.URL;
import java.io.*;
import javax.net.ssl.HttpsURLConnection;

public class JavaHttpsExample
{
public static void main(String[] args)
throws Exception
{
String httpsURL = "https://your.https.url.here/";
URL myurl = new URL(httpsURL);
HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();
InputStream ins = con.getInputStream();
InputStreamReader isr = new InputStreamReader(ins);
BufferedReader in = new BufferedReader(isr);

String inputLine;

while ((inputLine = in.readLine()) != null)
{
System.out.println(inputLine);
}

in.close();
}
}
Just change the URL shown there to the HTTPS URL you want to access, and hopefully everything will work well for you.