JAVA CODE SNIPPET-3

Java Code Snippet-3

public class Techyield {


 private static int p = test();

 static int test()
 {
  return 99;
 }


 public static void main(String[] args) {
  // TODO Auto-generated method stub
  System.out.println("value of p"+p);
  System.out.println(++p);
  System.out.println(5+p--+2);
  System.out.println(++p*10);
 }

}

Select an answer





Please comment below if you have any doubts.

JAVA CODE SNIPPET-2

Java Code Snippet-2

public class Techyield {


 private static int p = test();

 static int test()
 {
  return 99;
 }


 public static void main(String[] args) {
  // TODO Auto-generated method stub
  System.out.println("Value of p is "+p);
 }

}

Select an answer





Please comment below if you have any doubts.

JAVA CODE SNIPPET-1

Java Code Snippet-1
package techyield;

public class GrandParent {
 public void method1(int a){
  System.out.println("In GrandParent class and in method1 
and with one int argument and value is "+a);
 }
}
package techyield;

public class Parent extends GrandParent{
 public void method1(int a){
  System.out.println("In Parent class and in method1 and 
with one int argument and value is "+a);
 }
}
package techyield;

public class Child extends Parent{

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  System.out.println("Main method");
  Child child=new Child();
  child.method1(2);

 }
 public void method1(int a){
  System.out.println("In child class and in method1 and 
with one int argument and value is "+a);
 }
}
What is the Output On the Console ?

Select an answer

Please comment below if you have any doubts.

Educational Documents for F1 Visa

Educational Documents for F1 Visa
  • Original degree certificates along with mark sheets.
In case if you didn't received your original degree certificate or if you just completed final year take your mark sheets and provisional certificate if available. 

Sometimes immigrant officer may even say ,  to attend interview after getting documents with out rejecting.
  • Original bachelor degree transcripts or high school diploma along with  mark sheets all the previous institutions you attended.
  • Test scores GRE , TOEFL or IELTS or SAT , GMAT , LSAT . Take all those exam related documents on what basis you got admitted into the University or School or College.
  • Some Universities may not require scores , in that case you have to show the proof that University doesn't require such scores . 
For example : Showing a letter from University that it doesn't require particular exam score for the admission.

Note : Having good scores in exams always have good impact or impression during F1 Visa.


Useful Links :

Documents Checklist for F1 Visa (Student Visa)




Financial Documents for F1 Visa

Financial Documents for F1 Visa

An F1 visa applicant need to show evidence of financial resources, proof of liquid assets sufficient to pay for the entire first year of education and living expenses and also proof of readily available funds to cover the remaining year(s) of studies.

Proof of your Financial resources or documents should be of following category :
  • Applicant's personal resources . By showing bank statements either liquid amount , assests , house , land , agricultural lands or Fixed Deposits.
  • Pay slips , PF , Employment letters.
  • Chartered account statement if available not mandatory.
  • Tax returns of the past 3 years (Form 16) .
  •  In case if someone is sponsoring you , then you have to carry his tax returns of past 3 years ,  his bank statement showing sufficient funds .
  • In case if your sponsor is in US . Then you have to carry a notarized FORM I-134 along with his past 3 years tax returns and bank statement.(It is not better to show assets of persons in the United States).
  • Financial aid from the university in the form of a scholarship, fellowship, assistant-ship (TA/GA/RA). which will be mentioned in your I-20 .
  • Financial aid from the student's home government if your government is sponsoring for your studies or any private organizations sponsoring you.

Note : Always answer to immigrant officer with confidence , if any transactions done in your bank account recently answer correctly, why those transactions happened . Be ready with answers don't panic .



Useful Links :

Documents Checklist for F1 Visa (Student Visa)




Documents Checklist for F1 Visa (Student Visa)

Mandatory Documents




  • Current passport . If you have old passports please carry them too
  • Carry copies of first page , last page and remarks page of your current passport.
  • One photograph
  • Confirmation page of online submitted DS-160 Form with CEAC bar code.
  • Visa Fees paid receipt. You have to pay the Visa Fees before attending for the interview .
  • Original interview appointment letter and one copy of it.
  • (I-901) SEVIS Fee paid receipt and one copy of it.
  • Both pages of bar-coded original SEVIS generated Form I-20 which you received from the US School ,College or University that you are going . Take a copy of it .(Xerox copy of I-20)
Note : The original Form I-20 must be signed by you and by the school official.

           You may get many I-20's from many universities that you applied but make
           sure that you are showing  the right one to the authority.
           Even if you carry all I-20's .

           During F1 Visa interview they will never stamp on your I-20 . Once when you
           enter US the immigrant officer at the entry will stamp on it.










Petrol Pump solution Mettl.

Question :


A petrol tank has infinite capacity it can store infinite litres of petrol .

There are Four petrolpumps say 1 , 2 , 3 , 4. which are in circular manner.

PetrolTank should start from one petrol pump and should reach other petrolpump and should complete the circle with out any break.

Given input is a two dimensional array first column is petrol capacity of petrolpump and second column is distance to next petrol pump.

If petroltank can start from two petrol pumps means then you should start from least petrol pump number.

Given input array is int [][] array1 ={{3,3},
                            {7,4},
                            {7,8},
                            {9,8}}

For this input petrol tank can start from petrolpump 2 and petrolpump 4 but as we have to start from least number of petrolpump it will start from petrolpump 2 and will finish the circle.

Hints : You have to check whether input is two dimensional array or not .


Solution :

PetrolProblem.java

/**
 * 
 */
package com.techyield.blogspot.in;

/**
 * @author SATYA
 *
 */
public class PetrolProblem {


public int startPointofPetrolTank(int [][] input){
int petrolPumpnumber=0;
try{
int row= input.length;
int totaldistance=0;
int totalpetrol=0;
for(int i=0;i<row;i++){
int col=input[i].length;
if(col!=2){
throw new UnsupportedException("Input is not a two dimentional array.");
}
}
for(int i =0; i<row;i++){
totaldistance+=input[i][1];
totalpetrol+=input[i][0];
}
if(totalpetrol<totaldistance){
return 0;
}
for(int i =0; i<row;i++){
if(input[i][0]>input[i][1]){
petrolPumpnumber=i+1;
break;
}
}

}
catch(UnsupportedException e){
System.out.println(e.getMessage());
}
catch(Exception e){
System.out.println(e.getMessage());
}
return petrolPumpnumber;
}

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

int [][] array1 ={{3,3},
{7,4},
{7,8},
{9,8}
};
PetrolProblem object = new PetrolProblem();
int petrolPumpindex =object.startPointofPetrolTank(array1);
if(petrolPumpindex >=1)
System.out.println("Petrol Tank will start from PetrolPump "+petrolPumpindex+"");
else
System.out.println("PetrolTank can't start from any petrol pump");
}

}

UnsupportedException.java


package com.techyield.blogspot.in;

public class UnsupportedException extends Exception {

public UnsupportedException(String s){
super(s);
}

}


Output :

Petrol Tank will start from PetrolPump 2







Featured Post

H1B Visa Stamping at US Consulate

  H1B Visa Stamping at US Consulate If you are outside of the US, you need to apply for US Visa at a US Consulate or a US Embassy and get H1...