how to solve the nullPointer Exception in main

how to solve the nullPointer Exception in main

View Answers

May 24, 2008 at 7:15 PM

Hi

import java.io.*;

public class actualState1 extends split {

private static String actualState1;

public String getActualState1(String actualState1){
return actualState1;
}
public void setActualState1(String actualState1){
this.actualState1 = actualState1;
}
public static void main(String args[]){
split s = new split ();
actualState1 ac=new actualState1();
//ac.setActualState1(s.spaceWord[1]);
//s.setActualState1(actualState1);
ac.setActualState1(ac.getActualState1(actualState1));
System.out.println(ac);
//System.out.println(ac.getActualState1(actualState1));
System.out.println("Welcome");
}
}

--------------------------

Read for more information.

http://www.roseindia.net/java/









Related Tutorials/Questions & Answers:
how to solve the nullPointer Exception in main - Java Beginners
how to solve the nullPointer Exception in main  New to Java ,pls help me how fix Null pointer Exception in main: two files , split .java another...: Exception in thread "main" java.lang.NullPointerException
Nullpointer Exception - JSP-Servlet
Nullpointer Exception  Hi friends, the given below is my output of the servlet program? how can i solve this exception ? HTTP Status 500... Exception report message description The server encountered
Advertisements
Hibernate nullpointer exception - Hibernate
Hibernate nullpointer exception  Hi, I am using eclipse IDE.I copied hibernate example from roseindia.net. I am using MYSQL as my database. 1.In eclipse I hava created new javaproject. 2.I hava copied Contact.java. and I
NullPointer Exception - JSP-Servlet
NullPointer Exception  It is in jsp - mysql database program. In this pro. it enters into the statement before try statement. It does not enter into the try statement. I found this by checking out.println("test"); statement
Exception in thread "main" java.lang.ClassCastException
Exception in thread "main" java.lang.ClassCastException  I am trying to connect the database. I am stuck with this exception that is getting thrown...) { sqle.printStackTrace(); } finally { try {stmt.close();} catch (Exception e
Exception in thread "main" java.lang.ClassCastException
Exception in thread "main" java.lang.ClassCastException  I am trying to connect the database. I am stuck with this exception that is getting thrown...) { sqle.printStackTrace(); } finally { try {stmt.close();} catch (Exception e
exception in thread main java.lang.unsupportedclassversionerror in ubuntu
exception in thread main java.lang.unsupportedclassversionerror in ubuntu  Hi, In Ubuntu I am trying to run Java program and its throwing exception. exception in thread main java.lang.unsupportedclassversionerror in ubuntu How
exception in thread main java.lang.unsupportedclassversionerror in eclipse
exception in thread main java.lang.unsupportedclassversionerror in eclipse .... But it throws exception in thread main java.lang.unsupportedclassversionerror in eclipse How to resolve this? Thanks   Hi, This error comes with you
how to solve
how to solve   log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources). log4j:WARN Please initialize the log4j system properly
how to solve this..
how to solve this..  Given a list of students and their marks Name | Science | Math | English | Computer Ahmad | 28 | 100 | 66 | 34 Samad | 56 | 89 | 55
how to solve this..
how to solve this..  Given a list of students and their marks Name | Science | Math | English | Computer Ahmad | 28 | 100 | 66 | 34 Samad | 56 | 89 | 55
how to solve this problem for oracle connectivity
how to solve this problem for oracle connectivity  Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap ter could not establish the connection
exception in thread main while running servlet
exception in thread main while running servlet  I got exception in thread main no such method error while running servlet. I have added servlet.api.jar file in classpath.my classpath is C:\Program Files\Apache Software Foundation
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger  Hi, How to solve following error? Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
how to solve an internet connection problem
how to solve an internet connection problem  when i run my application it give me this error: Exception in thread "AWT-EventQueue-0... how to implement
How to solve the Hibernate Common Exceptions?
How to solve the Hibernate Common Exceptions?  How to solve the Hibernate Common Exceptions
exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 - Java Beginners
exception in thread main java.lang.unsupportedclassversionerror unsupported... getting the this error :exception in thread main...!"); } } for example: javac xxx.java-->comping java xxxx:error :exception in thread main
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: TESTING is not mapped [FROM TESTING]
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: TESTING... to execute a sample app to test this and understand how it works.package main...-factory> </hibernate-configuration> Exception: `15 [main] INFO
exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 - Java Beginners
exception in thread main java.lang.unsupportedclassversionerror unsupported... is compling but runtime i am getting the exception in thread main.... Thanks  my code is class xxx { public static void main(String
Solve it
Solve it  How to calculate the value which contains oparator and operand both using command line argument
i dont no how to solve it pls
i dont no how to solve it pls   Calculate and display the sum of all prime number from 1 to 100 covert in java system codes
How to Solve the Syntax Error in java??
How to Solve the Syntax Error in java??  Syntax error in java? i have... of the program "objectname.i" What is the reason for this error??How to access the variable... j; private int k;ADS_TO_REPLACE_1 public static void main(String args
Solve
ReadNumbersFromFile { public static void main(String[] args) { try...(Exception E
how do i solve this problem?
how do i solve this problem?  Define a class named Circle with the following properties: List item An integer data field named radius with protected access modifier, and a String data field named colour with private access
how do i solve this question?
how do i solve this question?  1.Define a class named Circle with the following properties: a) An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier
solve this
solve this   Create a student class. The student object should have studentid, studentname, subject and marks as properties. Also generate the getter and setter methods. Create 5 objects of this class and populate values
how should i can solve
how should i can solve  Web based program - Input - Person's contact details with Passport Number as Unique Key. Save data in to oracle / MySQL. Output - List of Persons saved in the database. Technology to be used - JSP
Small Bug How to solve in my code
Small Bug How to solve in my code  String season=""; pst = con.prepareStatement("SELECT DISTINCT(Season) season FROM specialdates where Regid...") + ","; it shows bug in findbugs tool.. but it executes successfully how to solve
exception
exception  wHEN RUNTIME EXCEPTION CLASS IS SUB OF EXCEPTION CLASS HOW CAN'T HANDLE UNCHECKED EXCEPTION
how to solve 'Stop Running This Script' Error ?
how to solve 'Stop Running This Script' Error ?  Hi.. When opened the page on IE browser(version : 8.0),it gives an java script error (i.e.Stop Running This Script). I have used jsp/servlet for this. Please help to resolved
How to solve ModuleNotFoundError: No module named 'paramiko' error
How to solve ModuleNotFoundError: No module named 'paramiko' error  Hi, while importing following module: import paramiko I am getting the error... 'paramiko' How to solve ModuleNotFoundError: No module named 'paramiko' error
How to solve ModuleNotFoundError: No module named 'paramiko' error
How to solve ModuleNotFoundError: No module named 'paramiko' error  Hi, while importing following module: import paramiko I am getting the error... 'paramiko' How to solve ModuleNotFoundError: No module named 'paramiko' error
How to solve button problem - Java Beginners
How to solve button problem  I have created button (Open File Dialog... equal space So button size also increasing. Could you please guide me how to solve this problem. Thank you Sir, Yours truly, T.Ramesh Puttaparthy
exception
{ public static void main(String[] args)throws Exception { for (String s... arguments are not equalto two,throw a user defined exception "invalid parameter exception" ,otherwise display the two parameters.   Here is an example
exception
exception  example for numberformat exception   Hi Friend...{ public static void main(String[] args) { try{ String st="Rose...); } catch(Exception e){ System.out.println(e
how to solve this kind of error in Eclipse IDE?
how to solve this kind of error in Eclipse IDE?   i'm creating the Simple CRUD Using Jsp, Servlet and MySQL program and i'm using the eclipse, and i all most done it, finally i'm going to run myself, it can't be run. i
How can we solve this puzzle using java ?
How can we solve this puzzle using java ?  Sachin likes sweets a lot...(); } } public static void main(String[] args) { int set[] = { 1, 2, 3 }; printSubsets... someone help how can we write the code
Exception
Exception  whis is the Arithmetic Exception in java? or define Arithmetic Exception with exp?   Arithmetic Exception occurs, when you divide a number by zero. Example public class TryCatch { public static void main
Exception
main(String args[])throws Exception { FooException oo=new FooException...Exception  public class FooException extends Exception { public..."); } public void calculate() throws FooException, Exception { try { int
How to create custom exception in Java?
How to create custom exception in Java? In this tutorial we are going to create our own exception class and you will learn the steps to create custom exception class. Custom exceptions are used by Java developers to create
exception
exception  chek in and check out exception in java   Please visit the following link: Checked and Unchecked Exception
exception
exception  Identify the reason for SQLException exception, which...; Try this: import java.sql.*; class InsertData{ public static void main..."); ps.executeUpdate(); } catch(Exception e
How to make a design document for exception handling in java
How to make a design document for exception handling in java  How to make a design document for exception handling
How to threow timeout exception when DB is not responding
How to threow timeout exception when DB is not responding  How to throw timeout exception when DB is not responding
How to threow timeout exception when DB is not responding
How to threow timeout exception when DB is not responding  How to throw timeout exception when DB is not responding
how to solve error like'java.lang.NumberFormatException: For input string: "7600113411"' this
how to solve error like'java.lang.NumberFormatException: For input string: "7600113411"' this  java.lang.NumberFormatException: For input string: "7600113411"    java.lang.NumberFormatException: For input string
exception
exception  what is the use of catch block even though we have predefined exception object
How to Differenciate Main Thread and Child Thread in Java
How to Differenciate Main Thread and Child Thread in Java  hi... Main Thread and Java Child Thread. Please Suggest any example or online link... Language. These are Java Main Thread and the Child Thread. The Below reference
exception
defined checked exception ââ?¬Å?InvalidCharcterFoundExceptionââ?¬Â? and creater a block of codes that will handle the exception
How to eliminate error," Could not find the main class: filecopy.FileCopy. Program will exit." ?
How to eliminate error," Could not find the main class: filecopy.FileCopy....) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: filecopy.FileCopy. Program will exit. Exception in thread "main" Java

Ads