Abstract Classes Compared to Interfaces

Reading Time: 1 minute Abstract classes are similar to interfaces. You cannot instantiate them, and they may contain a mix of methods declared with or without an implementation. However, with abstract classes, you can declare fields that are not static and final, and define public, protected, and private concrete methods. With interfaces, all fields are automatically public, static, and

configure ssl

Reading Time: 1 minute Export from JKS to PKCS #12. keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -deststoretype PKCS12 -srcalias <jkskeyalias> -deststorepass <password> -destkeypass <password> mv keystore.p12 /root cd /root convert to key openssl rsa -outform der -in private.pem -out private.key nano /etc/httpd/conf.d/ssl.conf find the line <VirtualHost _default_:443> uncomment ServerName and type servername:443 uncomment: SSLEngine on SSLCertificateFile /root/downloadedcertificate.crt SSLCertificateKeyFile /root/private.key

Configure SSL on Apache and Glassfish and forward traffic to Glassfish

Reading Time: 2 minutes keytool -keysize 2048 -genkey -alias tugrulaslan.net -keyalg RSA –dname “CN=tugrulaslan.net,O=company,L=Istanbul,S=Istanbul,C=TR” -keystore keystore.jks keytool –certreq –alias tugrulaslan.net –keystore keystore.jks –file cert_req.csr keytool -import -alias tugrulaslan.net -keystore keystore.jks -trustcacerts -file yourdomain.com.crt send that csr to generate your ssl file then download x509 certificate from geotrust then move the certificate to /root IMPORT SSL INTO KEYSTORE   download

Apache Mod_proxy to forward http traffic to Java App server 8080

Reading Time: 1 minute In my vps server I wanted to forward http port 80 to glassfish 8080 ports without having glassfish config changed. So I assume httpd apache server is installed. So cd /etc/httpd/conf nano httpd.conf Add the below lines and save and restart apache <VirtualHost *:80> # Your domain name ServerName Domain_NAME_HERE ProxyPreserveHost On ProxyPass / http://localhost:8080/

Major OOP concepts in Java

Reading Time: 2 minutes Abstract classes and abstraction This is a way of hiding implementation & ignoring the body of a method. The method bodies will be filled in derived classes. Remember the base class has to add “abstract” modifier in all of the provided methods  and the derived methods from the base class have to have the same

Why a class can’t extend multiple classes

Reading Time: 1 minute In Java, a class can’t extend multiple classes. Why do you think this is so? Let’s examine this issue using an example, in which the class Programmer is allowed to inherit two classes: Employee and Philanthropist. Figure 6.9 shows the relationship between these classes and the corresponding code. If class Programmer inherited the method receiveSalary,