Content deleted Content added
mNo edit summary |
|||
Line 90:
Java does not support [[pointer (computing)|pointer arithmetic]] as is supported in, for example, C++. This is because the garbage collector may relocate referenced objects, invalidating such pointers. Another reason that Java forbids this is that type safety and security can no longer be guaranteed if arbitrary manipulation of pointers is allowed.
<!--
package slk.soft;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.*;
import java.util.Scanner;
import java.io.FileNotFoundException;
public class SearchName{
public static void main(String agrs[]) throws Exception{
Scanner sc=new Scanner(System.in);
System.out.print("Enter the string: ");
String fname=sc.nextLine();
FileReader file=new FileReader("Directory.txt");
BufferedReader in=new BufferedReader(file);
String txt;
int n=0;
while((txt=in.readLine())!=null){
String a[]=txt.split(":");
if(a[0]==fname){
int i=0;
for(String s: a){
i++;
System.out.println(s);
}
}
}
in.close();
file.close();
}
}
-->
== Syntax ==
|