Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Aditi Msc   on Mar 28 In Java Category.

  
Question Answered By: Barak Levi   on Mar 28

I have tried out all of your given programs, it's all working fine. Only you
need to take care or case sensitivity. I have modified your all programs
that I am writing here please compare it with your once. And you will see
that you are on a right way and just need to take care with sily mistakes.
One more thing there is no need to import  java.lang package  at every Java
program because this are the defalt package of java  its already accessible.



public class  Hello {



public static  void main(String args[]){

System.out.println("Hello" + " " + "Java");

}

}



public class SquareRoot {

public static void  main(String args[]){

double x=5;

double y;

y = Math.sqrt(x);



System.out.println("y = " + y);

}

}



public class Employee{

String employeeName;

String employeeAddress;

public Employee(){

employeeName = "Carol";

employeeAddress = "21 Rock st.";

}

public void displayDetails(){

System.out.println("Name of an Employee is"+employeeName);

System.out.println("Address of an employee is"+employeeAddress);

}

public static void main(String args[]){

Employee employeeObject = new Employee();

employeeObject.displayDetails();

}

}

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on java. aim using jdk1.4 on win2k Or get search suggestion and latest updates.


Tagged: