Welcome To The World Of Java

This site will teach you the basics of Java. It is not necessary to have any prior programming experience.

Java program to check Palindrome Number.

10:48:00 AM | Comments (0)

/*This program shows how to check for in the given list of numberswhether each number is palindrome or not*/public class JavaPalindromeNumberExample { public...

Read more

Java program to calculate the Simple Interest and Input by the user.

10:26:00 AM | Comments (0)

import java.util.*; class SimpleInterest {  int p, t;  float si, r;  public si() {   r = 0;   p = 0;  }  public...

Read more

Java program to find out the HCF and LCF.

11:32:00 AM | Comments (0)

import java.util.*; class Hcf {  public static void main(String args[]) {   int a, b;   Scanner sc = new Scanner(System.in);   System.out.println("Enter...

Read more

Java program to test the Prime number.

11:14:00 AM | Comments (0)

import java.util.*; class Prime {  public static void main(String args[]) {   int flag, x, i;   flag = 0;   int a[] =...

Read more

Java program to Demonstrate Type Casting.

10:56:00 AM | Comments (0)

class Typecast { public static void main(String args[]) {  byte h = 127;  int a = 300;  float a1 = 12.222 f;  float...

Read more

Find the average, sum, min and max of the N numbers Using user Input in Java.

10:45:00 AM | Comments (0)

import java.util.*; class Average {  public static void main(String args[]) {   Scanner sc = new Scanner(System.in);   // to take user input...

Read more

Write a servlet which accepts product details from html form and stores the product details into database?

5:37:00 AM | Comments (0)

Product database: create table Product ( pid number (4), pname varchar2 (15), price number (6, 2) ); web.xml: <web-app> <servlet> <servlet-name>abc</servlet-name> <servlet-class>DatabaServ</servlet-class> </servlet>...

Read more

Write a servlet which accepts client request and display the client requested data on the browser?

5:30:00 AM | Comments (0)

import javax.servlet.*;import javax.servlet.http.*;import java.io.*;public class DataServ extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {  res.setContentType("text/html");  PrintWriter pw =...

Read more

Spring Based interview Questions

2:36:00 AM | Comments (0)

1. Explain DI or IOC pattern. Dependency injection (DI) is a programming design pattern and architectural model, sometimes also referred to as inversion...

Read more

Write a servlet which illustrate the concept of ServletContext?

9:22:00 AM | Comments (0)

web.xml:<web-app><context-param><param-name>v1</param-name><param-value>10</param-value></context-param><context-param><param-name>v2</param-name><param-value>20</param-value></context-param><servlet><servlet-name>abc</servlet-name><servlet-class>Serv1</servlet-class><init-param><param-name>v3</param-name><param-value>30</param-value></init-param></servlet><servlet><servlet-name>pqr</servlet-name><servlet-class>Serv2</servlet-class><init-param><param-name>v4</param-name><param-value>40</param-value></init-param></servlet><servlet-mapping><servlet-name>abc</servlet-name><url-pattern>/firstserv</url-pattern></servlet-mapping><servlet-mapping><servlet-name>pqr</servlet-name><url-pattern>/secondserv</url-pattern></servlet-mapping></web-app>Serv1.java:import javax.servlet.*;import javax.servlet.http.*;import java.io.*;public class Serv1 extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {  res.setContentType("text/html");  PrintWriter pw =...

Read more

Page 1 of 6123456Next