Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners how to solve the nullPointer Exception in main

Have Programming Question? Ask it here!
 
 
 


Kanchan
how to solve the nullPointer Exception in main
1 Answer(s)      6 years and 3 months ago
Posted in : Java Beginners



Advertisement
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
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
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 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
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; public static void main(String args[]) { System.out.println
Solve it
Solve it  How to calculate the value which contains oparator and operand both using command line argument
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
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
Solve
ReadNumbersFromFile { public static void main(String[] args) { try...(Exception E
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
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
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
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 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
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 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... in Java Programming Language. These are Java Main Thread and the Child Thread
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
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
how to return to main menu after adding all the info. - Java Beginners
how to return to main menu after adding all the info.  import java.util.Scanner; public class RegistrationSystem { public static void main... RegistrationSystem { public static void main(String[] args) throws Exception
how to open one Jframe from main method call
how to open one Jframe from main method call  I have downloaded... the main() method, when i run this Engine.java class game starts running...(containing main() method) Snake.java GameBoard.java PlayGame.java
How I call the function union from the main - Java Interview Questions
How I call the function union from the main  Please, from public static void main(String[] args) I would like to call the function union and I... declared in main function //------------------------------- package model
exception
exception  wHEN RUNTIME EXCEPTION CLASS IS SUB OF EXCEPTION CLASS HOW CAN'T HANDLE UNCHECKED EXCEPTION
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 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
solve this pbm
solve this pbm  sir rows are also inserting i have checked in the database also the rows are not affected in the table . The first pbm wich i have sent to you is not yet solved.......... pls give me detail explaination how we
solve this pbm
solve this pbm  its not working the code for databae access using servlets
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... main(String[] args) { try{ String st="Rose India...); } catch(Exception e){ System.out.println(e
How to solve concurrency issue when an application is running on two machine to fetch record from one database
How to solve concurrency issue when an application is running on two machine to fetch record from one database  I have developed an application in java to run on two machines. Program will fetch a record from database and process
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
solve this problem
solve this problem  I typed this program and compiled.The program...;"); } rs.close(); statement.close(); } catch (Exception e...(); } catch (Exception e){ System.out.println
Exception
); } } public static void main(String args[])throws Exception { FooException oo=new...Exception  public class FooException extends Exception { public..."); } public void calculate() throws FooException, Exception { try { int
How to solve this java code by adding the student marks not in the list of the table. For example -10 and 156 in GUI?
How to solve this java code by adding the student marks not in the list of the table. For example -10 and 156 in GUI?  import java.awt.*; import...; } public String getGrade() { return grade; } public static void main(String
exception
exception  chek in and check out exception in java   Please visit the following link: Checked and Unchecked Exception
MAin error
but @ d tym of runnin error in main class is generated Exception in thread "main".java.lang.NoClassFoundDefLoader. : Hello caused...MAin error  Error while running hello program in another dir rather
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
Advertisements
 

 

 

DMCA.com